lkml.org 
[lkml]   [1999]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] OOPS on swapon
Date
Hi, 

> here's how to reproduce it:
> dd if=/dev/zero of=swapfile count=8192
> mkswap -v1 swapfile
> swapon swapfile
> swapon swapfile
> swapoff swapfile
> swapon swapfile --> Oops
>
> cat-ing /proc/swaps after the Oops will also give you
> Oops.
> tried it on 2.2.9 & 2.2.7 on machines where i don't have

The following patch should fix this problem with swapfile:

--- linux/mm/swapfile.c.orig Mon Jun 7 11:20:26 1999
+++ linux/mm/swapfile.c Mon Jun 7 11:30:09 1999
@@ -572,7 +572,7 @@
} else if (S_ISREG(swap_dentry->d_inode->i_mode)) {
error = -EBUSY;
for (i = 0 ; i < nr_swapfiles ; i++) {
- if (i == type)
+ if (i == type || !swap_info[i].swap_file)
continue;
if (swap_dentry->d_inode == swap_info[i].swap_file->d_inode)
goto bad_swap;

Regards
Andrzej
--
=======================================================================
Andrzej M. Krzysztofowicz ankry@mif.pg.gda.pl
phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math., Technical University of Gdansk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.024 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site