diff options
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r-- | fs/btrfs/compression.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index 9adaa79adad9..354913177ba6 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c | |||
@@ -220,10 +220,12 @@ static void end_compressed_bio_write(struct bio *bio, int err) | |||
220 | */ | 220 | */ |
221 | inode = cb->inode; | 221 | inode = cb->inode; |
222 | tree = &BTRFS_I(inode)->io_tree; | 222 | tree = &BTRFS_I(inode)->io_tree; |
223 | cb->compressed_pages[0]->mapping = cb->inode->i_mapping; | ||
223 | tree->ops->writepage_end_io_hook(cb->compressed_pages[0], | 224 | tree->ops->writepage_end_io_hook(cb->compressed_pages[0], |
224 | cb->start, | 225 | cb->start, |
225 | cb->start + cb->len - 1, | 226 | cb->start + cb->len - 1, |
226 | NULL, 1); | 227 | NULL, 1); |
228 | cb->compressed_pages[0]->mapping = NULL; | ||
227 | 229 | ||
228 | end_compressed_writeback(inode, cb->start, cb->len); | 230 | end_compressed_writeback(inode, cb->start, cb->len); |
229 | /* note, our inode could be gone now */ | 231 | /* note, our inode could be gone now */ |
@@ -306,6 +308,7 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start, | |||
306 | else | 308 | else |
307 | ret = 0; | 309 | ret = 0; |
308 | 310 | ||
311 | page->mapping = NULL; | ||
309 | if (ret || bio_add_page(bio, page, PAGE_CACHE_SIZE, 0) < | 312 | if (ret || bio_add_page(bio, page, PAGE_CACHE_SIZE, 0) < |
310 | PAGE_CACHE_SIZE) { | 313 | PAGE_CACHE_SIZE) { |
311 | bio_get(bio); | 314 | bio_get(bio); |
@@ -423,6 +426,7 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio, | |||
423 | else | 426 | else |
424 | ret = 0; | 427 | ret = 0; |
425 | 428 | ||
429 | page->mapping = NULL; | ||
426 | if (ret || bio_add_page(comp_bio, page, PAGE_CACHE_SIZE, 0) < | 430 | if (ret || bio_add_page(comp_bio, page, PAGE_CACHE_SIZE, 0) < |
427 | PAGE_CACHE_SIZE) { | 431 | PAGE_CACHE_SIZE) { |
428 | bio_get(comp_bio); | 432 | bio_get(comp_bio); |