[linux-cifs-client] [PATCH 8/8] cifs: clean up d_revalidate error return
Jeff Layton
jlayton at redhat.com
Thu Feb 11 12:58:50 MST 2010
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 at redhat.com>
---
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
More information about the linux-cifs-client
mailing list