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

login
register
mail settings
Submitter Jeff Layton
Date Feb. 11, 2010, 7:58 p.m.
Message ID <1265918330-2810-9-git-send-email-jlayton@redhat.com>
Download mbox | patch
Permalink /patch/45152/
State New
Headers show

Comments

Jeff Layton - Feb. 11, 2010, 7:58 p.m.
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 <jlayton@redhat.com>
---
 fs/cifs/dir.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

Patch

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));