btrfs: fix wrong accounting of raid1 data profile in statfs
commitc44bd16a6cc8418759f485f6980941994b87f7be
authorDavid Sterba <dsterba@suse.cz>
Fri, 14 Nov 2014 14:05:06 +0000 (14 15:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 18:27:49 +0000 (8 10:27 -0800)
tree0d5404829d819927624aabc77e4e3d3d6f91de42
parentf9c9bec6a603e71d6296612627b830d93c2b78bf
btrfs: fix wrong accounting of raid1 data profile in statfs

commit 0d95c1bec906dd1ad951c9c001e798ca52baeb0f upstream.

The sizes that are obtained from space infos are in raw units and have
to be adjusted according to the raid factor. This was missing for
f_bavail and df reported doubled size for raid1.

Reported-by: Martin Steigerwald <Martin@lichtvoll.de>
Fixes: ba7b6e62f420 ("btrfs: adjust statfs calculations according to raid profiles")
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/super.c