summaryrefslogtreecommitdiffstats
path: root/mount/swapon.8
diff options
context:
space:
mode:
authorJeff Mahoney2010-07-07 10:01:17 +0200
committerKarel Zak2010-07-07 10:02:05 +0200
commit26907ffae0895b11991d2039b634557404e8130d (patch)
tree8db936d98a884c443e5343e3643fe78ac349baea /mount/swapon.8
parentcfdisk: search for ncursesw/ncurses.h (diff)
downloadkernel-qcow2-util-linux-26907ffae0895b11991d2039b634557404e8130d.tar.gz
kernel-qcow2-util-linux-26907ffae0895b11991d2039b634557404e8130d.tar.xz
kernel-qcow2-util-linux-26907ffae0895b11991d2039b634557404e8130d.zip
swapon: Document btrfs limitation with swapfiles
Btrfs, as of 2.6.35, is unable to allow swapfiles to be used on its filesystems. This is due to the swapfile implementation wanting to build an extent map of each block in the file and expecting it to be static for the life of the swapfile. Btrfs can't guarantee this and refuses to return the mapping. The swapfile implementation just makes a comment about there being holes in the file - but that's how btrfs denies the mapping. This patch adds a section to the swapon manpage to document it. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/swapon.8')
-rw-r--r--mount/swapon.812
1 files changed, 12 insertions, 0 deletions
diff --git a/mount/swapon.8 b/mount/swapon.8
index 25fc5e81d..a3ebc97cd 100644
--- a/mount/swapon.8
+++ b/mount/swapon.8
@@ -167,6 +167,18 @@ automatically detects and rewrites swap space signature with old software
suspend data (e.g S1SUSPEND, S2SUSPEND, ...). The problem is that if we don't
do it, then we get data corruption the next time an attempt at unsuspending is
made.
+.PP
+.B swapon
+may not work correctly when using a swap file with some versions of btrfs.
+This is due to the swap file implementation in the kernel expecting to be able
+to write to the file directly, without the assistance of the file system.
+Since btrfs is a copy-on-write file system, the file location may not be
+static and corruption can result. Btrfs actively disallows the use of files
+on its file systems by refusing to map the file. This can be seen in the system
+log as "swapon: swapfile has holes." One possible workaround is to map the
+file to a loopback device. This will allow the file system to determine the
+mapping properly but may come with a performance impact.
+
.SH SEE ALSO
.BR swapon (2),
.BR swapoff (2),