Skip to content

Commit

Permalink
btrfs-progs: docs: clarify swapfile an multi-device filesystem
Browse files Browse the repository at this point in the history
It is possible to create swapfile on a multi-device filesystem but it's
not reliable. The check that verifies that in kernel:

10698                 } else if (device != map->stripes[0].dev) {
10699                         btrfs_warn(fs_info, "swapfile must be on one device");
10700                         ret = -EINVAL;
10701                         goto out;
10702                 }

This does not count devices but rather the actual placement of the
swapfile extents, so multi-device filesystem with single profile can
create it as long as there's enough space and the allocator decides to
place it properly.

[ci skip]

Pull-request: #839
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Jul 30, 2024
1 parent 704437e commit 39470a5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Documentation/ch-swapfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ The limitations come namely from the COW-based design and mapping layer of
blocks that allows the advanced features like relocation and multi-device
filesystems. However, the swap subsystem expects simpler mapping and no
background changes of the file block location once they've been assigned to
swap.
swap. The constraints mentioned above (single device and single profile) are
related to the swapfile itself, i.e. the extents and their placement. It is
possible to create swapfile on multi-device filesystem as long as the extents
are on one device but this cannot be affected by user and depends on free space
fragmentation and available unused space for new chunks.

With active swapfiles, the following whole-filesystem operations will skip
swapfile extents or may fail:
Expand Down

0 comments on commit 39470a5

Please sign in to comment.