Skip to content

Commit 405f4c7

Browse files
calestyokdave
authored andcommitted
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. Pull-request: #571 Signed-off-by: Christoph Anton Mitterer <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 321b2f6 commit 405f4c7

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
@@ -89,8 +89,19 @@ check_int, check_int_data, check_int_print_mask=<value>
8989
for more information.
9090

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

95106
commit=<seconds>
96107
(since: 3.12, default: 30)
@@ -352,7 +363,8 @@ space_cache, space_cache=<version>, nospace_cache
352363
implementation, which adds a new b-tree called the free space tree, addresses
353364
this issue. Once enabled, the *v2* space cache will always be used and cannot
354365
be disabled unless it is cleared. Use *clear_cache,space_cache=v1* or
355-
*clear_cache,nospace_cache* to do so. If *v2* is enabled, kernels without *v2*
366+
*clear_cache,nospace_cache* to do so. If *v2* is enabled, and *v1* space
367+
cache will be cleared (at the first mount) and kernels without *v2*
356368
support will only be able to mount the filesystem in read-only mode.
357369
On an unmounted filesystem the caches (both versions) can be cleared by
358370
"btrfs check --clear-space-cache".

0 commit comments

Comments
 (0)