Skip to content

Commit

Permalink
Btrfs: skip locking if searching the commit root in csum lookup
Browse files Browse the repository at this point in the history
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 <josef@redhat.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Sep 11, 2011
1 parent e0b6d65 commit ddf23b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/btrfs/file-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ddf23b3

Please sign in to comment.