Skip to contentSkip to conversation

orangefs: reverse sense of revalidate is-inode-stale test

PATCH New Martin Brandenburg 1 participant 1 message Jan 26, 2018

Subsystems (2)
lore
Share & tools
lore

Martin Brandenburg

author reviewer
#0 lore raw

PATCH 1/1 orangefs: reverse sense of revalidate is-inode-stale test

It was wrong.

---
 fs/orangefs/dcache.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
fs/orangefs/dcache.c +7 -10
index ae782df5c063..c7aa5c923477 100644
@@ -118,8 +118,12 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
 		return 0;
 
 	/* We do not need to continue with negative dentries. */
-	if (!dentry->d_inode)
-		goto out;
+	if (!dentry->d_inode) {
+		gossip_debug(GOSSIP_DCACHE_DEBUG,
+		    "%s: negative dentry or positive dentry and inode valid.\n",
+		    __func__);
+		return 1;
+	}
 
 	/* Now we must perform a getattr to validate the inode contents. */
 
@@ -129,14 +133,7 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
 		    __FILE__, __func__, __LINE__);
 		return 0;
 	}
-	if (ret == 0)
-		return 0;
-
-out:
-	gossip_debug(GOSSIP_DCACHE_DEBUG,
-	    "%s: negative dentry or positive dentry and inode valid.\n",
-	    __func__);
-	return 1;
+	return !ret;
 }
 
 const struct dentry_operations orangefs_dentry_operations = {
Signature · 1 line
2.14.2