From: William Lee Irwin III 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 --- 25-akpm/mm/swapfile.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN mm/swapfile.c~force-o_largefile-in-sys_swapon-and-sys_swapoff mm/swapfile.c --- 25/mm/swapfile.c~force-o_largefile-in-sys_swapon-and-sys_swapoff 2004-07-03 23:54:38.044292640 -0700 +++ 25-akpm/mm/swapfile.c 2004-07-03 23:54:38.049291880 -0700 @@ -1085,7 +1085,7 @@ asmlinkage long sys_swapoff(const char _ 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 __ 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; _