btrfs-progs: check: document --force + --repair

The combination of --force and --repair was mistakenly documented as not
working on a mounted filesystem. Update help text, documentation and the
warning itself.

Issue: #503
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-04-20 03:03:22 +02:00
parent 1046beb7a4
commit cdb82bf762
2 changed files with 15 additions and 7 deletions

View File

@ -104,7 +104,7 @@ DANGEROUS OPTIONS
.. note::
There's a warning and 10 second delay when this option is run without
*--force* to give users a chance to think twice before running repair, the
warnings in documentation have shown to be insufficient
warnings in documentation have shown to be insufficient.
--init-csum-tree
create a new checksum tree and recalculate checksums in all files
@ -137,10 +137,15 @@ DANGEROUS OPTIONS
experimental.
--force
allow work on a mounted filesystem. Note that this should work fine on a
quiescent or read-only mounted filesystem but may crash if the device is
changed externally, e.g. by the kernel module. Repair without mount checks is
not supported right now.
allow work on a mounted filesystem and skip mount checks. Note that
this should work fine on a quiescent or read-only mounted filesystem
but may crash if the device is changed externally, e.g. by the kernel
module.
.. note::
It is possible to run with --repair but on a mounted filesystem
that will most likely lead to a corruption unless the filesystem
is in a quiescent state which may not be possible to guarantee.
This option also skips the delay and warning in the repair mode (see
*--repair*).

View File

@ -9959,7 +9959,10 @@ static const char * const cmd_check_usage[] = {
"Operation modes:",
OPTLINE("--readonly", "run in read-only mode (default)"),
OPTLINE("--repair", "try to repair the filesystem"),
OPTLINE("--force", "skip mount checks, repair is not possible"),
OPTLINE("--force", "skip mount checks, recommended only with --readonly; "
"WARNING: it is possible to run with --repair but on a mounted filesystem "
"that will most likely lead to a corruption unless the filesystem "
"is quiescent in a quiescent state which may not be possible to guarantee"),
OPTLINE("--mode <MODE>", "allows choice of memory/IO trade-offs where MODE is one of:"),
OPTLINE("", "original - read inodes and extents to memory (requires more memory, does less IO)"),
OPTLINE("", "lowmem - try to use less memory but read blocks again when needed (experimental)"),
@ -10147,7 +10150,7 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
printf("WARNING:\n\n");
printf("\tDo not use --repair unless you are advised to do so by a developer\n");
printf("\tor an experienced user, and then only after having accepted that no\n");
printf("\tfsck can successfully repair all types of filesystem corruption. Eg.\n");
printf("\tfsck can successfully repair all types of filesystem corruption. E.g.\n");
printf("\tsome software or hardware bugs can fatally damage a volume.\n");
printf("\tThe operation will start in %d seconds.\n", delay);
printf("\tUse Ctrl-C to stop it.\n");