I bet you don't use swap files! If so, then please explain what is wrong.
Try this yourself:
dd if=/dev/zero of=swap bs=1024 count=1028
mkswap swap
free ; swapon -v swap
free ; swapoff -a ; free
You'll then see what I mean - the swap file stays active.
An strace of "swapoff -a" shows that it is the problem, as it
only affects swap partitions and not swap files. IMHO, it should
affect swap files too - this may require a /proc entry listing
all swap sources and their types (so that a "new" swapoff could
read it, and turn off all swap sources. Or, the kernel system call
(I assume there already is one) could be expanded to handle this
special case (turning off all swap files).
-- Andrew E. Mileski mailto:aem@ott.hookup.net Linux Plug-and-Play Kernel Project http://www.redhat.com/linux-info/pnp/ XFree86 Matrox Team http://www.bf.rmit.edu.au/~ajv/xf86-matrox.html