From 7fe574039815ad1339851eb0dc9f2366b02ceddf Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Tue, 15 Jul 2014 13:42:28 +0200 Subject: ec: Only heal data/metadata when inode has enough information Sometimes loc_t structure in a heal request doesn't contain enough information to do an inodelk call (basically the gfid is missing). In these cases, self heal only recovers entry information. This is a backport of http://review.gluster.org/8368/ Change-Id: I459990c7df728ff4baf164df046672ddcde3efa5 BUG: 1140626 Signed-off-by: Xavier Hernandez Reviewed-on: http://review.gluster.org/8747 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy Reviewed-by: Dan Lambright --- xlators/cluster/ec/src/ec-heal.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators') diff --git a/xlators/cluster/ec/src/ec-heal.c b/xlators/cluster/ec/src/ec-heal.c index f6ee0076373..107ff5ffe3d 100644 --- a/xlators/cluster/ec/src/ec-heal.c +++ b/xlators/cluster/ec/src/ec-heal.c @@ -1183,6 +1183,14 @@ int32_t ec_manager_heal(ec_fop_data_t * fop, int32_t state) return EC_STATE_HEAL_PRE_INODELK_LOCK; case EC_STATE_HEAL_PRE_INODELK_LOCK: + // Only heal data/metadata if enough information is supplied. + if (uuid_is_null(heal->loc.gfid)) + { + ec_heal_entrylk(heal, ENTRYLK_UNLOCK); + + return EC_STATE_HEAL_DISPATCH; + } + ec_heal_inodelk(heal, F_WRLCK, 0, 0, 0); return EC_STATE_HEAL_PRE_INODE_LOOKUP; -- cgit