Re: mkswap

Alistair Riddell (alistair@watsons.edin.sch.uk)
Fri, 20 Feb 1998 00:12:31 +0000 (GMT)


Surely this could be fixed by calling sync() at an appropriate point in
mkswap.

On Fri, 20 Feb 1998, Matti Aarnio wrote:

> > I just noticed that I can do
> > mkswap foo; swapon foo
> > which fails, ("Unable to find swap-space signature"), while
> > mkswap foo; sync; swapon foo
> > succeeds. In other words (2.0.33): the swapon system call
> > does not look at the cache for the file foo.
> > This is a kernel bug (but there are more aliasing problems
> > somewhat like this, like between /dev/hda and /dev/hda1).
>
> The fix is ok, but diagnostics of it being a "bug" in
> the kernel is somewhat inappropriate. Lets call it
> "feature"; file-io uses buffer-cache, while swapping
> does direct uncached io from disk to the memory pages.
>
> The problem is actually about aliasing of uncached, and
> cached io. How to solve it, is another issue.

--
Alistair Riddell - BOFH
IT Support Department, George Watson's College, Edinburgh
Tel: +44 131 447 7931 Ext 176       Fax: +44 131 452 8594

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu