Tookmund / Swapspace

A fork of Jeroen T. Vermeulen's excellent dynamic swap space manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automate `--zero`?

jtv opened this issue · comments

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.)

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

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.