From: Zwane Mwaikambo The swapon code uses read_cache_page() to access the swap header, so the filesystem had better implement it. mm/swapfile.c | 4 ++++ 1 files changed, 4 insertions(+) diff -puN mm/swapfile.c~swapon-handle-no-readpage mm/swapfile.c --- 25/mm/swapfile.c~swapon-handle-no-readpage 2003-10-13 02:43:18.000000000 -0700 +++ 25-akpm/mm/swapfile.c 2003-10-13 02:43:18.000000000 -0700 @@ -1317,6 +1317,10 @@ asmlinkage long sys_swapon(const char __ /* * Read the swap header. */ + if (!mapping->a_ops->readpage) { + error = -EINVAL; + goto bad_swap; + } page = read_cache_page(mapping, 0, (filler_t *)mapping->a_ops->readpage, swap_file); if (IS_ERR(page)) { _