summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2011-05-31 01:29:43 +0000
committerAnand Avati <avati@gluster.com>2011-05-31 09:11:35 -0700
commit537b65f44dfa463cc1a522f5ad5f1fc9f11d99a6 (patch)
tree45b2eac45c4963aa4ff35a9905394b89ed2dd813
parent6fa0515c04563c0ff8f6a189c9189a7f4da29e77 (diff)
performance/stat-prefetch: return ESTALE if inode's gfid is not the same as cached
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2927 (Mismatched link/target gfid and ESTALE/ENOENT) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2927
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 3d82174fe..03ee2d3ac 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -1094,6 +1094,15 @@ sp_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req)
if (cache) {
ret = sp_cache_get_entry (cache, (char *)loc->name, &dirent);
if (ret == 0) {
+ if (!uuid_is_null (loc->inode->gfid)
+ && (uuid_compare (loc->inode->gfid,
+ dirent->d_stat.ia_gfid))
+ != 0) {
+ op_ret = -1;
+ op_errno = ESTALE;
+ goto unwind;
+ }
+
ret = inode_ctx_get (loc->parent, this, &value);
if ((ret == 0) && (value != 0)) {
parent_inode_ctx = (void *)(long)value;