Skip to content

Commit

Permalink
Btrfs: Keep fs_mutex during reads done by snapshot deletion
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 140dfd0 commit ecbe240
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2046,11 +2046,12 @@ static int noinline walk_down_tree(struct btrfs_trans_handle *trans,
if (!next || !btrfs_buffer_uptodate(next)) {
free_extent_buffer(next);
reada_walk_down(root, cur, path->slots[*level]);
mutex_unlock(&root->fs_info->fs_mutex);
next = read_tree_block(root, bytenr, blocksize);
mutex_lock(&root->fs_info->fs_mutex);

/* we dropped the lock, check one more time */
/* we used to drop the lock above, keep the
* code to double check so that we won't forget
* when we drop the lock again in the future
*/
ret = lookup_extent_ref(trans, root, bytenr,
blocksize, &refs);
BUG_ON(ret);
Expand Down

0 comments on commit ecbe240

Please sign in to comment.