On Thursday, 29 March 2007 21:46, Tim Dijkstra wrote: > On Thu, 29 Mar 2007 00:28:07 +0200 > "Rafael J. Wysocki" <[EMAIL PROTECTED]> wrote: > > > On Thursday, 29 March 2007 00:14, Tim Dijkstra wrote: > > > On Tue, 27 Mar 2007 23:11:41 +0200 > > > "Rafael J. Wysocki" <[EMAIL PROTECTED]> wrote: > > > > > > > > diff -u -r1.70 suspend.c > > > > > --- suspend.c 16 Mar 2007 16:02:22 -0000 1.70 > > > > > +++ suspend.c 27 Mar 2007 20:36:52 -0000 > > > > > @@ -208,7 +208,7 @@ > > > > > swap.offset = offset; > > > > > error = ioctl(dev, SNAPSHOT_SET_SWAP_AREA, &swap); > > > > > if (error && !offset) > > > > > - error = ioctl(dev, SNAPSHOT_SET_SWAP_FILE, blkdev); > > > > > + error = ioctl(dev, SNAPSHOT_SET_SWAP_FILE, (unsigned > > > > > long) blkdev); > > > > > > > > Heh, I wonder. :-) > > > > > > > > > Apparently it worked... IMHO this means the code in user.c should be > > > different. snapshot_ioctl expects an unsigned long, which isn't what > > > the user sends. Would it be useful to use copy_from_user()? (Disclaimer > > > I haven't written a single line of kernel code yet, this is just from > > > reading user.c) > > > > Well, maybe, but then we'd have to redefine the ioctl which I'd rather > > avoid. > > Besides, the kernel only needs the lower 32 bits anyway, so why should we > > complicate things to pass the remaining 32 zero bits to it for nothing? > > > > The problem is that in fact the kernel expects us to provide a _pointer_ > > as arg to the ioctl and unsigned long just happens to be of the same size. > > So > > I think we can live with your hack in the userland just fine (but please > > add a > > comment explaining why its needed). > > Would this comment suffice?
I think so, but I'd like Cédric to try one more thing: revert your patch and apply the appended one. If that works, the comment won't even be necessary (I think). Greetings, Rafael --- suspend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: suspend/suspend.c =================================================================== --- suspend.orig/suspend.c +++ suspend/suspend.c @@ -199,7 +199,7 @@ static inline int free_swap_pages(int de return ioctl(dev, SNAPSHOT_FREE_SWAP_PAGES, 0); } -static inline int set_swap_file(int dev, dev_t blkdev, loff_t offset) +static inline int set_swap_file(int dev, u_int32_t blkdev, loff_t offset) { struct resume_swap_area swap; int error; ------------------------------------------------------------------------- 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