aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-04-17 11:29:12 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:01 -0400
commit3b951516ed703af0f6d82053937655ad69b60864 (patch)
tree616e648b8683e6bb2996c7ce6bafb8f592244698 /fs/btrfs/volumes.c
parent7b859fe7cd383fa5e7e379884a748680d0af7bcc (diff)
Btrfs: Use the extent map cache to find the logical disk block during data retries
The data read retry code needs to find the logical disk block before it can resubmit new bios. But, finding this block isn't allowed to take the fs_mutex because that will deadlock with a number of different callers. This changes the retry code to use the extent map cache instead, but that requires the extent map cache to have the extent we're looking for. This is a problem because btrfs_drop_extent_cache just drops the entire extent instead of the little tiny part it is invalidating. The bulk of the code in this patch changes btrfs_drop_extent_cache to invalidate only a portion of the extent cache, and changes btrfs_get_extent to deal with the results. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index e6417a573d44..0e658c1d8211 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -883,6 +883,9 @@ again:
883 spin_lock(&em_tree->lock); 883 spin_lock(&em_tree->lock);
884 em = lookup_extent_mapping(em_tree, logical, *length); 884 em = lookup_extent_mapping(em_tree, logical, *length);
885 spin_unlock(&em_tree->lock); 885 spin_unlock(&em_tree->lock);
886 if (!em) {
887 printk("unable to find logical %Lu\n", logical);
888 }
886 BUG_ON(!em); 889 BUG_ON(!em);
887 890
888 BUG_ON(em->start > logical || em->start + em->len < logical); 891 BUG_ON(em->start > logical || em->start + em->len < logical);