Skip to contentSkip to conversation

Patch "Btrfs: use down_read_nested to make lockdep silent" has been added to the 4.4-stable tree

PATCH [email protected] 1 participant 2 messages Aug 4, 2017 – Aug 7, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

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.4-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.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Fri Aug 4 15:15:51 PDT 2017

From: Liu Bo <[email protected]>
Date: Wed, 30 Nov 2016 16:11:04 -0800
Subject: Btrfs: use down_read_nested to make lockdep silent

From: Liu Bo <[email protected]>

[ 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.

---
 fs/btrfs/extent-tree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/extent-tree.c +2 -1
index e46e7fbe1b34..14a37ff0b9e3 100644
@@ -7401,7 +7401,8 @@ btrfs_lock_cluster(struct btrfs_block_group_cache *block_group,
 
 		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)
Signature · 8 lines
2.13.4



Patches currently in stable-queue which might be from [email protected] are

queue-4.4/btrfs-adjust-outstanding_extents-counter-properly-when-dio-write-is-split.patch
queue-4.4/btrfs-use-down_read_nested-to-make-lockdep-silent.patch
author maintainer
#1 lore raw
Quoted 8 lines · On Fri, Aug 04, 2017 at 03:26:10PM -0700, [email protected] wrote:

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.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

Quoted 6 lines

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.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Oops no, this did not apply, somehow I missed that. If someone wants this in 4.4, please provide a working backport.

thanks,

greg k-h

Quoted 47 lines
Quoted 1 line

From foo@baz Fri Aug 4 15:15:51 PDT 2017

From: Liu Bo <[email protected]>
Date: Wed, 30 Nov 2016 16:11:04 -0800
Subject: Btrfs: use down_read_nested to make lockdep silent

From: Liu Bo <[email protected]>

[ 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.

---
 fs/btrfs/extent-tree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/extent-tree.c +2 -1
index e46e7fbe1b34..14a37ff0b9e3 100644
@@ -7401,7 +7401,8 @@ btrfs_lock_cluster(struct btrfs_block_group_cache *block_group,
 
 		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)
Signature · 8 lines
2.13.4



Patches currently in stable-queue which might be from [email protected] are

queue-4.4/btrfs-adjust-outstanding_extents-counter-properly-when-dio-write-is-split.patch
queue-4.4/btrfs-use-down_read_nested-to-make-lockdep-silent.patch