On Tue, 24 Apr 2007 21:24:28 +0200
Tim Dijkstra <[EMAIL PROTECTED]> wrote:

> On Mon, 23 Apr 2007 23:34:58 +0200
> "Rafael J. Wysocki" <[EMAIL PROTECTED]> wrote:
> 
> > On Monday, 23 April 2007 21:30, Tim Dijkstra wrote:
> > > On Sun, 22 Apr 2007 23:22:30 +0200
> > > "Rafael J. Wysocki" <[EMAIL PROTECTED]> wrote:
> > > 
> > > > On Sunday, 22 April 2007 22:06, Tim Dijkstra wrote:
> > > > > On Sun, 22 Apr 2007 21:18:46 +0200
> > > > > "Rafael J. Wysocki" <[EMAIL PROTECTED]> wrote:
> > > > > 
> > > > > > 
> > > > > > I think we have to debug the swap-file-on-LVM case more thoroughly.
> > > > > 
> > > > > OK, I've tried printing out /dev/resume_device + offset in mark_swap.
> > > > > Does the following seem reasonable?
> > > > > 
> > > > > 
> > > > >                 char ff[100];
> > > > >                 lseek(fd, shift, SEEK_SET);
> > > > >                 read(fd,ff,80);
> > > > >                 printf("The header (shift %u): %80s\n", shift, ff);
> > > > 
> > > > Yes, it does.
> > > > 
> > > > > It prints nothing ...
> > > > 
> > > > I thought it would.
> > > > 
> > > > Still, swap-offset doesn't fail, so it evidently is able to find the 
> > > > swap
> > > > signature in your file.
> > > 
> > > > Can you hack swap-offset.c so that it prints stat.st_rdev after calling 
> > > > fstat()
> > > > and run it on your swap file, then hack suspend.c so that it prints 
> > > > blkdev
> > > > in set_swap_file() and compare these two things?
> > > 
> > > stat.st_rdev == 0, but I think that's logical, because the swap _file_ is 
> > > not a
> > > device file.
> > > stat.st_dev == 64773 
> > > 
> > > Which is also the value of blkdev in suspend.
> > 
> > And which is strange, because s2disk uses stat.st_rdev .
> > 
> > Something fishy is going on here ...

I'm looking a bit closer into writing the image. I'm a bit confused. In
the case of a swap file we also need the offset. Indeed the function
set_swap_file uses that information. BTW the ioctl seem a bit counterintuitive  
you set a swap-file with ioctl(dev, SNAPSHOT_SET_SWAP_AREA, &swap);
and a swap partition with  ioctl(dev, SNAPSHOT_SET_SWAP_FILE, blkdev);

But then that information is not used in init_swap_writer. The only
thing we pass to that function is a file-descriptor pointing to the
device that contains the swap-file...

grts Tim

Attachment: signature.asc
Description: PGP signature

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to