/swap.img w/fallocate has holes
Bug #1781781 reported by
Ebbex
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Unassigned | ||
curtin |
Confirmed
|
Medium
|
Unassigned |
Bug Description
The /swap.img file on an XFS root filesystem is not being used. The dmesg says it "has holes".
From the swapon manpage;
The swap file implementation in the kernel expects to be able to write to the file directly, without the assistance of the filesystem. This is a problem on preallocated files (e.g. fallocate(1)) on filesystems like XFS or ext4, and on copy-on-write filesystems like btrfs.
It is recommended to use dd(1) and /dev/zero to avoid holes on XFS and ext4.
I've tracked down this commit which seems to be a step in the right direction;
https:/
Related branches
~adobrawy/cloud-init:swap-linux
Rejected
for merging
into
cloud-init:master
- Chad Smith: Needs Information
-
Diff: 27 lines (+10/-3)1 file modifiedcloudinit/config/cc_mounts.py (+10/-3)
To post a comment you must log in.
So I've checked it out, and ext4 seems to work fine with fallocate. It could perhaps be considered a filesystem-bug as it seems that some xfs-developers are aware of the issue; https:/ /www.spinics. net/lists/ linux-mm/ msg147100. html But it would be beneficial to have a work-around until that gets sorted.