summaryrefslogtreecommitdiff
path: root/fs/btrfs/compression.c
diff options
context:
space:
mode:
authorMaxime Ripard <mripard@kernel.org>2026-03-30 10:05:36 +0200
committerMaxime Ripard <mripard@kernel.org>2026-03-30 10:05:36 +0200
commit6fdfd24017756bbe27ccc786051e97f3bf0c3d62 (patch)
tree2f826d4f094a9edce9872d284172b6c5d3f7c063 /fs/btrfs/compression.c
parent3bce3fdd1ff2ba242f76ab66659fff27207299f1 (diff)
parent7aaa8047eafd0bd628065b15757d9b48c5f9c07d (diff)
Merge drm/drm-fixes into drm-misc-next-fixes
Boris needs 7.0-rc6 for a shmem helper fix. Signed-off-by: Maxime Ripard <mripard@kernel.org>
Diffstat (limited to 'fs/btrfs/compression.c')
-rw-r--r--fs/btrfs/compression.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 790518a8c803..85199944c1eb 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -320,10 +320,16 @@ void btrfs_submit_compressed_write(struct btrfs_ordered_extent *ordered,
ASSERT(IS_ALIGNED(ordered->file_offset, fs_info->sectorsize));
ASSERT(IS_ALIGNED(ordered->num_bytes, fs_info->sectorsize));
- ASSERT(cb->writeback);
+ /*
+ * This flag determines if we should clear the writeback flag from the
+ * page cache. But this function is only utilized by encoded writes, it
+ * never goes through the page cache.
+ */
+ ASSERT(!cb->writeback);
cb->start = ordered->file_offset;
cb->len = ordered->num_bytes;
+ ASSERT(cb->bbio.bio.bi_iter.bi_size == ordered->disk_num_bytes);
cb->compressed_len = ordered->disk_num_bytes;
cb->bbio.bio.bi_iter.bi_sector = ordered->disk_bytenr >> SECTOR_SHIFT;
cb->bbio.ordered = ordered;
@@ -345,8 +351,7 @@ struct compressed_bio *btrfs_alloc_compressed_write(struct btrfs_inode *inode,
cb = alloc_compressed_bio(inode, start, REQ_OP_WRITE, end_bbio_compressed_write);
cb->start = start;
cb->len = len;
- cb->writeback = true;
-
+ cb->writeback = false;
return cb;
}