summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent_io.c')
-rw-r--r--fs/btrfs/extent_io.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index bd15cdc..40a5f53 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2808,10 +2808,15 @@ struct extent_buffer *find_extent_buffer(struct extent_io_tree *tree,
goto lru_add;
for (i = 0; i < num_pages; i++, index++) {
- p = find_lock_page(mapping, index);
+ p = find_get_page(mapping, index);
if (!p) {
goto fail;
}
+ if (TestSetPageLocked(p)) {
+ page_cache_release(p);
+ goto fail;
+ }
+
set_page_extent_mapped(p);
mark_page_accessed(p);
OpenPOWER on IntegriCloud