On Tue, Sep 02, 2025 at 08:54:14AM +0800, Alan Huang wrote: > On Sep 2, 2025, at 06:42, Kent Overstreet <[email protected]> wrote: > > > > On Sun, Aug 24, 2025 at 02:41:32AM +0800, Alan Huang wrote: > >> btree_node_read_error is duplicate of btree_node_read_err, which impacts > >> repair path if misused. > >> > >> Signed-off-by: Alan Huang <[email protected]> > >> --- > >> fs/bcachefs/btree_io.c | 2 +- > >> fs/bcachefs/errcode.h | 1 - > >> fs/bcachefs/sb-errors_format.h | 2 +- > >> 3 files changed, 2 insertions(+), 3 deletions(-) > > > > So the patch builds, but this still doesn't make sense, because > > > >> > >> diff --git a/fs/bcachefs/btree_io.c b/fs/bcachefs/btree_io.c > >> index 2e3dd9bacac5..3d594c4ae9d8 100644 > >> --- a/fs/bcachefs/btree_io.c > >> +++ b/fs/bcachefs/btree_io.c > >> @@ -1902,7 +1902,7 @@ static int __bch2_btree_root_read(struct btree_trans > >> *trans, enum btree_id id, > >> scoped_guard(mutex, &c->btree_cache.lock) > >> bch2_btree_node_hash_remove(&c->btree_cache, b); > >> > >> - ret = bch_err_throw(c, btree_node_read_error); > >> + ret = bch_err_throw(c, btree_node_read_err); > > > > this references an errcode.h error > > > >> goto err; > >> } > >> > >> diff --git a/fs/bcachefs/errcode.h b/fs/bcachefs/errcode.h > >> index adc1f9315eab..7106d72fca80 100644 > >> --- a/fs/bcachefs/errcode.h > >> +++ b/fs/bcachefs/errcode.h > >> @@ -295,7 +295,6 @@ > >> x(BCH_ERR_btree_node_read_err, btree_node_read_err_cached) \ > >> x(EIO, sb_not_downgraded) \ > >> x(EIO, btree_node_write_all_failed) \ > >> - x(EIO, btree_node_read_error) \ > > > > which you delete > > > >> x(EIO, btree_need_topology_repair) \ > >> x(EIO, bucket_ref_update) \ > >> x(EIO, trigger_alloc) \ > >> diff --git a/fs/bcachefs/sb-errors_format.h > >> b/fs/bcachefs/sb-errors_format.h > >> index aa0ea1ec9f10..483358588abc 100644 > >> --- a/fs/bcachefs/sb-errors_format.h > >> +++ b/fs/bcachefs/sb-errors_format.h > >> @@ -73,7 +73,7 @@ enum bch_fsck_flags { > >> x(btree_root_read_error, 59, FSCK_AUTOFIX) \ > >> x(btree_root_bad_min_key, 60, 0) \ > >> x(btree_root_bad_max_key, 61, 0) \ > >> - x(btree_node_read_error, 62, FSCK_AUTOFIX) \ > >> + x(btree_node_read_err, 62, FSCK_AUTOFIX) \ > > > > and rename the persistent error? > > The persistent error is never used, renaming it to the same as the error in > errcode.h makes sense.
We probably want to hook it up then...
