aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Brandenburg <martin@omnibond.com>2018-02-06 09:01:26 -0500
committerMike Marshall <hubcap@omnibond.com>2018-02-06 16:38:13 -0500
commit74e938c22705c7b80d4422e84eea927fc78e60a8 (patch)
tree02704ab50e56c7d2bd520f6882861ac294dedd3c
parent480e5ae9b860c8a1c74ab9414f9bd78a43ad356f (diff)
orangefs: reverse sense of is-inode-stale test in d_revalidate
If a dentry is deleted, then a dentry is recreated with the same handle but a different type (i.e. it was a file and now it's a symlink), then its a different inode. The check was backwards, so d_revalidate would not have noticed. Due to the design of the OrangeFS server, this is rather unlikely. It's also possible for the dentry to be deleted and recreated with the same type. This would be undetectable. It's a bit of a ship of Theseus. Signed-off-by: Martin Brandenburg <martin@omnibond.com> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
-rw-r--r--fs/orangefs/dcache.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/fs/orangefs/dcache.c b/fs/orangefs/dcache.c
index be06e1532a3b..fe484cf93e5c 100644
--- a/fs/orangefs/dcache.c
+++ b/fs/orangefs/dcache.c
@@ -118,8 +118,12 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
118 return 0; 118 return 0;
119 119
120 /* We do not need to continue with negative dentries. */ 120 /* We do not need to continue with negative dentries. */
121 if (!dentry->d_inode) 121 if (!dentry->d_inode) {
122 goto out; 122 gossip_debug(GOSSIP_DCACHE_DEBUG,
123 "%s: negative dentry or positive dentry and inode valid.\n",
124 __func__);
125 return 1;
126 }
123 127
124 /* Now we must perform a getattr to validate the inode contents. */ 128 /* Now we must perform a getattr to validate the inode contents. */
125 129
@@ -129,14 +133,7 @@ static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags)
129 __FILE__, __func__, __LINE__); 133 __FILE__, __func__, __LINE__);
130 return 0; 134 return 0;
131 } 135 }
132 if (ret == 0) 136 return !ret;
133 return 0;
134
135out:
136 gossip_debug(GOSSIP_DCACHE_DEBUG,
137 "%s: negative dentry or positive dentry and inode valid.\n",
138 __func__);
139 return 1;
140} 137}
141 138
142const struct dentry_operations orangefs_dentry_operations = { 139const struct dentry_operations orangefs_dentry_operations = {