btrfs: don't pass compressed pages to btrfs_writepage_endio_finish_ordered()
authorQu Wenruo <wqu@suse.com>
Mon, 27 Sep 2021 07:21:46 +0000 (15:21 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Oct 2021 17:08:03 +0000 (19:08 +0200)
Since async_extent holds the compressed page, it would trigger the new
ASSERT() in btrfs_mark_ordered_io_finished() which checks that the range
is inside the page.

Now btrfs_writepage_endio_finish_ordered() can accept @page == NULL,
just pass NULL to btrfs_writepage_endio_finish_ordered().

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index 82dc636c4b512edd6cfa1cfb5bbd059c317706f9..9ae417aaea2899ff2df2ca273c3b94c99710d1dc 100644 (file)
@@ -973,15 +973,12 @@ retry:
                                    async_extent->nr_pages,
                                    async_chunk->write_flags,
                                    async_chunk->blkcg_css)) {
-                       struct page *p = async_extent->pages[0];
                        const u64 start = async_extent->start;
                        const u64 end = start + async_extent->ram_size - 1;
 
-                       p->mapping = inode->vfs_inode.i_mapping;
-                       btrfs_writepage_endio_finish_ordered(inode, p, start,
+                       btrfs_writepage_endio_finish_ordered(inode, NULL, start,
                                                             end, false);
 
-                       p->mapping = NULL;
                        extent_clear_unlock_delalloc(inode, start, end, NULL, 0,
                                                     PAGE_END_WRITEBACK |
                                                     PAGE_SET_ERROR);