From b01660c5d7cf4a59a85a8edc3c816e4585aa211b Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Thu, 13 Nov 2014 13:55:36 +0100 Subject: ec: Avoid self-heal on directories on (f)stat calls To avoid inconsistent directory listings, a full self-heal cannot happen on a directory until all its contents have been healed. This is controlled by a manual command using getfattr recursively and in post-order. While navigating the directories, sometimes an (f)stat fop can be sent. This fop caused a full self-heal of the directory. This patch makes that (f)stat only initiates a partial self-heal. This is a backport of http://review.gluster.org/9117/ Change-Id: I0a92bda8f4f9e43c1acbceab2d7926944a8a4d9a BUG: 1159498 Signed-off-by: Xavier Hernandez Reviewed-on: http://review.gluster.org/9118 Tested-by: Gluster Build System Reviewed-by: Dan Lambright --- xlators/cluster/ec/src/ec-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xlators/cluster/ec/src/ec-common.c b/xlators/cluster/ec/src/ec-common.c index 2ba17305411..177b24bb010 100644 --- a/xlators/cluster/ec/src/ec-common.c +++ b/xlators/cluster/ec/src/ec-common.c @@ -146,7 +146,8 @@ void ec_check_status(ec_fop_data_t * fop) int32_t partial = 0; if (fop->answer->op_ret >= 0) { - if (fop->id == GF_FOP_LOOKUP) { + if ((fop->id == GF_FOP_LOOKUP) || + (fop->id == GF_FOP_STAT) || (fop->id == GF_FOP_FSTAT)) { partial = fop->answer->iatt[0].ia_type == IA_IFDIR; } else if (fop->id == GF_FOP_OPENDIR) { partial = 1; -- cgit