diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-04-25 14:32:39 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:00 -0400 |
commit | c8d5b71411473187db4fbc6ca419496b716778b8 (patch) | |
tree | 2ceabbcf47bdb5a1bafe00dc0d97839e86707c78 /fs/bcachefs/error.c | |
parent | 1af5227c1d6b3513106f82808fe163bf0bd70df8 (diff) | |
download | linux-c8d5b71411473187db4fbc6ca419496b716778b8.tar.gz linux-c8d5b71411473187db4fbc6ca419496b716778b8.tar.bz2 linux-c8d5b71411473187db4fbc6ca419496b716778b8.zip |
bcachefs: Make sure hash info gets initialized in fsck
We had some bugs with setting/using first_this_inode in the inode
walker in the dirents/xattr code.
This patch changes to not clear first_this_inode until after
initializing the new hash info.
Also, we fix an error message to not print on transaction restart, and
add a comment to related fsck error code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/error.c')
-rw-r--r-- | fs/bcachefs/error.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/error.c b/fs/bcachefs/error.c index aa640284ed19..545c55dabc27 100644 --- a/fs/bcachefs/error.c +++ b/fs/bcachefs/error.c @@ -158,6 +158,11 @@ int bch2_fsck_err(struct bch_fs *c, unsigned flags, const char *fmt, ...) mutex_lock(&c->fsck_error_lock); s = fsck_err_get(c, fmt); if (s) { + /* + * We may be called multiple times for the same error on + * transaction restart - this memoizes instead of asking the user + * multiple times for the same error: + */ if (s->last_msg && !strcmp(buf.buf, s->last_msg)) { ret = s->ret; mutex_unlock(&c->fsck_error_lock); |