diff options
author | William Lee Irwin III <wli@holomorphy.com> | 2004-07-04 20:26:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-04 20:26:08 -0700 |
commit | 488facdfec9118241e8c5564ed60b6975571dcea (patch) | |
tree | de1a7484c28ba0565f8c994999ed7ecedaaef4c6 /mm | |
parent | 527457d72c7895ad194ed5656a74a00648cee4d6 (diff) | |
download | history-488facdfec9118241e8c5564ed60b6975571dcea.tar.gz |
[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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/swapfile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/swapfile.c b/mm/swapfile.c index 281a3fbc0d8949..0f53dd9f52682b 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -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; |