summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/ec/src/ec-data.c
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2015-10-28 14:00:41 +0100
committerJeff Darcy <jdarcy@redhat.com>2015-11-05 04:37:17 -0800
commit80c046f10207ab3f039210683d3931a2615861f1 (patch)
treeed76a5bb2fd160838f843d1da656b46003274fb2 /xlators/cluster/ec/src/ec-data.c
parent1918d618a91fe9d9021916d53091173f4ad6b882 (diff)
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 <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/12445 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/cluster/ec/src/ec-data.c')
-rw-r--r--xlators/cluster/ec/src/ec-data.c3
1 files changed, 2 insertions, 1 deletions
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;