diff options
author | Qu Wenruo <wqu@suse.com> | 2021-09-27 10:22:01 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-10-26 20:08:04 +0300 |
commit | 741ec653ab58f5f263f2b6df38157997661c7a50 (patch) | |
tree | eda35cc110f5c62b95ee1af5987e9fc117cb8194 /fs/btrfs/compression.c | |
parent | bbbff01a47bfe1b7733c5ccac6a78ff6d7a8954f (diff) | |
download | linux-741ec653ab58f5f263f2b6df38157997661c7a50.tar.xz |
btrfs: subpage: make end_compressed_bio_writeback() compatible
In end_compressed_writeback() we just clear the full page writeback.
For subpage case, if there are two delalloc ranges in the same page, the
2nd range will trigger a BUG_ON() as the page writeback is already
cleared by previous range.
Fix it by using btrfs_page_clamp_clear_writeback() helper.
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r-- | fs/btrfs/compression.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c index ab2eb936975f..1d071c8d6fff 100644 --- a/fs/btrfs/compression.c +++ b/fs/btrfs/compression.c @@ -334,6 +334,7 @@ out: static noinline void end_compressed_writeback(struct inode *inode, const struct compressed_bio *cb) { + struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); unsigned long index = cb->start >> PAGE_SHIFT; unsigned long end_index = (cb->start + cb->len - 1) >> PAGE_SHIFT; struct page *pages[16]; @@ -356,7 +357,8 @@ static noinline void end_compressed_writeback(struct inode *inode, for (i = 0; i < ret; i++) { if (cb->errors) SetPageError(pages[i]); - end_page_writeback(pages[i]); + btrfs_page_clamp_clear_writeback(fs_info, pages[i], + cb->start, cb->len); put_page(pages[i]); } nr_pages -= ret; |