From 80c046f10207ab3f039210683d3931a2615861f1 Mon Sep 17 00:00:00 2001 From: Xavier Hernandez Date: Wed, 28 Oct 2015 14:00:41 +0100 Subject: cluster/ec: Fix bad management of lock owners Since the addition of parallel reads patch for ec, a lock can have more than one owner at the same time. The list of owners was stored inside the 'owner_list' field of each fop. The problem was with fops that required more than one lock (like rename). In this case the same field was used to add the fop to more than one list, casing an overwrite of the previous list. This has been solved moving the 'owner_list' field from ec_fop_data_t to ec_lock_link_t structure. Change-Id: I6042129f09082497b80782b5704a52c35c78f44d BUG: 1276031 Signed-off-by: Xavier Hernandez Reviewed-on: http://review.gluster.org/12445 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/cluster/ec/src/ec-data.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/ec/src/ec-data.c') diff --git a/xlators/cluster/ec/src/ec-data.c b/xlators/cluster/ec/src/ec-data.c index 721b104245f..ba47eebda3a 100644 --- a/xlators/cluster/ec/src/ec-data.c +++ b/xlators/cluster/ec/src/ec-data.c @@ -135,12 +135,13 @@ ec_fop_data_t * ec_fop_data_allocate(call_frame_t * frame, xlator_t * this, return NULL; } - INIT_LIST_HEAD(&fop->owner_list); INIT_LIST_HEAD(&fop->cbk_list); INIT_LIST_HEAD(&fop->healer); INIT_LIST_HEAD(&fop->answer_list); INIT_LIST_HEAD(&fop->pending_list); + INIT_LIST_HEAD(&fop->locks[0].owner_list); INIT_LIST_HEAD(&fop->locks[0].wait_list); + INIT_LIST_HEAD(&fop->locks[1].owner_list); INIT_LIST_HEAD(&fop->locks[1].wait_list); fop->xl = this; -- cgit