aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-07-22 23:06:42 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:05 -0400
commited98b56a6393c5e150fd5095b9eb7fd7d3cfb041 (patch)
tree1e69d882a08d089d083132b2b10fcf385d857620 /fs/btrfs/inode.c
parentc286ac48ed7aaf53586f575af6053ae2a0f8554a (diff)
Btrfs: Take the csum mutex while reading checksums
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 3da12a4d913..28e667052ec 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -612,6 +612,7 @@ int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end)
return 0;
path = btrfs_alloc_path();
+ mutex_lock(&BTRFS_I(inode)->csum_mutex);
item = btrfs_lookup_csum(NULL, root, path, inode->i_ino, start, 0);
if (IS_ERR(item)) {
/*
@@ -640,6 +641,7 @@ int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end)
found:
set_state_private(io_tree, start, csum);
out:
+ mutex_unlock(&BTRFS_I(inode)->csum_mutex);
if (path)
btrfs_free_path(path);
return ret;