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