diff options
author | Chandan Rajendra <chandan@linux.vnet.ibm.com> | 2016-06-16 12:37:58 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-06-17 12:32:49 -0400 |
commit | dd5c93111dc9d26e038ac437f7a403d617e82c62 (patch) | |
tree | 0e2bedc70d8b60958fb49fcb3392e95efacf39eb /fs | |
parent | 89c5a5441d703ba068699524ae59f7806e9b173d (diff) |
Btrfs: btrfs_check_super_valid: Allow 4096 as stripesize
Older btrfs-progs/mkfs.btrfs sets 4096 as the stripesize. Hence
restricting stripesize to be equal to sectorsize would cause super block
validation to return an error on architectures where PAGE_SIZE is not
equal to 4096.
Hence as a workaround, this commit allows stripesize to be set to 4096
bytes.
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/disk-io.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 789f5f233940..54cca7a1572b 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -4134,7 +4134,8 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info, | |||
4134 | ret = -EINVAL; | 4134 | ret = -EINVAL; |
4135 | } | 4135 | } |
4136 | if (!is_power_of_2(btrfs_super_stripesize(sb)) || | 4136 | if (!is_power_of_2(btrfs_super_stripesize(sb)) || |
4137 | btrfs_super_stripesize(sb) != sectorsize) { | 4137 | ((btrfs_super_stripesize(sb) != sectorsize) && |
4138 | (btrfs_super_stripesize(sb) != 4096))) { | ||
4138 | btrfs_err(fs_info, "invalid stripesize %u", | 4139 | btrfs_err(fs_info, "invalid stripesize %u", |
4139 | btrfs_super_stripesize(sb)); | 4140 | btrfs_super_stripesize(sb)); |
4140 | ret = -EINVAL; | 4141 | ret = -EINVAL; |