Skip to content

Commit 8870dbe

Browse files
adam900710kdave
authored andcommitted
btrfs: raid56: enable bs > ps support
The support code for bs > ps is complete, enable it and update assertions. Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 89ca1a4 commit 8870dbe

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

fs/btrfs/disk-io.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3258,12 +3258,6 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount)
32583258
PAGE_SIZE, fs_info->sectorsize);
32593259
return -EINVAL;
32603260
}
3261-
if (fs_info->sectorsize > PAGE_SIZE && btrfs_fs_incompat(fs_info, RAID56)) {
3262-
btrfs_err(fs_info,
3263-
"RAID56 is not supported for page size %lu with sectorsize %u",
3264-
PAGE_SIZE, fs_info->sectorsize);
3265-
return -EINVAL;
3266-
}
32673261

32683262
/* This can be called by remount, we need to protect the super block. */
32693263
spin_lock(&fs_info->super_lock);

fs/btrfs/raid56.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,8 +1070,12 @@ static struct btrfs_raid_bio *alloc_rbio(struct btrfs_fs_info *fs_info,
10701070
const unsigned int sector_nsteps = fs_info->sectorsize / step;
10711071
struct btrfs_raid_bio *rbio;
10721072

1073-
/* PAGE_SIZE must also be aligned to sectorsize for subpage support */
1074-
ASSERT(IS_ALIGNED(PAGE_SIZE, fs_info->sectorsize));
1073+
/*
1074+
* For bs <= ps cases, ps must be aligned to bs.
1075+
* For bs > ps cases, bs must be aligned to ps.
1076+
*/
1077+
ASSERT(IS_ALIGNED(PAGE_SIZE, fs_info->sectorsize) ||
1078+
IS_ALIGNED(fs_info->sectorsize, PAGE_SIZE));
10751079
/*
10761080
* Our current stripe len should be fixed to 64k thus stripe_nsectors
10771081
* (at most 16) should be no larger than BITS_PER_LONG.
@@ -3014,9 +3018,6 @@ void raid56_parity_cache_data_folios(struct btrfs_raid_bio *rbio,
30143018
unsigned int foffset = 0;
30153019
int ret;
30163020

3017-
/* We shouldn't hit RAID56 for bs > ps cases for now. */
3018-
ASSERT(fs_info->sectorsize <= PAGE_SIZE);
3019-
30203021
/*
30213022
* If we hit ENOMEM temporarily, but later at
30223023
* raid56_parity_submit_scrub_rbio() time it succeeded, we just do

0 commit comments

Comments
 (0)