From: Josef Bacik Date: Sun, 11 Sep 2011 14:52:24 +0000 (-0400) Subject: Btrfs: skip locking if searching the commit root in csum lookup X-Git-Tag: v3.12-rc1~4691^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddf23b3fc6850bd4654d51ec9457fe7c77cde51e;p=kernel%2Fkernel-generic.git Btrfs: skip locking if searching the commit root in csum lookup It's not enough to just search the commit root, since we could be cow'ing the very block we need to search through, which would mean that its locked and we'll still deadlock. So use path->skip_locking as well. Thanks, Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index b910694..a1cb782 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c @@ -183,8 +183,10 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root, * read from the commit root and sidestep a nasty deadlock * between reading the free space cache and updating the csum tree. */ - if (btrfs_is_free_space_inode(root, inode)) + if (btrfs_is_free_space_inode(root, inode)) { path->search_commit_root = 1; + path->skip_locking = 1; + } disk_bytenr = (u64)bio->bi_sector << 9; if (dio)