mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 21:09:25 -04:00
bcachefs: Fix bch2_extent_can_insert() call
It was being skipped when hole punching, leading to problems when splitting compressed extents. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
committed by
Kent Overstreet
parent
2e8f9d23cb
commit
bbfcb4519d
@@ -806,13 +806,13 @@ static int extent_update_to_keys(struct btree_trans *trans,
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (bkey_deleted(&n.k->k))
|
||||
return 0;
|
||||
|
||||
ret = bch2_extent_can_insert(trans, n.iter, n.k);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (bkey_deleted(&n.k->k))
|
||||
return 0;
|
||||
|
||||
n.iter = bch2_trans_get_iter(trans, n.iter->btree_id, n.k->k.p,
|
||||
BTREE_ITER_INTENT|
|
||||
BTREE_ITER_NOT_EXTENTS);
|
||||
|
||||
@@ -1270,14 +1270,15 @@ int bch2_mark_update(struct btree_trans *trans,
|
||||
|
||||
static noinline __cold
|
||||
void fs_usage_apply_warn(struct btree_trans *trans,
|
||||
unsigned disk_res_sectors)
|
||||
unsigned disk_res_sectors,
|
||||
s64 should_not_have_added)
|
||||
{
|
||||
struct bch_fs *c = trans->c;
|
||||
struct btree_insert_entry *i;
|
||||
char buf[200];
|
||||
|
||||
bch_err(c, "disk usage increased more than %u sectors reserved",
|
||||
disk_res_sectors);
|
||||
bch_err(c, "disk usage increased %lli more than %u sectors reserved",
|
||||
should_not_have_added, disk_res_sectors);
|
||||
|
||||
trans_for_each_update(trans, i) {
|
||||
pr_err("while inserting");
|
||||
@@ -1309,6 +1310,7 @@ void fs_usage_apply_warn(struct btree_trans *trans,
|
||||
}
|
||||
}
|
||||
}
|
||||
__WARN();
|
||||
}
|
||||
|
||||
void bch2_trans_fs_usage_apply(struct btree_trans *trans,
|
||||
@@ -1367,7 +1369,7 @@ void bch2_trans_fs_usage_apply(struct btree_trans *trans,
|
||||
preempt_enable();
|
||||
|
||||
if (unlikely(warn) && !xchg(&warned_disk_usage, 1))
|
||||
fs_usage_apply_warn(trans, disk_res_sectors);
|
||||
fs_usage_apply_warn(trans, disk_res_sectors, should_not_have_added);
|
||||
}
|
||||
|
||||
/* trans_mark: */
|
||||
|
||||
Reference in New Issue
Block a user