mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* 2.5.2: swapon failing with errno=0 (sys_swapon) (repost)
@ 2002-01-17 17:14 Alex Riesen
  0 siblings, 0 replies; only message in thread
From: Alex Riesen @ 2002-01-17 17:14 UTC (permalink / raw)
  To: linux-kernel

I'm not cc'ing someone personally (because i don't know
whom to address), so i just repost the patch, in case
noone have seen it. The thing really disabled swap,
although maybe noone is really need it for 2.5.2 ;)

repost:
Tried to use 2.5.2. And got the message from swapon:
swapon: /dev/hda6: Success

strace showed some strange return value from swapon(2),
looking like a pointer.

The patch will cure the problem, though i'm not sure
about the reasons setting the error to pointer.
Are the kernel pointers handled specially in errors?
-alex

--- linux/mm/swapfile.c Mon Jan 14 18:38:36 2002
+++ linux/mm/swapfile.c-        Thu Jan 17 08:50:28 2002
@@ -904,7 +904,7 @@
        swap_file = filp_open(name, O_RDWR, 0);
        putname(name);
        error = PTR_ERR(swap_file);
-       if (error)
+       if (IS_ERR(swap_file))
                goto bad_swap_2;
 
        p->swap_file = swap_file;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-01-17 17:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-17 17:14 2.5.2: swapon failing with errno=0 (sys_swapon) (repost) Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®