diff options
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -840,11 +840,15 @@ 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 | /* | 843 | if (flags & O_TMPFILE) { |
844 | * If we have O_PATH in the open flag. Then we | 844 | if (!(flags & O_CREAT)) |
845 | * cannot have anything other than the below set of flags | 845 | return -EINVAL; |
846 | */ | 846 | acc_mode = MAY_OPEN | ACC_MODE(flags); |
847 | if (flags & O_PATH) { | 847 | } else if (flags & O_PATH) { |
848 | /* | ||
849 | * If we have O_PATH in the open flag. Then we | ||
850 | * cannot have anything other than the below set of flags | ||
851 | */ | ||
848 | flags &= O_DIRECTORY | O_NOFOLLOW | O_PATH; | 852 | flags &= O_DIRECTORY | O_NOFOLLOW | O_PATH; |
849 | acc_mode = 0; | 853 | acc_mode = 0; |
850 | } else { | 854 | } else { |