summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNithya Balachandran <nbalacha@redhat.com>2015-03-25 21:07:36 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2015-04-08 19:45:55 +0000
commita7f1d08b8f0bdf8d251590d6f7e4acc46f2486b4 (patch)
tree885deee640fc4f5d6d1c491b7dfb379a61074f58
parent71897c714f570ae9a64ad0809fd890d1d5265b23 (diff)
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 <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/9998 Reviewed-by: Susant Palai <spalai@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Tested-by: Shyamsundar Ranganathan <srangana@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-common.c17
1 files changed, 6 insertions, 11 deletions
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
@@ -1496,15 +1496,6 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
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);
gf_msg_debug (this->name, 0,
@@ -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++;