summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2011-06-09 02:32:40 +0000
committerAnand Avati <avati@gluster.com>2011-06-09 01:35:38 -0700
commit8dee45b3a74b20f7cfbab68b9f8d71c125301772 (patch)
tree4225f3663f4bb39d3b373be46a38f3ec03dd2286
parentc51b2f7c6c72cdc2a6ea65b3d4b4f927814d909f (diff)
cluster/dht: use GFID returned from hashed subvolumev3.2.1qa4
.. 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 <avati@gluster.com> BUG: 2522 ([glusterfs-3.1.3qa8]: rm -rf shows invalid argument) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2522
-rw-r--r--xlators/cluster/dht/src/dht-common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index d6753ff..113c7a1 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -981,6 +981,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;
GF_VALIDATE_OR_GOTO ("dht", frame, out);
GF_VALIDATE_OR_GOTO ("dht", this, unwind);
@@ -1004,6 +1005,10 @@ dht_lookup_directory (call_frame_t *frame, xlator_t *this, loc_t *loc)
local->xattr = NULL;
}
+ 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],