From f8cc3a6a9f3979ed7cad3882e43b0fec219850a2 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Fri, 27 May 2011 00:21:09 +0000 Subject: performance/stat-prefetch: return ESTALE if inode's gfid is not the same as cached gfid for a path. Signed-off-by: Raghavendra G Signed-off-by: shishir gowda Signed-off-by: Anand Avati BUG: 2927 (Mismatched link/target gfid and ESTALE/ENOENT) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2927 --- xlators/performance/stat-prefetch/src/stat-prefetch.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators') diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index b99c91bce..573a7ad42 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1142,6 +1142,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; -- cgit