From 6b93cb0155d566bf8dac2398523218ee22734355 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 18 Dec 2012 09:33:24 +0000 Subject: [PATCH] scst: Make extra_tgt_dev_list_entry users hold scst_mutex (merge r4386 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4649 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 2 +- scst/src/scst_targ.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index f26ca4b54..d31220dc0 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2482,7 +2482,7 @@ struct scst_tgt_dev { /* List entry in dev->dev_tgt_dev_list */ struct list_head dev_tgt_dev_list_entry; - /* Internal tmp list entry */ + /* Internal tmp list entry. User must hold scst_mutex. */ struct list_head extra_tgt_dev_list_entry; /* Set if INQUIRY DATA HAS CHANGED UA is needed */ diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 5852ea60e..671c95ac4 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -5149,8 +5149,6 @@ static int scst_clear_task_set(struct scst_mgmt_cmd *mcmd) scst_unblock_aborted_cmds(1); - mutex_unlock(&scst_mutex); - if (!dev->tas) { uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN]; int sl; @@ -5165,6 +5163,8 @@ static int scst_clear_task_set(struct scst_mgmt_cmd *mcmd) } } + mutex_unlock(&scst_mutex); + scst_call_dev_task_mgmt_fn(mcmd, mcmd->mcmd_tgt_dev, 0); res = scst_set_mcmd_next_state(mcmd);