diff --git a/scst/src/scst_copy_mgr.c b/scst/src/scst_copy_mgr.c index f367da21f..825cd8698 100644 --- a/scst/src/scst_copy_mgr.c +++ b/scst/src/scst_copy_mgr.c @@ -2530,6 +2530,7 @@ static unsigned int scst_cm_get_lun(const struct scst_device *dev) for (i = 0; i < SESS_TGT_DEV_LIST_HASH_SIZE; i++) { struct list_head *head = &scst_cm_sess->sess_tgt_dev_list[i]; struct scst_tgt_dev *tgt_dev; + list_for_each_entry(tgt_dev, head, sess_tgt_dev_list_entry) { if (tgt_dev->dev == dev) { res = tgt_dev->lun; diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index cb1d06939..d3e46430c 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -1919,6 +1919,7 @@ static void scst_process_redirect_cmd(struct scst_cmd *cmd, case SCST_CONTEXT_THREAD: { struct list_head *active_cmd_list; + if (cmd->cmd_thr != NULL) { TRACE_DBG("Using assigned thread %p for cmd %p", cmd->cmd_thr, cmd); @@ -5500,6 +5501,7 @@ int scst_cmd_thread(void *arg) while (!kthread_should_stop()) { if (!test_cmd_threads(thr)) { DEFINE_WAIT(wait); + do { prepare_to_wait_exclusive_head( &p_cmd_threads->cmd_list_waitQ,