]> git.hungrycats.org Git - linux/commitdiff
[PATCH] handle setup_swap_extents() error in swapon.
authorAndrew Morton <akpm@osdl.org>
Sun, 31 Aug 2003 11:36:26 +0000 (04:36 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 31 Aug 2003 11:36:26 +0000 (04:36 -0700)
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.

mm/swapfile.c

index 6b1c9f893fbb02a85f3f43dc46d7a2fef394e943..e91603973bb0fd2a0ab95f23d39a34d3f57b079c 100644 (file)
@@ -1403,7 +1403,8 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
        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();