diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-05-29 02:26:04 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:03 -0400 |
commit | 4c4a8f20d1767b2ed927d25ccc363de72d48d28f (patch) | |
tree | 0aee62ce78392edb21e1870bbcaedaf0c9573cf2 /fs | |
parent | 5718fda0b5ef777ef56edbe53ef6a830b845c0fa (diff) |
bcachefs: Fix error handling in promote path
The promote path had a BUG_ON() for unknown error type, which we're now
seeing: change it to a WARN_ON() - because we're curious what this is -
and otherwise handle it in the normal error path.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/io.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c index 0f8d52912c2d..199a8348355a 100644 --- a/fs/bcachefs/io.c +++ b/fs/bcachefs/io.c @@ -2057,14 +2057,16 @@ static struct promote_op *__promote_alloc(struct btree_trans *trans, .write_flags = BCH_WRITE_ALLOC_NOWAIT|BCH_WRITE_CACHED, }, btree_id, k); - if (ret == -BCH_ERR_nocow_lock_blocked) { + if (ret) { + WARN_ONCE(ret != -BCH_ERR_nocow_lock_blocked, + "%s: saw unknown error %s\n", __func__, bch2_err_str(ret)); + ret = rhashtable_remove_fast(&c->promote_table, &op->hash, bch_promote_params); BUG_ON(ret); goto err; } - BUG_ON(ret); op->write.op.end_io = promote_done; return op; |