From: Daniel Hill Date: Wed, 6 Dec 2023 08:26:00 +0000 (+1300) Subject: bcachefs: rebalance shouldn't attempt to compress unwritten extents X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e59728883943c6820a0aa413db66a38f2e8c27bd;p=linux.git bcachefs: rebalance shouldn't attempt to compress unwritten extents This fixes a bug where rebalance would loop repeatedly on the same extents. Signed-off-by: Daniel Hill Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c index f6c92df552702..9d8afcb5979a1 100644 --- a/fs/bcachefs/extents.c +++ b/fs/bcachefs/extents.c @@ -1294,7 +1294,8 @@ unsigned bch2_bkey_ptrs_need_rebalance(struct bch_fs *c, struct bkey_s_c k, unsigned i = 0; bkey_for_each_ptr_decode(k.k, ptrs, p, entry) { - if (p.crc.compression_type == BCH_COMPRESSION_TYPE_incompressible) { + if (p.crc.compression_type == BCH_COMPRESSION_TYPE_incompressible || + p.ptr.unwritten) { rewrite_ptrs = 0; goto incompressible; }