From a7f1d08b8f0bdf8d251590d6f7e4acc46f2486b4 Mon Sep 17 00:00:00 2001 From: Nithya Balachandran Date: Wed, 25 Mar 2015 21:07:36 +0530 Subject: Cluster/DHT Mismatching gfid values in dht_local_t If multiple files with the same name but different gfids exist on different subvolumes, dht_lookup_everywhere_cbk() copies the gfid from the last received response into local->gfid but does not update the local->stbuf structure. dht_linkfile_create() uses the value in local->gfid, but dht_linkfile_attr_heal() uses the one in local->stbuf, causing a mismatch and failure while trying to heal the linkfile attrs. Change-Id: I80d152be95b42d736c5d9182b955f42e374b82a5 BUG: 1205785 Signed-off-by: Nithya Balachandran Reviewed-on: http://review.gluster.org/9998 Reviewed-by: Susant Palai Reviewed-by: Shyamsundar Ranganathan Tested-by: Shyamsundar Ranganathan --- xlators/cluster/dht/src/dht-common.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index b85edde09a9..e0b159ace32 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1495,15 +1495,6 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this, is_linkfile = check_is_linkfile (inode, buf, xattr, conf->link_xattr_name); - if (is_linkfile) { - - gf_msg_debug (this->name, 0, - "Found linktofile on %s for %s", - subvol->name, loc->path); - - } - is_dir = check_is_dir (inode, buf, xattr); - if (is_linkfile) { link_subvol = dht_linkfile_subvol (this, inode, buf, xattr); @@ -1514,8 +1505,12 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } - /* non linkfile GFID takes precedence */ - gf_uuid_copy (local->gfid, buf->ia_gfid); + is_dir = check_is_dir (inode, buf, xattr); + + /* non linkfile GFID takes precedence but don't overwrite + gfid if we have already found a cached file*/ + if (!local->cached_subvol) + gf_uuid_copy (local->gfid, buf->ia_gfid); if (is_dir) { local->dir_count++; -- cgit