aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/alpha/include/uapi/asm/fcntl.h2
-rw-r--r--arch/parisc/include/uapi/asm/fcntl.h2
-rw-r--r--arch/sparc/include/uapi/asm/fcntl.h2
-rw-r--r--fs/namei.c2
-rw-r--r--fs/open.c4
-rw-r--r--include/uapi/asm-generic/fcntl.h8
6 files changed, 12 insertions, 8 deletions
diff --git a/arch/alpha/include/uapi/asm/fcntl.h b/arch/alpha/include/uapi/asm/fcntl.h
index dfdadb0b4bef..09f49a6b87d1 100644
--- a/arch/alpha/include/uapi/asm/fcntl.h
+++ b/arch/alpha/include/uapi/asm/fcntl.h
@@ -32,7 +32,7 @@
32#define O_SYNC (__O_SYNC|O_DSYNC) 32#define O_SYNC (__O_SYNC|O_DSYNC)
33 33
34#define O_PATH 040000000 34#define O_PATH 040000000
35#define O_TMPFILE 0100000000 35#define __O_TMPFILE 0100000000
36 36
37#define F_GETLK 7 37#define F_GETLK 7
38#define F_SETLK 8 38#define F_SETLK 8
diff --git a/arch/parisc/include/uapi/asm/fcntl.h b/arch/parisc/include/uapi/asm/fcntl.h
index cc61c475f277..34a46cbc76ed 100644
--- a/arch/parisc/include/uapi/asm/fcntl.h
+++ b/arch/parisc/include/uapi/asm/fcntl.h
@@ -20,7 +20,7 @@
20#define O_INVISIBLE 004000000 /* invisible I/O, for DMAPI/XDSM */ 20#define O_INVISIBLE 004000000 /* invisible I/O, for DMAPI/XDSM */
21 21
22#define O_PATH 020000000 22#define O_PATH 020000000
23#define O_TMPFILE 040000000 23#define __O_TMPFILE 040000000
24 24
25#define F_GETLK64 8 25#define F_GETLK64 8
26#define F_SETLK64 9 26#define F_SETLK64 9
diff --git a/arch/sparc/include/uapi/asm/fcntl.h b/arch/sparc/include/uapi/asm/fcntl.h
index d73e5e008b0d..7e8ace5bf760 100644
--- a/arch/sparc/include/uapi/asm/fcntl.h
+++ b/arch/sparc/include/uapi/asm/fcntl.h
@@ -35,7 +35,7 @@
35#define O_SYNC (__O_SYNC|O_DSYNC) 35#define O_SYNC (__O_SYNC|O_DSYNC)
36 36
37#define O_PATH 0x1000000 37#define O_PATH 0x1000000
38#define O_TMPFILE 0x2000000 38#define __O_TMPFILE 0x2000000
39 39
40#define F_GETOWN 5 /* for sockets. */ 40#define F_GETOWN 5 /* for sockets. */
41#define F_SETOWN 6 /* for sockets. */ 41#define F_SETOWN 6 /* for sockets. */
diff --git a/fs/namei.c b/fs/namei.c
index b2beee7a733f..8b61d103a8a7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2977,7 +2977,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
2977 2977
2978 file->f_flags = op->open_flag; 2978 file->f_flags = op->open_flag;
2979 2979
2980 if (unlikely(file->f_flags & O_TMPFILE)) { 2980 if (unlikely(file->f_flags & __O_TMPFILE)) {
2981 error = do_tmpfile(dfd, pathname, nd, flags, op, file, &opened); 2981 error = do_tmpfile(dfd, pathname, nd, flags, op, file, &opened);
2982 goto out; 2982 goto out;
2983 } 2983 }
diff --git a/fs/open.c b/fs/open.c
index fca72c4d3f17..9156cb050d08 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -840,8 +840,8 @@ static inline int build_open_flags(int flags, umode_t mode, struct open_flags *o
840 if (flags & __O_SYNC) 840 if (flags & __O_SYNC)
841 flags |= O_DSYNC; 841 flags |= O_DSYNC;
842 842
843 if (flags & O_TMPFILE) { 843 if (flags & __O_TMPFILE) {
844 if (!(flags & O_CREAT)) 844 if ((flags & O_TMPFILE_MASK) != O_TMPFILE)
845 return -EINVAL; 845 return -EINVAL;
846 acc_mode = MAY_OPEN | ACC_MODE(flags); 846 acc_mode = MAY_OPEN | ACC_MODE(flags);
847 } else if (flags & O_PATH) { 847 } else if (flags & O_PATH) {
diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
index 06632beaa6d5..05ac354e124d 100644
--- a/include/uapi/asm-generic/fcntl.h
+++ b/include/uapi/asm-generic/fcntl.h
@@ -84,10 +84,14 @@
84#define O_PATH 010000000 84#define O_PATH 010000000
85#endif 85#endif
86 86
87#ifndef O_TMPFILE 87#ifndef __O_TMPFILE
88#define O_TMPFILE 020000000 88#define __O_TMPFILE 020000000
89#endif 89#endif
90 90
91/* a horrid kludge trying to make sure that this will fail on old kernels */
92#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY | O_RDWR)
93#define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT | O_ACCMODE)
94
91#ifndef O_NDELAY 95#ifndef O_NDELAY
92#define O_NDELAY O_NONBLOCK 96#define O_NDELAY O_NONBLOCK
93#endif 97#endif