diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-01 11:26:07 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:01 -0400 |
commit | ecbe2402cb4e4e7413544dc392c1a78d0f290292 (patch) | |
tree | 87d11983cac8bfef09ba94d69c3d210af0927e2b /fs/btrfs/extent-tree.c | |
parent | 140dfd00ae544cdc0c9951b80ad6df61e62859e2 (diff) |
Btrfs: Keep fs_mutex during reads done by snapshot deletion
There was an optimization to drop the fs_mutex when doing snapshot deletion
reads, but this can lead to false positives on checksumming errors. Keep
the lock for now.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index c226656f29b7..cf283b0271ac 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -2046,11 +2046,12 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans, | |||
2046 | if (!next || !btrfs_buffer_uptodate(next)) { | 2046 | if (!next || !btrfs_buffer_uptodate(next)) { |
2047 | free_extent_buffer(next); | 2047 | free_extent_buffer(next); |
2048 | reada_walk_down(root, cur, path->slots[*level]); | 2048 | reada_walk_down(root, cur, path->slots[*level]); |
2049 | mutex_unlock(&root->fs_info->fs_mutex); | ||
2050 | next = read_tree_block(root, bytenr, blocksize); | 2049 | next = read_tree_block(root, bytenr, blocksize); |
2051 | mutex_lock(&root->fs_info->fs_mutex); | ||
2052 | 2050 | ||
2053 | /* we dropped the lock, check one more time */ | 2051 | /* we used to drop the lock above, keep the |
2052 | * code to double check so that we won't forget | ||
2053 | * when we drop the lock again in the future | ||
2054 | */ | ||
2054 | ret = lookup_extent_ref(trans, root, bytenr, | 2055 | ret = lookup_extent_ref(trans, root, bytenr, |
2055 | blocksize, &refs); | 2056 | blocksize, &refs); |
2056 | BUG_ON(ret); | 2057 | BUG_ON(ret); |