move O_LARGEFILE forcing to filp_open()

William Lee Irwin III
2004-07-04T06:41:26Z

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)) {