diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-10-29 17:31:44 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2015-11-02 15:10:14 +0100 |
commit | ba4476bc628ad7fd373941a23a46bc41f42855c6 (patch) | |
tree | 54367625e3743c2535355c43a125aafe01d2d69b /inode-map.c | |
parent | 0b69dfa4106025eed865bfced66e989f4a27e116 (diff) |
btrfs-progs: Fix negative eb's ref_cnt in btrfs-calc-size
btrfs-calc-size show following warning:
# btrfs-calc-size /dev/sda6
Calculating size of root tree
...
extent_io.c:582: free_extent_buffer: Assertion `eb->refs < 0` failed.
./btrfs-calc-size[0x41d642]
./btrfs-calc-size(free_extent_buffer+0x70)[0x41e1c1]
./btrfs-calc-size(btrfs_free_fs_root+0x11)[0x40e1e8]
./btrfs-calc-size[0x40e215]
./btrfs-calc-size(rb_free_nodes+0x1d)[0x4326fe]
./btrfs-calc-size(close_ctree+0x3f3)[0x40f9ea]
./btrfs-calc-size(main+0x200)[0x431b4e]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x3858621d65]
./btrfs-calc-size[0x407009]
Reason:
path in calc_root_size() is only used to save node data,
it don't hold ref_cnt for each eb in.
Using btrfs_free_path() to free path will reduce these eb
again, and cause many problems, as negative ref_cnt or
invalid memory access.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'inode-map.c')
0 files changed, 0 insertions, 0 deletions