* [PATCH] Btrfs: btrfs_check_super_valid: Allow 4096 as stripesize
@ 2016-06-16 16:37 Chandan Rajendra
2016-06-17 16:40 ` David Sterba
0 siblings, 1 reply; 2+ messages in thread
From: Chandan Rajendra @ 2016-06-16 16:37 UTC (permalink / raw)
To: linux-btrfs; +Cc: Chandan Rajendra, dsterba, bo.li.liu
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>
---
fs/btrfs/disk-io.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 1142127..7f92b4f 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4139,7 +4139,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;
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Btrfs: btrfs_check_super_valid: Allow 4096 as stripesize
2016-06-16 16:37 [PATCH] Btrfs: btrfs_check_super_valid: Allow 4096 as stripesize Chandan Rajendra
@ 2016-06-17 16:40 ` David Sterba
0 siblings, 0 replies; 2+ messages in thread
From: David Sterba @ 2016-06-17 16:40 UTC (permalink / raw)
To: Chandan Rajendra; +Cc: linux-btrfs, dsterba, bo.li.liu
On Thu, Jun 16, 2016 at 10:07:58PM +0530, Chandan Rajendra wrote:
> 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>
Reviewed-by: David Sterba <dsterba@suse.com>
As we've discused on IRC, there's one more place to fix the stripesize,
but I'll take this one as it's fixing the validation side.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-06-17 16:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-16 16:37 [PATCH] Btrfs: btrfs_check_super_valid: Allow 4096 as stripesize Chandan Rajendra
2016-06-17 16:40 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).