LOOKUP_CREATE and LOOKUP_RENAME_TARGET can be set only on the last step
[firefly-linux-kernel-4.4.55.git] / fs / cifs / dir.c
index fa8c21d913bc5b212191d2c444cb5ce74e1d4058..251c2ca569d3a2b15dd63f90261ccd149120794f 100644 (file)
@@ -179,7 +179,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
        if (oplockEnabled)
                oplock = REQ_OPLOCK;
 
-       if (nd && (nd->flags & LOOKUP_OPEN))
+       if (nd)
                oflags = nd->intent.open.file->f_flags;
        else
                oflags = O_RDONLY | O_CREAT;
@@ -214,7 +214,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                   which should be rare for path not covered on files) */
        }
 
-       if (nd && (nd->flags & LOOKUP_OPEN)) {
+       if (nd) {
                /* if the file is going to stay open, then we
                   need to set the desired access properly */
                desiredAccess = 0;
@@ -328,7 +328,7 @@ cifs_create_set_dentry:
        else
                cFYI(1, "Create worked, get_inode_info failed rc = %d", rc);
 
-       if (newinode && nd && (nd->flags & LOOKUP_OPEN)) {
+       if (newinode && nd) {
                struct cifsFileInfo *pfile_info;
                struct file *filp;
 
@@ -663,10 +663,8 @@ cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
         * case sensitive name which is specified by user if this is
         * for creation.
         */
-       if (!(nd->flags & (LOOKUP_CONTINUE | LOOKUP_PARENT))) {
-               if (nd->flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
-                       return 0;
-       }
+       if (nd->flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET))
+               return 0;
 
        if (time_after(jiffies, direntry->d_time + HZ) || !lookupCacheEnabled)
                return 0;