diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-28 21:34:14 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-03-31 20:36:12 -0400 |
commit | 13c1e583f9179ad7953dc71ebb2f12e613b9d052 (patch) | |
tree | a76d2d7df5caac4cbb063c02b66084e6a44f0044 /fs/bcachefs/opts.h | |
parent | 060ff30a8596b649a80c19935758000dde7855fe (diff) | |
download | linux-stable-13c1e583f9179ad7953dc71ebb2f12e613b9d052.tar.gz linux-stable-13c1e583f9179ad7953dc71ebb2f12e613b9d052.tar.bz2 linux-stable-13c1e583f9179ad7953dc71ebb2f12e613b9d052.zip |
bcachefs: Improve -o norecovery; opts.recovery_pass_limit
This adds opts.recovery_pass_limit, and redoes -o norecovery to make use
of it; this fixes some issues with -o norecovery so it can be safely
used for data recovery.
Norecovery means "don't do journal replay"; it's an important data
recovery tool when we're getting stuck in journal replay.
When using it this way we need to make sure we don't free journal keys
after startup, so we continue to overlay them: thus it needs to imply
retain_recovery_info, as well as nochanges.
recovery_pass_limit is an explicit option for telling recovery to exit
after a specific recovery pass; this is a much cleaner way of
implementing -o norecovery, as well as being a useful debug feature in
its own right.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/opts.h')
-rw-r--r-- | fs/bcachefs/opts.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h index 136083c11f3a..084247c13bd8 100644 --- a/fs/bcachefs/opts.h +++ b/fs/bcachefs/opts.h @@ -362,7 +362,12 @@ enum fsck_err_opts { OPT_FS|OPT_MOUNT, \ OPT_BOOL(), \ BCH2_NO_SB_OPT, false, \ - NULL, "Don't replay the journal") \ + NULL, "Exit recovery immediately prior to journal replay")\ + x(recovery_pass_last, u8, \ + OPT_FS|OPT_MOUNT, \ + OPT_STR_NOLIMIT(bch2_recovery_passes), \ + BCH2_NO_SB_OPT, 0, \ + NULL, "Exit recovery after specified pass") \ x(keep_journal, u8, \ 0, \ OPT_BOOL(), \ |