]> git.hungrycats.org Git - linux/commit
btrfs: fix WARNING in btrfs_select_ref_head()
authorWang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Mon, 20 Jun 2016 01:18:52 +0000 (09:18 +0800)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Sun, 26 Jun 2016 19:02:33 +0000 (15:02 -0400)
commit549ed053875e5f6a647f3358366e937b0f7c0d67
treed7606e0b37653c196dbf3e1c4e0945cf41fc58c8
parent74eff645124baf09feac35e4d788d44ec3c65328
btrfs: fix WARNING in btrfs_select_ref_head()

This issue was found when testing in-band dedupe enospc behaviour,
sometimes run_one_delayed_ref() may fail for enospc reason, then
__btrfs_run_delayed_refs()will return, but forget to add num_heads_read
back, which will trigger "WARN_ON(delayed_refs->num_heads_ready == 0)" in
btrfs_select_ref_head().

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
(cherry picked from commit 885ba6b0f5ddaf3e9c2da2afd96f3e5ff3c90ece)
(cherry picked from commit 9588cc0cb28c91a17677f40699423d97684e1f98)
fs/btrfs/extent-tree.c