From: Hugh Dickins <hugh@veritas.com>

It's good that swapon fails on a tmpfs file ("swapfile has holes"), but not
good that it then hangs up: note error from setup_swap_extents.



 25-akpm/mm/swapfile.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN mm/swapfile.c~handle-setup_swap_extents-error mm/swapfile.c
--- 25/mm/swapfile.c~handle-setup_swap_extents-error	Fri Aug 29 14:09:02 2003
+++ 25-akpm/mm/swapfile.c	Fri Aug 29 14:09:02 2003
@@ -1403,7 +1403,8 @@ asmlinkage long sys_swapon(const char __
 	p->max = maxpages;
 	p->pages = nr_good_pages;
 
-	if (setup_swap_extents(p))
+	error = setup_swap_extents(p);
+	if (error)
 		goto bad_swap;
 
 	swap_list_lock();

_