summaryrefslogtreecommitdiff
path: root/fs/bcachefs/compress.c
diff options
context:
space:
mode:
authorDaniel Hill <daniel@gluo.nz>2022-10-16 02:25:54 +1300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:44 -0400
commitbe75bb7a0e0565c0c409842048567e8d07f28675 (patch)
treec65fa95d734cb68e44ee2a87214ebd85c2931491 /fs/bcachefs/compress.c
parent597c6d17b18e2d53e7ab30c5626f38422fe4848b (diff)
bcachefs: __bio_compress() fix up.
A single block can't be compressed, so it's incompressible. This stops rebalance repeatably marking extents as uncompressed. Signed-off-by: Daniel Hill <daniel@gluo.nz> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/compress.c')
-rw-r--r--fs/bcachefs/compress.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/compress.c b/fs/bcachefs/compress.c
index f692f35a6a98..2b7080b67eca 100644
--- a/fs/bcachefs/compress.c
+++ b/fs/bcachefs/compress.c
@@ -377,7 +377,7 @@ static unsigned __bio_compress(struct bch_fs *c,
/* If it's only one block, don't bother trying to compress: */
if (src->bi_iter.bi_size <= c->opts.block_size)
- return 0;
+ return BCH_COMPRESSION_TYPE_incompressible;
dst_data = bio_map_or_bounce(c, dst, WRITE);
src_data = bio_map_or_bounce(c, src, READ);