From 425ecb04d15abd9630d89f76a549c43bb53a2b38 Mon Sep 17 00:00:00 2001 From: Sachin Prabhu Date: Mon, 5 Nov 2012 11:39:32 +0000 Subject: [PATCH] --- yaml --- r: 335565 b: refs/heads/master c: 3798f47aa276b332c30da499cb4df4577e2f8872 h: refs/heads/master i: 335563: 1dbab747599baaed021004366c0caa574c3a3b64 v: v3 --- [refs] | 2 +- trunk/fs/cifs/dir.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 0b7f3ccefe8a..40a3e15ab88b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 36960e440ccf94349c09fb944930d3bfe4bc473f +refs/heads/master: 3798f47aa276b332c30da499cb4df4577e2f8872 diff --git a/trunk/fs/cifs/dir.c b/trunk/fs/cifs/dir.c index 7c0a81283645..d3671f2acb29 100644 --- a/trunk/fs/cifs/dir.c +++ b/trunk/fs/cifs/dir.c @@ -398,7 +398,16 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, * in network traffic in the other paths. */ if (!(oflags & O_CREAT)) { - struct dentry *res = cifs_lookup(inode, direntry, 0); + struct dentry *res; + + /* + * 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; + + res = cifs_lookup(inode, direntry, 0); if (IS_ERR(res)) return PTR_ERR(res);