public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Swap issue
@ 2002-02-06  4:29 paule
  2002-02-06 12:09 ` Masoud Sharbiani
  2002-02-06 14:27 ` Drew P. Vogel
  0 siblings, 2 replies; 4+ messages in thread
From: paule @ 2002-02-06  4:29 UTC (permalink / raw)
  To: linux-kernel

Having just upgraded slackware8.0 (2.2 kernel)
to using 2.5.2, (2.5.3 patch install failed looking for malloc.h)
Im unable to use swap, despite it showing a success.

# dd if=/dev/zero of=/swap/swapfile bs=1024 count=131072
13107+0 records in
13107+0 records out
# mkswap -c /swap/swapfile
Setting up swapspace version 1, size = 13414400 bytes
# swapon /swap/swapfile
swapon: /swap/swapfile: Success
# cat /proc/meminfo
MemTotal:        61720 kB
MemFree:          1896 kB
MemShared:           0 kB
Buffers:          8300 kB
Cached:          30712 kB
SwapCached:          0 kB
Active:          25316 kB
Inactive:        19688 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:        61720 kB
LowFree:          1896 kB
SwapTotal:           0 kB
SwapFree:            0 kB

I've tried various kernel configurations, and it just doesn't
want to work.

(It was however working under 2.2.x)

Any ideas?

TIA,
--
Paul Edwards
paule@ilu.vu

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Swap issue
  2002-02-06  4:29 Swap issue paule
@ 2002-02-06 12:09 ` Masoud Sharbiani
  2002-02-06 14:27 ` Drew P. Vogel
  1 sibling, 0 replies; 4+ messages in thread
From: Masoud Sharbiani @ 2002-02-06 12:09 UTC (permalink / raw)
  To: paule; +Cc: linux-kernel

paule wrote:

>Having just upgraded slackware8.0 (2.2 kernel)
>to using 2.5.2, (2.5.3 patch install failed looking for malloc.h)
>Im unable to use swap, despite it showing a success.
>
># dd if=/dev/zero of=/swap/swapfile bs=1024 count=131072
>13107+0 records in
>13107+0 records out
># mkswap -c /swap/swapfile
>Setting up swapspace version 1, size = 13414400 bytes
>
I'd do a sync before turning swap on  on a file if I were you.

># swapon /swap/swapfile
>swapon: /swap/swapfile: Success
># cat /proc/meminfo
>MemTotal:        61720 kB
>MemFree:          1896 kB
>MemShared:           0 kB
>Buffers:          8300 kB
>Cached:          30712 kB
>SwapCached:          0 kB
>Active:          25316 kB
>Inactive:        19688 kB
>HighTotal:           0 kB
>HighFree:            0 kB
>LowTotal:        61720 kB
>LowFree:          1896 kB
>SwapTotal:           0 kB
>SwapFree:            0 kB
>
>I've tried various kernel configurations, and it just doesn't
>want to work.
>
>(It was however working under 2.2.x)
>
>Any ideas?
>
>TIA,
>--
>Paul Edwards
>paule@ilu.vu
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
>




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Swap issue
  2002-02-06  4:29 Swap issue paule
  2002-02-06 12:09 ` Masoud Sharbiani
@ 2002-02-06 14:27 ` Drew P. Vogel
  2002-02-06 15:42   ` Hugh Dickins
  1 sibling, 1 reply; 4+ messages in thread
From: Drew P. Vogel @ 2002-02-06 14:27 UTC (permalink / raw)
  To: paule; +Cc: linux-kernel

What is the output of 'swapon -s'?

--Drew Vogel

On Wed, 6 Feb 2002, paule wrote:

>Having just upgraded slackware8.0 (2.2 kernel)
>to using 2.5.2, (2.5.3 patch install failed looking for malloc.h)
>Im unable to use swap, despite it showing a success.
>
># dd if=/dev/zero of=/swap/swapfile bs=1024 count=131072
>13107+0 records in
>13107+0 records out
># mkswap -c /swap/swapfile
>Setting up swapspace version 1, size = 13414400 bytes
># swapon /swap/swapfile
>swapon: /swap/swapfile: Success
># cat /proc/meminfo
>MemTotal:        61720 kB
>MemFree:          1896 kB
>MemShared:           0 kB
>Buffers:          8300 kB
>Cached:          30712 kB
>SwapCached:          0 kB
>Active:          25316 kB
>Inactive:        19688 kB
>HighTotal:           0 kB
>HighFree:            0 kB
>LowTotal:        61720 kB
>LowFree:          1896 kB
>SwapTotal:           0 kB
>SwapFree:            0 kB
>
>I've tried various kernel configurations, and it just doesn't
>want to work.
>
>(It was however working under 2.2.x)
>
>Any ideas?
>
>TIA,
>--
>Paul Edwards
>paule@ilu.vu
>-
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
>




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Swap issue
  2002-02-06 14:27 ` Drew P. Vogel
@ 2002-02-06 15:42   ` Hugh Dickins
  0 siblings, 0 replies; 4+ messages in thread
From: Hugh Dickins @ 2002-02-06 15:42 UTC (permalink / raw)
  To: Drew P. Vogel; +Cc: paule, linux-kernel

> On Wed, 6 Feb 2002, paule wrote:
> 
> >Having just upgraded slackware8.0 (2.2 kernel)
> >to using 2.5.2, (2.5.3 patch install failed looking for malloc.h)
> >Im unable to use swap, despite it showing a success.

Known problem, fixed by Al Viro, additional fix by Andrey Panin:

--- 2.5.2/mm/swapfile.c	Sat Jan 19 21:13:17 2002
+++ linux/mm/swapfile.c	Wed Feb  6 15:36:10 2002
@@ -904,11 +904,12 @@
 	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;
 
+	error = -EINVAL;
 	if (S_ISBLK(swap_file->f_dentry->d_inode->i_mode)) {
 		p->swap_device = swap_file->f_dentry->d_inode->i_rdev;
 		set_blocksize(p->swap_device, PAGE_SIZE);
@@ -1072,7 +1073,7 @@
 	swap_list_unlock();
 	if (swap_map)
 		vfree(swap_map);
-	if (swap_file)
+	if (swap_file && !IS_ERR(swap_file))
 		filp_close(swap_file, NULL);
 out:
 	if (swap_header)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-02-06 15:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-06  4:29 Swap issue paule
2002-02-06 12:09 ` Masoud Sharbiani
2002-02-06 14:27 ` Drew P. Vogel
2002-02-06 15:42   ` Hugh Dickins

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