[PATCH 8/8] cifs: clean up d_revalidate error return

Jeff Layton <[email protected]>
Newsgroups gmane.linux.file-systems.cifs
Message-ID <[email protected]>
If cifs_revalidate returns -ENOENT, then we know that the dentry
should be invalidated and hence d_revalidate should return 0. Other
errors however should be propagated back up to the caller.

Signed-off-by: Jeff Layton <[email protected]>
---
 fs/cifs/dir.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index e9f7ecc..6909b60 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -736,11 +736,15 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
 static int
 cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
 {
+	int rc;
 	int isValid = 1;
 
 	if (direntry->d_inode) {
-		if (cifs_revalidate_dentry(direntry))
-			return 0;
+		rc = cifs_revalidate_dentry(direntry);
+		if (rc == -ENOENT)
+			isValid = 0;
+		else if (rc)
+			isValid = rc;
 	} else {
 		cFYI(1, ("neg dentry 0x%p name = %s",
 			 direntry, direntry->d_name.name));
-- 
1.6.6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.