bcachefs: __bio_compress() fix up.
authorDaniel Hill <daniel@gluo.nz>
Sat, 15 Oct 2022 13:25:54 +0000 (02:25 +1300)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:44 +0000 (17:09 -0400)
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>
fs/bcachefs/compress.c

index f692f35a6a98e735784c9a856b4833c67d834aff..2b7080b67ecac518d297b77c953c2c6374f9bd23 100644 (file)
@@ -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);