From a1fd4c9916cc56c10f83b2a1aa7ecee4d563f82a Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Wed, 9 Nov 2011 14:20:10 +0530 Subject: cluster/distribute lookup: send revalidate calls to all subvols for directories If mkdir fails on a subvolume, layout is set taking into account only the subvols where it was successful. stat does not trigger selfheal, as its layout based. Revalidate on directories needs to be sent to all subvols, to fix the error, and not just on the layout. Change-Id: If17055508ffcf268806258ed49e7d7500a89d0f2 BUG: 3793 Reviewed-on: http://review.gluster.com/693 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi --- xlators/cluster/dht/src/dht-common.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'xlators/cluster/dht/src/dht-common.c') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 109bc77f208..faf575df9af 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1113,14 +1113,25 @@ dht_lookup (call_frame_t *frame, xlator_t *this, local->inode = inode_ref (loc->inode); - call_cnt = local->call_cnt = layout->cnt; - /* NOTE: we don't require 'trusted.glusterfs.dht.linkto' attribute, * revalidates directly go to the cached-subvolume. */ ret = dict_set_uint32 (local->xattr_req, "trusted.glusterfs.dht", 4 * 4); + if (IA_ISDIR (local->inode->ia_type)) { + local->call_cnt = call_cnt = conf->subvolume_cnt; + for (i = 0; i < call_cnt; i++) { + STACK_WIND (frame, dht_revalidate_cbk, + conf->subvolumes[i], + conf->subvolumes[i]->fops->lookup, + loc, local->xattr_req); + } + return 0; + } + + call_cnt = local->call_cnt = layout->cnt; + /* need it for self-healing linkfiles which is 'in-migration' state */ ret = dict_set_uint32 (local->xattr_req, -- cgit