lkml.org 
[lkml]   [2003]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH][2.6] No swapping on memory backed swapfiles
On Mon, 13 Oct 2003, Andrew Morton wrote:

> A non-memory-backed fs may still have a NULL ->readpage though (ncpfs?).
>
> I do think it best to just test for ->readpage, and give the user the extra
> rope.

Ok, here we go;

Index: linux-2.6.0-test7/mm/swapfile.c
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test7/mm/swapfile.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 swapfile.c
--- linux-2.6.0-test7/mm/swapfile.c 9 Oct 2003 05:56:12 -0000 1.1.1.1
+++ linux-2.6.0-test7/mm/swapfile.c 13 Oct 2003 09:23:31 -0000
@@ -1318,6 +1318,10 @@ asmlinkage long sys_swapon(const char __
/*
* Read the swap header.
*/
+ if (!mapping->a_ops->readpage) {
+ error = -EIO;
+ goto bad_swap;
+ }
page = read_cache_page(mapping, 0,
(filler_t *)mapping->a_ops->readpage, swap_file);
if (IS_ERR(page)) {
-
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/
\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.021 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site