btrfs: fix a bogus warning when converting only data or metadata
authorAdam Borowski <kilobyte@angband.pl>
Tue, 7 Mar 2017 22:34:44 +0000 (23:34 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 24 Mar 2018 10:00:10 +0000 (11:00 +0100)
commit4bd1761b69f3e627dfb5fc6c2ac38e451e9e67c8
treeebfabbbb29ced89dc541c1b382be61c57b6f6d07
parent355edc25c3f9b5171abaea2a160c569a1e52f4d2
btrfs: fix a bogus warning when converting only data or metadata

[ Upstream commit 14506127979a5a3d0c5d9b4cc76ce9d4ec23b717 ]

If your filesystem has, eg, data:raid0 metadata:raid1, and you run "btrfs
balance -dconvert=raid1", the meta.target field will be uninitialized.
That's otherwise ok, as it's unused except for this warning.

Thus, let's use the existing set of raid levels for the comparison.

As a side effect, non-convert balances will now nag about data>metadata.

Signed-off-by: Adam Borowski <kilobyte@angband.pl>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/volumes.c