summaryrefslogtreecommitdiff
path: root/include/asm-ia64
diff options
context:
space:
mode:
authorYoav Zach <yoav_zach@yahoo.com>2005-06-23 00:09:58 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 09:45:28 -0700
commitef3daeda7b58f046f94b26637d500354038d39f4 (patch)
treeacce3fb6a4ef5fa5c4e6962490d6f0db434fbad3 /include/asm-ia64
parent44e58a6a0bd604f46be9d808408a1cd880cc9b19 (diff)
[PATCH] Don't force O_LARGEFILE for 32 bit processes on ia64
In ia64 kernel, the O_LARGEFILE flag is forced when opening a file. This is problematic for execution of 32 bit processes, which are not largefile aware, either by SW emulation or by HW execution. For such processes, the problem is two-fold: 1) When trying to open a file that is larger than 4G the operation should fail, but it's not 2) Writing to offset larger than 4G should fail, but it's not The proposed patch takes advantage of the way 32 bit processes are identified in ia64 systems. Such processes have PER_LINUX32 for their personality. With the patch, the ia64 kernel will not enforce the O_LARGEFILE flag if the current process has PER_LINUX32 set. The behavior for all other architectures remains unchanged. Signed-off-by: Yoav Zach <yoav.zach@intel.com> Acked-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-ia64')
-rw-r--r--include/asm-ia64/fcntl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
index d193981bb1d8..c9f8d835d0cc 100644
--- a/include/asm-ia64/fcntl.h
+++ b/include/asm-ia64/fcntl.h
@@ -81,4 +81,6 @@ struct flock {
#define F_LINUX_SPECIFIC_BASE 1024
+#define force_o_largefile() ( ! (current->personality & PER_LINUX32) )
+
#endif /* _ASM_IA64_FCNTL_H */