c8c2a31
@@ -, +, @@ 
c84ab99
 cifs_atomic_open
c84ab99
 fs/cifs/dir.c | 6 ++++++
c84ab99
 1 file changed, 6 insertions(+)
c8c2a31
--- a/fs/cifs/dir.c	
c8c2a31
+++ a/fs/cifs/dir.c	
c84ab99
@@ -398,6 +398,12 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
c8c2a31
 	 * in network traffic in the other paths.
c8c2a31
 	 */
c8c2a31
 	if (!(oflags & O_CREAT)) {
c84ab99
+		/* Check for hashed negative dentry. We have already revalidated
c84ab99
+		 * the dentry and it is fine. No need to perform another lookup.
c84ab99
+		 */
c84ab99
+		if (!d_unhashed(direntry))
c8c2a31
+			return -ENOENT;
c8c2a31
+
c84ab99
 		struct dentry *res = cifs_lookup(inode, direntry, 0);
c8c2a31
 		if (IS_ERR(res))
c8c2a31
 			return PTR_ERR(res);