move O_LARGEFILE forcing to filp_open()

From: William Lee Irwin III
Date: Sun Jul 04 2004 - 01:42:23 EST


Internal kernel open() of files barfs in important contexts, for
instance, using strict non-overcommit with enough swap for large
commitments. This is carried out through the entrypoint filp_open(),
not sys_open(). sys_open() in turn calls filp_open(). So merely
moving the forcing of the flag on 64-bit resolves this situation there,
though not for 32-bit, whose solution is to appear in the sequel.


-- wli

Index: mm5-2.6.7/fs/open.c
===================================================================
--- mm5-2.6.7.orig/fs/open.c 2004-06-15 22:18:56.000000000 -0700
+++ mm5-2.6.7/fs/open.c 2004-07-03 22:58:51.081134896 -0700
@@ -755,6 +755,8 @@
int namei_flags, error;
struct nameidata nd;

+ if (BITS_PER_LONG > 32)
+ flags |= O_LARGEFILE;
namei_flags = flags;
if ((namei_flags+1) & O_ACCMODE)
namei_flags++;
@@ -943,9 +945,6 @@
char * tmp;
int fd, error;

-#if BITS_PER_LONG != 32
- flags |= O_LARGEFILE;
-#endif
tmp = getname(filename);
fd = PTR_ERR(tmp);
if (!IS_ERR(tmp)) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/