mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 21:51:05 +00:00
Btrfs: Take the csum mutex while reading checksums
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
c286ac48ed
commit
ed98b56a63
5 changed files with 12 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue