summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-02 15:43:21 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-02 15:43:21 -0400
commit2da566edd8ce32ae2952b863ee634bcc2e7d63c1 (patch)
tree35dbd7064dbb6d60924bc1d80703ee2efc72ad03 /fs/btrfs/file-item.c
parent7cfcc17e7f2334a0503331264c1340de4e564c85 (diff)
Btrfs: csum_verify_file_block locking fix
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index e7510ac5559..2c98b620c59 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -110,6 +110,7 @@ int btrfs_csum_verify_file_block(struct btrfs_root *root,
file_key.offset = offset;
file_key.flags = 0;
btrfs_set_key_type(&file_key, BTRFS_CSUM_ITEM_KEY);
+ mutex_lock(&root->fs_info->fs_mutex);
ret = btrfs_search_slot(NULL, root, &file_key, path, 0, 0);
if (ret)
goto fail;
@@ -123,6 +124,7 @@ int btrfs_csum_verify_file_block(struct btrfs_root *root,
fail:
btrfs_release_path(root, path);
btrfs_free_path(path);
+ mutex_unlock(&root->fs_info->fs_mutex);
return ret;
}