Btrfs: use down_read_nested to make lockdep silent
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 1 Dec 2016 00:11:04 +0000 (16:11 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Aug 2017 01:59:47 +0000 (18:59 -0700)
commit78418b86733462c913aea82e081594b1005751ba
tree12e70340970331a0cc5ddef2f0f5359de3f7554f
parent92d6a813b03a576dd821667b6566a1ddf7617137
Btrfs: use down_read_nested to make lockdep silent

[ Upstream commit e321f8a801d7b4c40da8005257b05b9c2b51b072 ]

If @block_group is not @used_bg, it'll try to get @used_bg's lock without
droping @block_group 's lock and lockdep has throwed a scary deadlock warning
about it.
Fix it by using down_read_nested.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/extent-tree.c