Skip to content

Commit 321b2f6

Browse files
calestyokdave
authored andcommitted
btrfs-progs: docs: swapfile clarifications
Clarify active vs. inactive swapfile regarding snapshotting and further minor improvements. Issue: #608 Pull-request: #618 Signed-off-by: Christoph Anton Mitterer <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 93d51b2 commit 321b2f6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Documentation/ch-swapfile.rst

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
A swapfile is file-backed memory that the system uses to temporarily offload
2-
the RAM. It is supported since kernel 5.0. Use ``swapon(8)`` to activate it as
3-
a swap area, until then it's just a normal file (with NODATACOW set), for which
4-
the special restrictions for active swapfile areas don't apply.
1+
A swapfile, when active, is a file-backed swap area. It is supported since kernel 5.0.
2+
Use ``swapon(8)`` to activate it, until then (respectively again after deactivating it
3+
with ``swapoff(8)``) it's just a normal file (with NODATACOW set), for which the special
4+
restrictions for active swapfiles don't apply.
55

66
There are some limitations of the implementation in BTRFS and Linux swap
77
subsystem:
88

99
* filesystem - must be only single device
1010
* filesystem - must have only *single* data profile
11-
* swapfile - the containing subvolume cannot be snapshotted if there's an active swapfile
12-
* swapfile - the file must be preallocated (i.e. no holes)
13-
* swapfile - the file must be NODATACOW (i.e. also NODATASUM, no compression)
11+
* subvolume - cannot be snapshotted if it contains any active swapfiles
12+
* swapfile - must be preallocated (i.e. no holes)
13+
* swapfile - must be NODATACOW (i.e. also NODATASUM, no compression)
1414

1515
The limitations come namely from the COW-based design and mapping layer of
1616
blocks that allows the advanced features like relocation and multi-device
@@ -21,13 +21,13 @@ swap.
2121
With active swapfiles, the following whole-filesystem operations will skip
2222
swapfile extents or may fail:
2323

24-
* balance - block groups with an active swapfile extents are skipped and
24+
* balance - block groups with extents of any active swapfiles are skipped and
2525
reported, the rest will be processed normally
2626
* resize grow - unaffected
27-
* resize shrink - works as long as the extents of an active swapfile are
27+
* resize shrink - works as long as the extents of any active swapfiles are
2828
outside of the shrunk range
29-
* device add - a new device does not interfere with existing active swapfile
30-
and this operation will work, though no new swapfile can be activated
29+
* device add - if the new devices do not interfere with any already active swapfiles
30+
this operation will work, though no new swapfile can be activated
3131
afterwards
3232
* device delete - if the device has been added as above, it can be also deleted
3333
* device replace - ditto

0 commit comments

Comments
 (0)