diff options
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r-- | fs/btrfs/disk-io.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 86e84a8579e3..7ce3f83c5dd6 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -1011,9 +1011,16 @@ void btrfs_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) | |||
1011 | spin_lock(&em_tree->lock); | 1011 | spin_lock(&em_tree->lock); |
1012 | em = lookup_extent_mapping(em_tree, offset, PAGE_CACHE_SIZE); | 1012 | em = lookup_extent_mapping(em_tree, offset, PAGE_CACHE_SIZE); |
1013 | spin_unlock(&em_tree->lock); | 1013 | spin_unlock(&em_tree->lock); |
1014 | if (!em) | 1014 | if (!em) { |
1015 | __unplug_io_fn(bdi, page); | ||
1015 | return; | 1016 | return; |
1017 | } | ||
1016 | 1018 | ||
1019 | if (em->block_start >= EXTENT_MAP_LAST_BYTE) { | ||
1020 | free_extent_map(em); | ||
1021 | __unplug_io_fn(bdi, page); | ||
1022 | return; | ||
1023 | } | ||
1017 | offset = offset - em->start; | 1024 | offset = offset - em->start; |
1018 | btrfs_unplug_page(&BTRFS_I(inode)->root->fs_info->mapping_tree, | 1025 | btrfs_unplug_page(&BTRFS_I(inode)->root->fs_info->mapping_tree, |
1019 | em->block_start + offset, page); | 1026 | em->block_start + offset, page); |