Tookmund / Swapspace

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

Automate `--zero`? #23

Closed jtv closed 4 years ago

jtv commented 4 years ago

Just a thought... The --zero option exists because a time-saving step in creating swap files is not permitted on some filesystems.

Assuming that the error in that case comes without much overhead, perhaps this doesn't really need to be configured? It might be equally valid to just try the fast way, and if it fails, fall back to the safe way.

(If there's a reasonable time overhead, it might even make sense to cache the outcome. You'd have an automatic --zero without needing manual configuration.)

Tookmund commented 4 years ago

That's a really good idea! I'll have to look into how this fails on various filesystems.

Tookmund commented 4 years ago

Interestingly, after looking back at the original issue (#10), I did some testing and was unable to reproduce this on XFS, but was able to easily replicate it on F2FS. I guess XFS has been updated in the time since the issue was filed.