diff options
author | Chris Mason <clm@fb.com> | 2016-06-08 17:36:12 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2016-06-08 17:36:12 -0400 |
commit | 719da39a61173c849f70656ed1a302e4b6deaa5b (patch) | |
tree | dcba3abd4921cdc663eb0fbad0c7e62fbe73f27c /fs/btrfs/disk-io.c | |
parent | 4c52990080e37925039a4d546937e9df2a8da944 (diff) | |
parent | 5f9e1059d9347191b271bf7d13bd83db57594d2a (diff) |
Merge branch 'misc-fixes-4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.7
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index c3764ddb2a46..1142127f6e5e 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -4133,6 +4133,17 @@ static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info, | |||
4133 | * Hint to catch really bogus numbers, bitflips or so, more exact checks are | 4133 | * Hint to catch really bogus numbers, bitflips or so, more exact checks are |
4134 | * done later | 4134 | * done later |
4135 | */ | 4135 | */ |
4136 | if (btrfs_super_bytes_used(sb) < 6 * btrfs_super_nodesize(sb)) { | ||
4137 | btrfs_err(fs_info, "bytes_used is too small %llu", | ||
4138 | btrfs_super_bytes_used(sb)); | ||
4139 | ret = -EINVAL; | ||
4140 | } | ||
4141 | if (!is_power_of_2(btrfs_super_stripesize(sb)) || | ||
4142 | btrfs_super_stripesize(sb) != sectorsize) { | ||
4143 | btrfs_err(fs_info, "invalid stripesize %u", | ||
4144 | btrfs_super_stripesize(sb)); | ||
4145 | ret = -EINVAL; | ||
4146 | } | ||
4136 | if (btrfs_super_num_devices(sb) > (1UL << 31)) | 4147 | if (btrfs_super_num_devices(sb) > (1UL << 31)) |
4137 | printk(KERN_WARNING "BTRFS: suspicious number of devices: %llu\n", | 4148 | printk(KERN_WARNING "BTRFS: suspicious number of devices: %llu\n", |
4138 | btrfs_super_num_devices(sb)); | 4149 | btrfs_super_num_devices(sb)); |