Commit 488facdf authored by William Lee Irwin III's avatar William Lee Irwin III Committed by Linus Torvalds

[PATCH] force O_LARGEFILE in sys_swapon() and sys_swapoff()

For 32-bit, one quickly discovers that swapon() is not given an fd already
opened with O_LARGEFILE to act upon and the forcing of O_LARGEFILE for
64-bit is irrelevant, as the system call's argument is a path.  So this
patch manually forces it for swapon() and swapoff().
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 527457d7
......@@ -1085,7 +1085,7 @@ asmlinkage long sys_swapoff(const char __user * specialfile)
if (IS_ERR(pathname))
goto out;
victim = filp_open(pathname, O_RDWR, 0);
victim = filp_open(pathname, O_RDWR|O_LARGEFILE, 0);
putname(pathname);
err = PTR_ERR(victim);
if (IS_ERR(victim))
......@@ -1354,7 +1354,7 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
name = NULL;
goto bad_swap_2;
}
swap_file = filp_open(name, O_RDWR, 0);
swap_file = filp_open(name, O_RDWR|O_LARGEFILE, 0);
error = PTR_ERR(swap_file);
if (IS_ERR(swap_file)) {
swap_file = NULL;
......
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