summaryrefslogtreecommitdiff
path: root/fs/bcachefs/data_update.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-11-27 00:29:52 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2024-12-21 01:36:20 -0500
commita6f4794fcd8627638153614193b3b81f37a28175 (patch)
treefb19b5fb478768f51d88fd86b7fcd0c9f8ad7bbc /fs/bcachefs/data_update.c
parentc7e78f7b01786d0d06bde8548e88822ff57c4b4f (diff)
downloadlinux-next-a6f4794fcd8627638153614193b3b81f37a28175.tar.gz
linux-next-a6f4794fcd8627638153614193b3b81f37a28175.zip
bcachefs: struct bkey_validate_context
Add a new parameter to bkey validate functions, and use it to improve invalid bkey error messages: we can now print the btree and depth it came from, or if it came from the journal, or is a btree root. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r--fs/bcachefs/data_update.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c
index e4af2ccdf4c8..31b2aeb0c6e6 100644
--- a/fs/bcachefs/data_update.c
+++ b/fs/bcachefs/data_update.c
@@ -318,8 +318,11 @@ restart_drop_extra_replicas:
* it's been hard to reproduce, so this should give us some more
* information when it does occur:
*/
- int invalid = bch2_bkey_validate(c, bkey_i_to_s_c(insert), __btree_node_type(0, m->btree_id),
- BCH_VALIDATE_commit);
+ int invalid = bch2_bkey_validate(c, bkey_i_to_s_c(insert),
+ (struct bkey_validate_context) {
+ .btree = m->btree_id,
+ .flags = BCH_VALIDATE_commit,
+ });
if (invalid) {
struct printbuf buf = PRINTBUF;