diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-08-21 23:52:10 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:25 -0400 |
commit | 41fcd6215093b0c40fb4072e04a2b34f09eb4235 (patch) | |
tree | 4f39559d27bf40b5f308d778c5f706c2fa057474 | |
parent | f698a957979bfff266a65a2080a224cca7ccc962 (diff) |
bcachefs: Fix faulty assertion
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/buckets.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 3d243f2d1095..78d43830d0a7 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -1483,8 +1483,6 @@ static int bch2_trans_mark_stripe_ptr(struct btree_trans *trans, s64 parity_sectors; int ret = 0; - BUG_ON(!sectors); - ret = trans_get_key(trans, BTREE_ID_EC, POS(0, p.idx), &iter, &k); if (ret) return ret; @@ -1549,6 +1547,12 @@ static int bch2_trans_mark_extent(struct btree_trans *trans, ? sectors : ptr_disk_sectors_delta(p, offset, sectors, flags); + /* + * can happen due to rounding with compressed extents: + */ + if (!disk_sectors) + continue; + ret = bch2_trans_mark_pointer(trans, p, disk_sectors, data_type); if (ret < 0) |