Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
Btrfs: btrfs_check_super_valid: Allow 4096 as stripesize
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chandan Rajendra authored and kdave committed Jun 17, 2016
1 parent 89c5a54 commit dd5c931
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -4134,7 +4134,8 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
ret = -EINVAL;
}
if (!is_power_of_2(btrfs_super_stripesize(sb)) ||
btrfs_super_stripesize(sb) != sectorsize) {
((btrfs_super_stripesize(sb) != sectorsize) &&
(btrfs_super_stripesize(sb) != 4096))) {
btrfs_err(fs_info, "invalid stripesize %u",
btrfs_super_stripesize(sb));
ret = -EINVAL;
Expand Down

0 comments on commit dd5c931

Please sign in to comment.