Skip to contentSkip to conversation

stable/btrfs: fix backport bug in d819d97ea025 ("btrfs: honor path->skip_locking in backref code")

PATCH In review Stanislaw Gruszka 3 participants 3 messages Jul 8, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stable/btrfs: fix backport bug in d819d97ea025 ("btrfs: honor path->skip_locking in backref code")

Upstream commit 38e3eebff643 ("btrfs: honor path->skip_locking in backref code") was incorrectly backported to 4.14.y . It misses removal of two lines from original commit, what cause deadlock.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203993

Fixes d819d97ea025 ("btrfs: honor path->skip_locking in backref code")

---
I did not test the patch, not even compile, but backport looks obviously wrong compared to original commit.

 fs/btrfs/backref.c | 2 --
 1 file changed, 2 deletions(-)
fs/btrfs/backref.c +0 -2
index d826fbaf7d50..e4d5e6eae409 100644
@@ -1290,8 +1290,6 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
 					ret = -EIO;
 					goto out;
 				}
-				btrfs_tree_read_lock(eb);
-				btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
 				if (!path->skip_locking) {
 					btrfs_tree_read_lock(eb);
 					btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Stanislaw Gruszka

Upstream commit 38e3eebff643 ("btrfs: honor path->skip_locking in backref code") was incorrectly backported to 4.14.y . It misses removal of two lines from original commit, what cause deadlock.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203993

Fixes d819d97ea025 ("btrfs: honor path->skip_locking in backref code")

---
I did not test the patch, not even compile, but backport looks obviously wrong compared to original commit.

I concur, it's indeed wrongly backported so:

Quoted 18 lines
 fs/btrfs/backref.c | 2 --
 1 file changed, 2 deletions(-)
fs/btrfs/backref.c +0 -2
index d826fbaf7d50..e4d5e6eae409 100644
@@ -1290,8 +1290,6 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
 					ret = -EIO;
 					goto out;
 				}
-				btrfs_tree_read_lock(eb);
-				btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
 				if (!path->skip_locking) {
 					btrfs_tree_read_lock(eb);
 					btrfs_set_lock_blocking_rw(eb, BTRFS_READ_LOCK);
#2 lore raw
In reply to Stanislaw Gruszka
Quoted 11 lines · Stanislaw Gruszka

Upstream commit 38e3eebff643 ("btrfs: honor path->skip_locking in backref code") was incorrectly backported to 4.14.y . It misses removal of two lines from original commit, what cause deadlock.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203993

Fixes d819d97ea025 ("btrfs: honor path->skip_locking in backref code")

---
I did not test the patch, not even compile, but backport looks obviously wrong compared to original commit.

Thanks for catching this!

now queued up,

greg k-h