Skip to content

Commit 492e24d

Browse files
author
Kent Overstreet
committed
bcachefs: Make sure we print error that causes fsck to bail out
Signed-off-by: Kent Overstreet <[email protected]>
1 parent 658c82f commit 492e24d

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

fs/bcachefs/error.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,16 +393,22 @@ int __bch2_fsck_err(struct bch_fs *c,
393393
!(flags & FSCK_CAN_IGNORE)))
394394
ret = -BCH_ERR_fsck_errors_not_fixed;
395395

396+
bool exiting =
397+
test_bit(BCH_FS_fsck_running, &c->flags) &&
398+
(ret != -BCH_ERR_fsck_fix &&
399+
ret != -BCH_ERR_fsck_ignore);
400+
401+
if (exiting)
402+
print = true;
403+
396404
if (print) {
397405
if (bch2_fs_stdio_redirect(c))
398406
bch2_print(c, "%s\n", out->buf);
399407
else
400408
bch2_print_string_as_lines(KERN_ERR, out->buf);
401409
}
402410

403-
if (test_bit(BCH_FS_fsck_running, &c->flags) &&
404-
(ret != -BCH_ERR_fsck_fix &&
405-
ret != -BCH_ERR_fsck_ignore))
411+
if (exiting)
406412
bch_err(c, "Unable to continue, halting");
407413
else if (suppressing)
408414
bch_err(c, "Ratelimiting new instances of previous error");

0 commit comments

Comments
 (0)