diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-07-22 23:06:42 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:05 -0400 |
commit | ed98b56a6393c5e150fd5095b9eb7fd7d3cfb041 (patch) | |
tree | 1e69d882a08d089d083132b2b10fcf385d857620 /fs/btrfs/inode.c | |
parent | c286ac48ed7aaf53586f575af6053ae2a0f8554a (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 3da12a4d913d..28e667052ec3 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) | |||
612 | return 0; | 612 | return 0; |
613 | 613 | ||
614 | path = btrfs_alloc_path(); | 614 | path = btrfs_alloc_path(); |
615 | mutex_lock(&BTRFS_I(inode)->csum_mutex); | ||
615 | item = btrfs_lookup_csum(NULL, root, path, inode->i_ino, start, 0); | 616 | item = btrfs_lookup_csum(NULL, root, path, inode->i_ino, start, 0); |
616 | if (IS_ERR(item)) { | 617 | if (IS_ERR(item)) { |
617 | /* | 618 | /* |
@@ -640,6 +641,7 @@ int btrfs_readpage_io_hook(struct page *page, u64 start, u64 end) | |||
640 | found: | 641 | found: |
641 | set_state_private(io_tree, start, csum); | 642 | set_state_private(io_tree, start, csum); |
642 | out: | 643 | out: |
644 | mutex_unlock(&BTRFS_I(inode)->csum_mutex); | ||
643 | if (path) | 645 | if (path) |
644 | btrfs_free_path(path); | 646 | btrfs_free_path(path); |
645 | return ret; | 647 | return ret; |