Commit e5972888 authored by Daniel Hill's avatar Daniel Hill Committed by Kent Overstreet
Browse files

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: default avatarDaniel Hill <daniel@gluo.nz>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 57962305
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
			}