On Thursday, 18 January 2007 21:45, Luca Tettamanti wrote: > Il Thu, Jan 18, 2007 at 12:26:12PM -0700, Brandon Beck ha scritto: > > [EMAIL PROTECTED] wrote: > > >Hi, > > > > > >(added Cc to suspend-devel and the author of swap-offset) > > > > > >On Thursday, 18 January 2007 08:32, you wrote: > > >>Hello Rafael, > > >> Is the resume offset ever supposed to be a negative number? I run > > >>swap-offset /var/swap on a 2.6.20-rc5 kernel and get -270968. I don't > > >>really want to mess up my system here. > > > > > >No, it should be positive. > > > > > >What is the size of blocks on your /var? > > > > For good or for ill, I have a single partition (sda1) and I recently > > created the swapfile for use with uswsusp, so it is presumably towards the > > end of the disk. On /dev/sda1 I have 76920416 1K blocks with 1299176 > > available (99% use :-) > > Internally address_space_operation (->bmap) uses a sector_t (u64), but > the ioctl truncates it to a 32bit signed integer. With 1K blocks it > gives a limit of 2TB (or 4TB casting back to unsigned int). > > What may overflow is this (swap-offset.c:110): > > first_block * blk_size > > The following patch should fix it: > > - Kernel uses unsigned quantify for block number, pass an unsigned int > to the ioctl. > - Use 64bit math to avoid overflow.
Thanks for the patch, I think we can apply it. Greetings, Rafael -- If you don't have the time to read, you don't have the time or the tools to write. - Stephen King ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Suspend-devel mailing list Suspend-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/suspend-devel