btrfs: fix free space calculation in dump_space_info()
authorWang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Mon, 11 Jul 2016 11:30:04 +0000 (19:30 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Jul 2016 11:52:25 +0000 (13:52 +0200)
commit39581a3a1af7e03af41dde62a6485a934deb109b
tree357f62d91afca7d631b96744c86d70d4eae0fdbf
parent751bebbe0ad261b3ac5d9e75eaec4d5fe9e23160
btrfs: fix free space calculation in dump_space_info()

In btrfs, btrfs_space_info's bytes_may_use is treated as fs used
space, as what we do in reserve_metadata_bytes() or
btrfs_alloc_data_chunk_ondemand(), so in dump_space_info(), when
calculating free space, we should also subtract btrfs_space_info's
bytes_may_use.

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c