Hi!

> > > I think we can do one more thing.  Namely, if the header is not 
> > > continuous,
> > > the kernel will leave the first continuous PAGE_SIZE "block" of the swap 
> > > file
> > > untouched.  So, why don't we copy the swap signature into that "block",
> > > to the place in which it would be if the the header was there, and return
> > > its offset as the offset of the header?  Then, swsusp and s2disk should 
> > > work
> > > normally as well as the swap.
> > > 
> > > I don't think the program should do this automatically, but there may be a
> > > flag allowing the user to modify a swap file with non-continuous header so
> > > that it can be used for suspending.
> > 
> > I'm pretty sure we do not want *that* hack.
> > 
> > ...don't we check header at offset ~4090, while writing some data to
> > offset 0? If the file is not contiguous, this will kill data, no?
> 
> Files may be non-continuous, but the swap-handling code finds continuous
> PAGE_SIZE-sized blocks in them and maps these blocks using extents.  The first
> PAGE_SIZE continuous block of a swap files is _never_ used for saving
> any swap data, because it _may_ contain the swap header, but it _won't_
> contain it if the header is not continuous (in such a case it may contain some
> part of the header, though).
> 
> Now if the swap header is not continuous (which _is_ possible, as the Luca's
> example clearly shows), swsusp (and s2disk) won't be able to use that file
> for suspending, because the swap signature is not where they expect it to be
> (they expect the signature to be at the offset 4090 of the first _continuous_
> PAGE_SIZE.block of the swap file).  However, in that case there are no swap
> data at the offset 4090 of the first continuous PAGE_SIZE.block of the swap
> file (this block is never used for saving data), so we can _safely_ copy the
> swap signature into this place.
...
> Still, I'm not going to argue for using this hack, although I'm pretty sure
> it would be 100% safe.

Aha, okay, we could probably do what you describe, but it is complex,
and noone uses 1K file systems any more, so it would not get much
testing. I'd prefer not to have untested complexity.
                                                                        Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to