From 1a06583bc6ad298c97bdbafbcc0246bddc0ce301 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Thu, 9 Jun 2011 02:32:22 +0000 Subject: cluster/dht: use GFID returned from hashed subvolume .. to perform lookups on remaining subvolumes. This way, if there is a race between two clients to 'fix' GFIDs with gfid-req, then the hashed subvolume will arbitrate and return the winner in stbuf->ia_gfid. This patch uses the returned gfid as the new gfid-req thereby preventing mismatching GFIDs on other servers due to further races. Signed-off-by: Anand Avati BUG: 2522 ([glusterfs-3.1.3qa8]: rm -rf shows invalid argument) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2522 --- xlators/cluster/dht/src/dht-common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index ac713384abe..5583bd5592d 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -699,6 +699,7 @@ dht_lookup_directory (call_frame_t *frame, xlator_t *this, loc_t *loc) int i = 0; dht_conf_t *conf = NULL; dht_local_t *local = NULL; + int ret = 0; conf = this->private; local = frame->local; @@ -716,6 +717,10 @@ dht_lookup_directory (call_frame_t *frame, xlator_t *this, loc_t *loc) goto unwind; } + if (!uuid_is_null (local->gfid)) + ret = dict_set_static_bin (local->xattr_req, "gfid-req", + local->gfid, 16); + for (i = 0; i < call_cnt; i++) { STACK_WIND (frame, dht_lookup_dir_cbk, conf->subvolumes[i], -- cgit