btrfs-progs: docs: update the man page for btrfs check lowmem mode

Lowmem mode has improved quite a lot since its introduction, for
read-only check it's definitely fine.

For repair mode, both lowmem and original mode are considered dangerous
especially for complex corruptions with unknown cause.

For now lowmem mode is only bad at fixing fundamentally corrupted cases,
like bad shift offsets or transid, which in real world it's not an easy
repair for the original mode either.

This patch would move the --mode option out of the dangerous section and
update the notes for the lowmem mode on its limitation.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2023-12-04 13:18:06 +10:30 committed by David Sterba
parent 5c91264d2d
commit 171dd56995
2 changed files with 15 additions and 25 deletions

View File

@ -57,6 +57,20 @@ SAFE OR ADVISORY OPTIONS
-E|--subvol-extents <subvolid>
show extent state for the given subvolume
--mode <MODE>
select mode of operation regarding memory and IO
The *MODE* can be one of:
original
The metadata are read into memory and verified, thus the requirements are high
on large filesystems and can even lead to out-of-memory conditions. The
possible workaround is to export the block device over network to a machine
with enough memory.
lowmem
This mode is supposed to address the high memory consumption at the cost of
increased IO when it needs to re-read blocks. This may increase run time.
-p|--progress
indicate progress at various checking phases
@ -117,24 +131,6 @@ DANGEROUS OPTIONS
.. warning::
Do not use unless you know what you're doing.
--mode <MODE>
select mode of operation regarding memory and IO
The *MODE* can be one of:
original
The metadata are read into memory and verified, thus the requirements are high
on large filesystems and can even lead to out-of-memory conditions. The
possible workaround is to export the block device over network to a machine
with enough memory.
lowmem
This mode is supposed to address the high memory consumption at the cost of
increased IO when it needs to re-read blocks. This may increase run time.
.. note::
*lowmem* mode does not work with *--repair* yet, and is still considered
experimental.
.. _man-check-option-force:
--force

View File

@ -9960,7 +9960,7 @@ static const char * const cmd_check_usage[] = {
"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)"),
OPTLINE("", "lowmem - try to use less memory but read blocks again when needed"),
"",
"Repair options:",
OPTLINE("--init-csum-tree", "create a new CRC tree"),
@ -10159,12 +10159,6 @@ static int cmd_check(const struct cmd_struct *cmd, int argc, char **argv)
printf("\nStarting repair.\n");
}
/*
* experimental and dangerous
*/
if (opt_check_repair && check_mode == CHECK_MODE_LOWMEM)
warning("low-memory mode repair support is only partial");
printf("Opening filesystem to check...\n");
cache_tree_init(&root_cache);