diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-07-15 12:41:42 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-07-19 15:07:11 -0400 |
commit | fec386ac1428f9c0e672df952cbca5cebd4e4e2f (patch) | |
tree | 3dbfcb86647729564322d967bc7f00b523123e8d /fs/btrfs/extent-tree.c | |
parent | 3c8f24225752fba30f7265202ce6092318ed9fac (diff) |
Btrfs: fix lock leak when resuming snapshot deletion
We aren't setting path->locks[level] when we resume a snapshot deletion which
means we won't unlock the buffer when we free the path. This causes deadlocks
if we happen to re-allocate the block before we've evicted the extent buffer
from cache. Thanks,
Cc: stable@vger.kernel.org
Reported-by: Alex Lyakas <alex.btrfs@zadarastorage.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a429704dd95f..e814b1312511 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -7523,6 +7523,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, | |||
7523 | while (1) { | 7523 | while (1) { |
7524 | btrfs_tree_lock(path->nodes[level]); | 7524 | btrfs_tree_lock(path->nodes[level]); |
7525 | btrfs_set_lock_blocking(path->nodes[level]); | 7525 | btrfs_set_lock_blocking(path->nodes[level]); |
7526 | path->locks[level] = BTRFS_WRITE_LOCK_BLOCKING; | ||
7526 | 7527 | ||
7527 | ret = btrfs_lookup_extent_info(trans, root, | 7528 | ret = btrfs_lookup_extent_info(trans, root, |
7528 | path->nodes[level]->start, | 7529 | path->nodes[level]->start, |
@@ -7538,6 +7539,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, | |||
7538 | break; | 7539 | break; |
7539 | 7540 | ||
7540 | btrfs_tree_unlock(path->nodes[level]); | 7541 | btrfs_tree_unlock(path->nodes[level]); |
7542 | path->locks[level] = 0; | ||
7541 | WARN_ON(wc->refs[level] != 1); | 7543 | WARN_ON(wc->refs[level] != 1); |
7542 | level--; | 7544 | level--; |
7543 | } | 7545 | } |