Skip to content

Commit dd5c931

Browse files
Chandan Rajendrakdave
authored andcommitted
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 <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 89c5a54 commit dd5c931

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/btrfs/disk-io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4134,7 +4134,8 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
41344134
ret = -EINVAL;
41354135
}
41364136
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))) {
41384139
btrfs_err(fs_info, "invalid stripesize %u",
41394140
btrfs_super_stripesize(sb));
41404141
ret = -EINVAL;

0 commit comments

Comments
 (0)