]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: Don't unnecessarily decrypt data when moving
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 24 Mar 2025 20:25:53 +0000 (16:25 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 26 Mar 2025 20:26:35 +0000 (16:26 -0400)
There's various checks for "are we going to compress this" - but we're
not going to compress if we know it's incompressible.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/io_write.c

index 9613361a519ba55083a2eb45e43557add960367d..07b55839768ea9e3241598c63cc84ff3c5418b91 100644 (file)
@@ -940,6 +940,9 @@ static int bch2_write_extent(struct bch_write_op *op, struct write_point *wp,
        bool page_alloc_failed = false;
        int ret, more = 0;
 
+       if (op->incompressible)
+               op->compression_opt = 0;
+
        BUG_ON(!bio_sectors(src));
 
        ec_buf = bch2_writepoint_ec_buf(c, wp);