Patch "Btrfs: use down_read_nested to make lockdep silent" has been added to the 4.9-stable tree
From: <gregkh@linuxfoundation.org>
Date: 2017-08-04 22:26:52
This is a note to let you know that I've just added the patch titled
Btrfs: use down_read_nested to make lockdep silent
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
btrfs-use-down_read_nested-to-make-lockdep-silent.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let [off-list ref] know about it.
From foo@baz Fri Aug 4 15:15:01 PDT 2017
From: Liu Bo <redacted> Date: Wed, 30 Nov 2016 16:11:04 -0800 Subject: Btrfs: use down_read_nested to make lockdep silent From: Liu Bo <redacted> [ 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 <redacted> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <redacted> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> --- fs/btrfs/extent-tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c@@ -7401,7 +7401,8 @@ btrfs_lock_cluster(struct btrfs_block_gr spin_unlock(&cluster->refill_lock); - down_read(&used_bg->data_rwsem); + /* We should only have one-level nested. */ + down_read_nested(&used_bg->data_rwsem, SINGLE_DEPTH_NESTING); spin_lock(&cluster->refill_lock); if (used_bg == cluster->block_group)
Patches currently in stable-queue which might be from bo.li.liu@oracle.com are queue-4.9/btrfs-fix-lockdep-warning-about-log_mutex.patch queue-4.9/btrfs-adjust-outstanding_extents-counter-properly-when-dio-write-is-split.patch queue-4.9/btrfs-use-down_read_nested-to-make-lockdep-silent.patch