From 39470a52b5f650ffd47db003001d179231d5b9da Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 30 Jul 2024 17:31:30 +0200 Subject: [PATCH] btrfs-progs: docs: clarify swapfile an multi-device filesystem 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 --- Documentation/ch-swapfile.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/ch-swapfile.rst b/Documentation/ch-swapfile.rst index 7717d680..2c20104b 100644 --- a/Documentation/ch-swapfile.rst +++ b/Documentation/ch-swapfile.rst @@ -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: