Skip to content

Commit 3254c87

Browse files
Miao Xiechrismason-xx
authored andcommitted
Btrfs: fix unreleased path in btrfs_orphan_cleanup()
When we did stress test for the space relocation, the deadlock happened. By debugging, We found it was caused by the carelessness that we forgot to unlock the read lock of the extent buffers in btrfs_orphan_cleanup() before we end the transaction handle, so the transaction commit task waited the task, which called btrfs_orphan_cleanup(), to unlock the extent buffer, but that task waited the commit task to end the transaction commit, and the deadlock happened. Fix it. Signed-ff-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
1 parent ba38eb4 commit 3254c87

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎fs/btrfs/inode.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,6 +2201,9 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
22012201
if (ret)
22022202
goto out;
22032203
}
2204+
/* release the path since we're done with it */
2205+
btrfs_release_path(path);
2206+
22042207
root->orphan_cleanup_state = ORPHAN_CLEANUP_DONE;
22052208

22062209
if (root->orphan_block_rsv)

0 commit comments

Comments
 (0)