diff options
author | Sam Tygier <samtygier@yahoo.co.uk> | 2016-01-06 09:46:12 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-01-07 15:20:56 +0100 |
commit | ee592d07716139ef7c3ea8049936cbc3aafbc533 (patch) | |
tree | 5189f3283edad9305b999ce6806871a0f6d5fba6 /fs | |
parent | btrfs: statfs: report zero available if metadata are exhausted (diff) | |
download | linux-ee592d07716139ef7c3ea8049936cbc3aafbc533.tar.xz linux-ee592d07716139ef7c3ea8049936cbc3aafbc533.zip |
Btrfs: Check metadata redundancy on balance
When converting a filesystem via balance check that metadata mode
is at least as redundant as the data mode. For example give warning
when:
-dconvert=raid1 -mconvert=single
Signed-off-by: Sam Tygier <samtygier@yahoo.co.uk>
[ minor message reformatting ]
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/volumes.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index e95d24967fa0..574a717fcb6e 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -3748,6 +3748,13 @@ int btrfs_balance(struct btrfs_balance_control *bctl, } } while (read_seqretry(&fs_info->profiles_lock, seq)); + if (btrfs_get_num_tolerated_disk_barrier_failures(bctl->meta.target) < + btrfs_get_num_tolerated_disk_barrier_failures(bctl->data.target)) { + btrfs_warn(fs_info, + "metatdata profile 0x%llx has lower redundancy than data profile 0x%llx", + bctl->meta.target, bctl->data.target); + } + if (bctl->sys.flags & BTRFS_BALANCE_ARGS_CONVERT) { fs_info->num_tolerated_disk_barrier_failures = min( btrfs_calc_num_tolerated_disk_barrier_failures(fs_info), |