Merge tag 'x86-build-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / fs / open.c
index b69d6ee..719b320 100644 (file)
--- a/fs/open.c
+++ b/fs/open.c
@@ -1046,8 +1046,10 @@ inline int build_open_flags(const struct open_how *how, struct open_flags *op)
 
        if (flags & O_CREAT) {
                op->intent |= LOOKUP_CREATE;
-               if (flags & O_EXCL)
+               if (flags & O_EXCL) {
                        op->intent |= LOOKUP_EXCL;
+                       flags |= O_NOFOLLOW;
+               }
        }
 
        if (flags & O_DIRECTORY)