On Thursday, 9 November 2006 00:32, Luca Tettamanti wrote: > On 11/8/06, Rafael J. Wysocki <[EMAIL PROTECTED]> wrote: > > Hi, > > > > On Wednesday, 8 November 2006 18:58, Luca wrote: > > > I've been working on a small program to find the first valid block of a > > > swapfile. If I understand it correctly we need the first contiguos cluster > > > of blocks (not counting the header) which is at least PAGE_SIZE big and > > > the starting block must be page aligned. > > > The block number must then be converted in an offset from the start of > > > the device and the number must be expressed in multiple of PAGE_SIZE. > > > > > > This is what I've come up with ;) > > > > It doesn't look bad, but you shouldn't skip the header, actually. The > > header > > is what we need. ;-) > > Oh, right.. you print the offset of page_no == 0. Hum, I think I don't > understand the layout of a swapfile then; reading swapfile.c I see > that even the header should be a PAGE_SIZE continuous block, but I > have test cases where the header is not contiguous on disk (ext2, > 1024b per block, with artificial fragmentation) - which is why I > thought that first-page-after-header was needed.
Ouch, that's bad. The swsusp (and ours) swap-writing code will corrupt the filesystem in such a case, because it assumes the header to be continuous. I think we have to understand your test cases at this point. Can you please post some numbers? Rafael -- You never change things by fighting the existing reality. R. Buckminster Fuller ------------------------------------------------------------------------- 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