Commit e56ac609 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] handle setup_swap_extents() error in swapon.

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.
parent 908f8449
...@@ -1403,7 +1403,8 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags) ...@@ -1403,7 +1403,8 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
p->max = maxpages; p->max = maxpages;
p->pages = nr_good_pages; p->pages = nr_good_pages;
if (setup_swap_extents(p)) error = setup_swap_extents(p);
if (error)
goto bad_swap; goto bad_swap;
swap_list_lock(); swap_list_lock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment