mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 03:10:30 -04:00
bcachefs: Fix faulty assertion
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
f698a95797
commit
41fcd62150
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user