From f836ef39fba1d6884aac9ff37479cbaac6a400b4 Mon Sep 17 00:00:00 2001 From: wang di Date: Wed, 8 Jul 2015 20:11:53 -0700 Subject: [PATCH] LU-6837 update: re-lookup the dtrq in the replay list. In insert_update_records_to_replay_list(), if the dtrq request has been added to the list by another thread, it should lookup the request in the list again, otherwise it will cause the following sub req lookup panic, because the current dtrq was just freed. Signed-off-by: wang di Change-Id: I766cddbe5abcd96e97a611985032208585573b43 Reviewed-on: http://review.whamcloud.com/15573 Tested-by: Jenkins Reviewed-by: Niu Yawei Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/target/update_recovery.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lustre/target/update_recovery.c b/lustre/target/update_recovery.c index cad0183..3ec884d 100644 --- a/lustre/target/update_recovery.c +++ b/lustre/target/update_recovery.c @@ -368,6 +368,7 @@ insert_update_records_to_replay_list(struct target_distribute_txn_data *tdtd, " mdt_index %u\n", tdtd->tdtd_lut->lut_obd->obd_name, record->ur_batchid, record->ur_master_transno, mdt_index); +again: /* First try to build the replay update request with the records */ spin_lock(&tdtd->tdtd_replay_list_lock); dtrq = dtrq_lookup(tdtd, record->ur_batchid); @@ -391,7 +392,7 @@ insert_update_records_to_replay_list(struct target_distribute_txn_data *tdtd, if (rc == -EEXIST) { /* Some one else already add the record */ dtrq_destroy(dtrq); - rc = 0; + goto again; } } else { struct update_records *dtrq_rec; -- 1.8.3.1