Skip to content

Commit e597288

Browse files
YellowOnionKent Overstreet
authored andcommitted
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 <daniel@gluo.nz> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 5796230 commit e597288

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/bcachefs/extents.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,8 @@ unsigned bch2_bkey_ptrs_need_rebalance(struct bch_fs *c, struct bkey_s_c k,
12941294
unsigned i = 0;
12951295

12961296
bkey_for_each_ptr_decode(k.k, ptrs, p, entry) {
1297-
if (p.crc.compression_type == BCH_COMPRESSION_TYPE_incompressible) {
1297+
if (p.crc.compression_type == BCH_COMPRESSION_TYPE_incompressible ||
1298+
p.ptr.unwritten) {
12981299
rewrite_ptrs = 0;
12991300
goto incompressible;
13001301
}

0 commit comments

Comments
 (0)