Tookmund / Swapspace

A fork of Jeroen T. Vermeulen's excellent dynamic swap space manager
GNU General Public License v2.0
128 stars 12 forks source link

`fallocate` doesn't work on F2FS or XFS #10

Closed riaqn closed 6 years ago

riaqn commented 7 years ago

On XFS or F2FS fallocate creates illegal swapfile, swapon such file returns invalid arguments.

The correct method is to fill the file with zero, which is slow but works.

Tookmund commented 6 years ago

swapspace does have this method as a fallback when posix_fallocate is unavailable. As of d329058 , you can use the --enable-no-posix-fallocate when compiling to force fallback on the previous "fill file with zeros" method