bcachefs: Don't error out of recovery process on journal read error
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 6 Jan 2021 23:49:35 +0000 (18:49 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:50 +0000 (17:08 -0400)
We don't want to fail the recovery/mount because of a single error
reading from the journal - the relevant journal entry may still be found
on other devices, and missing or no journal entries found is already
handled later in the recovery process.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal_io.c

index cba420565248ac4f200ce20401b2571b51b3a01b..ef4d48081975d4717d74460e23a917f3aca54533 100644 (file)
@@ -576,8 +576,15 @@ reread:
                        if (bch2_dev_io_err_on(ret, ca,
                                               "journal read error: sector %llu",
                                               offset) ||
-                           bch2_meta_read_fault("journal"))
-                               return -EIO;
+                           bch2_meta_read_fault("journal")) {
+                               /*
+                                * We don't error out of the recovery process
+                                * here, since the relevant journal entry may be
+                                * found on a different device, and missing or
+                                * no journal entries will be handled later
+                                */
+                               return 0;
+                       }
 
                        j = buf->data;
                }