Skip to content

Commit e607334

Browse files
committed
btrfs-progs: docs: improve space cache documentation
- "Wipe" in storage terms is often understood as some kind of secure deletion. Use "remove" instead in order to indicate that the space cache is fully removed (and not just cleared and then e.g. automatically rebuild). - The --clear-space-cache option for btrfs check actually clears the whole space cache, just as documented. Thus move any documentation about the clear_cache mount option not doing so for v1 to that. Instead, refer to the mount option. - Also note that when clear_cache is used with v1, the free space cache for block groups that are modified gets always cleared, but rebuilt only if nospace_cache is not used. Signed-off-by: Christoph Anton Mitterer <[email protected]>
1 parent 660d10d commit e607334

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

Documentation/btrfs-check.rst

+2-10
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,9 @@ SAFE OR ADVISORY OPTIONS
7979
superblock is damaged.
8080

8181
--clear-space-cache v1|v2
82-
completely wipe all free space cache of given type
82+
completely remove the free space cache of the given version
8383

84-
For free space cache *v1*, the *clear_cache* kernel mount option only rebuilds
85-
the free space cache for block groups that are modified while the filesystem is
86-
mounted with that option. Thus, using this option with *v1* makes it possible
87-
to actually clear the entire free space cache.
88-
89-
For free space cache *v2*, the *clear_cache* kernel mount option destroys
90-
the entire free space cache. This option, with *v2* provides an alternative
91-
method of clearing the free space cache that doesn't require mounting the
92-
filesystem.
84+
See also the *clear_cache* mount option.
9385

9486
--clear-ino-cache
9587
remove leftover items pertaining to the deprecated inode map feature

Documentation/ch-mount-options.rst

+15-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,19 @@ check_int, check_int_data, check_int_print_mask=<value>
8686
for more information.
8787

8888
clear_cache
89-
Force clearing and rebuilding of the disk space cache if something
90-
has gone wrong. See also: *space_cache*.
89+
Force clearing and rebuilding of the free space cache if something
90+
has gone wrong.
91+
92+
For free space cache *v1*, this only clears (and, unless *nospace_cache* is
93+
used, rebuilds) the free space cache for block groups that are modified while
94+
the filesystem is mounted with that option. To actually clear an entire free
95+
space cache *v1*, see ``btrfs check --clear-space-cache v1``.
96+
97+
For free space cache *v2*, this clears the entire free space cache.
98+
To do so without requiring to mounting the filesystem, see
99+
``btrfs check --clear-space-cache v2``.
100+
101+
See also: *space_cache*.
91102

92103
commit=<seconds>
93104
(since: 3.12, default: 30)
@@ -348,7 +359,8 @@ space_cache, space_cache=<version>, nospace_cache
348359
implementation, which adds a new b-tree called the free space tree, addresses
349360
this issue. Once enabled, the *v2* space cache will always be used and cannot
350361
be disabled unless it is cleared. Use *clear_cache,space_cache=v1* or
351-
*clear_cache,nospace_cache* to do so. If *v2* is enabled, kernels without *v2*
362+
*clear_cache,nospace_cache* to do so. If *v2* is enabled, and *v1* space
363+
cache will be cleared (at the first mount) and kernels without *v2*
352364
support will only be able to mount the filesystem in read-only mode.
353365

354366
The :doc:`btrfs-check(8)<btrfs-check>` and `:doc:`mkfs.btrfs(8)<mkfs.btrfs>` commands have full *v2* free space

0 commit comments

Comments
 (0)