From b59ce01eadad2199873d3c9bcbeb9bc7b41780e9 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 1 May 2015 23:49:20 +0000 Subject: [PATCH] Decrease time cpu_cmd_counter is held taken for suspending case for debug mode to minimize race window described in http://sourceforge.net/p/scst/mailman/message/34074831/ git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6193 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 90a85a6d3..6f97d960a 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -4461,8 +4461,8 @@ static int scst_translate_lun(struct scst_cmd *cmd) scst_put(cmd->cpu_cmd_counter); } } else { - TRACE_MGMT_DBG("%s", "FLAG SUSPENDED set, skipping"); scst_put(cmd->cpu_cmd_counter); + TRACE_MGMT_DBG("%s", "FLAG SUSPENDED set, skipping"); res = 1; } @@ -5044,8 +5044,8 @@ static int scst_get_mgmt(struct scst_mgmt_cmd *mcmd) if (unlikely(test_bit(SCST_FLAG_SUSPENDED, &scst_flags) && !test_bit(SCST_FLAG_SUSPENDING, &scst_flags))) { - TRACE_MGMT_DBG("%s", "FLAG SUSPENDED set, skipping"); scst_put(mcmd->cpu_cmd_counter); + TRACE_MGMT_DBG("%s", "FLAG SUSPENDED set, skipping"); res = 1; goto out; }