bcachefs: Improve fs_usage_apply_warn() message
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
@@ -1276,23 +1276,24 @@ void fs_usage_apply_warn(struct btree_trans *trans,
|
|||||||
struct btree_insert_entry *i;
|
struct btree_insert_entry *i;
|
||||||
struct printbuf buf = PRINTBUF;
|
struct printbuf buf = PRINTBUF;
|
||||||
|
|
||||||
bch_err(c, "disk usage increased %lli more than %u sectors reserved",
|
prt_printf(&buf,
|
||||||
should_not_have_added, disk_res_sectors);
|
bch2_fmt(c, "disk usage increased %lli more than %u sectors reserved)"),
|
||||||
|
should_not_have_added, disk_res_sectors);
|
||||||
|
|
||||||
trans_for_each_update(trans, i) {
|
trans_for_each_update(trans, i) {
|
||||||
struct bkey_s_c old = { &i->old_k, i->old_v };
|
struct bkey_s_c old = { &i->old_k, i->old_v };
|
||||||
|
|
||||||
pr_err("while inserting");
|
prt_str(&buf, "new ");
|
||||||
printbuf_reset(&buf);
|
|
||||||
bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(i->k));
|
bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(i->k));
|
||||||
pr_err(" %s", buf.buf);
|
prt_newline(&buf);
|
||||||
pr_err("overlapping with");
|
|
||||||
printbuf_reset(&buf);
|
prt_str(&buf, "old ");
|
||||||
bch2_bkey_val_to_text(&buf, c, old);
|
bch2_bkey_val_to_text(&buf, c, old);
|
||||||
pr_err(" %s", buf.buf);
|
prt_newline(&buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
__WARN();
|
__WARN();
|
||||||
|
bch2_print_string_as_lines(KERN_ERR, buf.buf);
|
||||||
printbuf_exit(&buf);
|
printbuf_exit(&buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user