diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-10-26 21:07:43 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:15 +0300 |
commit | f3b1e1937973624d3bc5f3ba0824e228ae256b88 (patch) | |
tree | efd88b6eca8e82505b2065d3af7b6365050bf7ff /fs | |
parent | 6b3d8b8992e59d3a145f67173a0d75fa25e6e750 (diff) | |
download | linux-f3b1e1937973624d3bc5f3ba0824e228ae256b88.tar.xz |
bcachefs: Improve error messages in trans_mark_reflink_p()
We should always print out the key we were marking.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/bcachefs/buckets.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 2982f71bcf2d..fc4d9d75794c 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -1716,6 +1716,7 @@ static int __bch2_trans_mark_reflink_p(struct btree_trans *trans, struct bkey_i *n; __le64 *refcount; int add = !(flags & BTREE_TRIGGER_OVERWRITE) ? 1 : -1; + char buf[200]; int ret; bch2_trans_iter_init(trans, &iter, BTREE_ID_reflink, POS(0, *idx), @@ -1735,17 +1736,19 @@ static int __bch2_trans_mark_reflink_p(struct btree_trans *trans, refcount = bkey_refcount(n); if (!refcount) { + bch2_bkey_val_to_text(&PBUF(buf), c, p.s_c); bch2_fs_inconsistent(c, - "%llu:%llu len %u points to nonexistent indirect extent %llu", - p.k->p.inode, p.k->p.offset, p.k->size, *idx); + "nonexistent indirect extent at %llu while marking\n %s", + *idx, buf); ret = -EIO; goto err; } if (!*refcount && (flags & BTREE_TRIGGER_OVERWRITE)) { + bch2_bkey_val_to_text(&PBUF(buf), c, p.s_c); bch2_fs_inconsistent(c, - "%llu:%llu len %u idx %llu indirect extent refcount underflow", - p.k->p.inode, p.k->p.offset, p.k->size, *idx); + "indirect extent refcount underflow at %llu while marking\n %s", + *idx, buf); ret = -EIO; goto err; } |