diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-01-25 16:07:52 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:49 +0200 |
commit | ad5d3d820a97500d8af0d5f337f8f523c6099ac6 (patch) | |
tree | 5c22e043a0020c1b8b688d7f1126ff81e08b80b6 /fs/bcachefs/buckets.c | |
parent | bcachefs: debug: Fix some locking bugs (diff) | |
download | linux-ad5d3d820a97500d8af0d5f337f8f523c6099ac6.tar.xz linux-ad5d3d820a97500d8af0d5f337f8f523c6099ac6.zip |
bcachefs: Kill fs_usage_apply_warn()
We now have bch2_trans_inconsistent() which generically does the same
thing - dumps pending btree transaction updates.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to '')
-rw-r--r-- | fs/bcachefs/buckets.c | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 137a9aef6987..4fd396cb1dad 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -1268,36 +1268,6 @@ int bch2_mark_reflink_p(struct btree_trans *trans, return ret; } -static noinline __cold -void fs_usage_apply_warn(struct btree_trans *trans, - unsigned disk_res_sectors, - s64 should_not_have_added) -{ - struct bch_fs *c = trans->c; - struct btree_insert_entry *i; - struct printbuf buf = PRINTBUF; - - prt_printf(&buf, - 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) { - struct bkey_s_c old = { &i->old_k, i->old_v }; - - prt_str(&buf, "new "); - bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(i->k)); - prt_newline(&buf); - - prt_str(&buf, "old "); - bch2_bkey_val_to_text(&buf, c, old); - prt_newline(&buf); - } - - __WARN(); - bch2_print_string_as_lines(KERN_ERR, buf.buf); - printbuf_exit(&buf); -} - int bch2_trans_fs_usage_apply(struct btree_trans *trans, struct replicas_delta_list *deltas) { @@ -1362,7 +1332,9 @@ int bch2_trans_fs_usage_apply(struct btree_trans *trans, percpu_up_read(&c->mark_lock); if (unlikely(warn) && !xchg(&warned_disk_usage, 1)) - fs_usage_apply_warn(trans, disk_res_sectors, should_not_have_added); + bch2_trans_inconsistent(trans, + "disk usage increased %lli more than %u sectors reserved)", + should_not_have_added, disk_res_sectors); return 0; need_mark: /* revert changes: */ |