From ceaa61bef43749f9ae8290a1fbe630aab9ed5943 Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Tue, 11 Nov 2014 18:45:01 +0100 Subject: ec: Fix return errors when not enough bricks Changes introduced by this patch: * Fix an incorrect error propagation when the state of the life cycle of a fop returns an error. * Fix incorrect unlocking of failed locks. * Return ENOTCONN if there aren't enough bricks online. * In readdir(p) check that the fd has been successfully open by a previous opendir. This is a backport of http://review.gluster.org/9098/ Change-Id: Ib44f25a1297849ebcbab839332f3b6359f275ebe BUG: 1161066 Signed-off-by: Xavier Hernandez Reviewed-on: http://review.gluster.org/9107 Tested-by: Gluster Build System Reviewed-by: Dan Lambright Reviewed-by: Raghavendra Bhat Tested-by: Raghavendra Bhat --- xlators/cluster/ec/src/ec-inode-read.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/cluster/ec/src/ec-inode-read.c') diff --git a/xlators/cluster/ec/src/ec-inode-read.c b/xlators/cluster/ec/src/ec-inode-read.c index 88e9661743d..3f7920239ec 100644 --- a/xlators/cluster/ec/src/ec-inode-read.c +++ b/xlators/cluster/ec/src/ec-inode-read.c @@ -72,6 +72,7 @@ int32_t ec_manager_access(ec_fop_data_t * fop, int32_t state) return EC_STATE_REPORT; + case -EC_STATE_INIT: case -EC_STATE_REPORT: if (fop->cbks.access != NULL) { @@ -310,6 +311,7 @@ int32_t ec_manager_getxattr(ec_fop_data_t * fop, int32_t state) return EC_STATE_LOCK_REUSE; + case -EC_STATE_INIT: case -EC_STATE_LOCK: case -EC_STATE_DISPATCH: case -EC_STATE_PREPARE_ANSWER: @@ -732,6 +734,7 @@ int32_t ec_manager_open(ec_fop_data_t * fop, int32_t state) return EC_STATE_END; + case -EC_STATE_INIT: case -EC_STATE_DISPATCH: case -EC_STATE_PREPARE_ANSWER: case -EC_STATE_REPORT: @@ -897,6 +900,7 @@ int32_t ec_manager_readlink(ec_fop_data_t * fop, int32_t state) return EC_STATE_REPORT; + case -EC_STATE_INIT: case -EC_STATE_REPORT: if (fop->cbks.readlink != NULL) { @@ -1284,6 +1288,7 @@ int32_t ec_manager_readv(ec_fop_data_t * fop, int32_t state) return EC_STATE_LOCK_REUSE; + case -EC_STATE_INIT: case -EC_STATE_LOCK: case -EC_STATE_GET_SIZE_AND_VERSION: case -EC_STATE_DISPATCH: @@ -1546,6 +1551,7 @@ int32_t ec_manager_stat(ec_fop_data_t * fop, int32_t state) return EC_STATE_LOCK_REUSE; + case -EC_STATE_INIT: case -EC_STATE_LOCK: case -EC_STATE_GET_SIZE_AND_VERSION: case -EC_STATE_DISPATCH: -- cgit