• Nicholas Bellinger's avatar
    iscsi-target: Fix mutex_trylock usage in iscsit_increment_maxcmdsn · 5e8e6b4b
    Nicholas Bellinger authored
    This patch fixes a >= v3.10 regression bug with mutex_trylock() usage
    within iscsit_increment_maxcmdsn(), that was originally added to allow
    for a special case where ->cmdsn_mutex was already held from the
    iscsit_execute_cmd() exception path for ib_isert.
    
    When !mutex_trylock() was occuring under contention during normal RX/TX
    process context codepaths, the bug was manifesting itself as the following
    protocol error:
    
      Received CmdSN: 0x000fcbb7 is greater than MaxCmdSN: 0x000fcbb6, protocol error.
      Received CmdSN: 0x000fcbb8 is greater than MaxCmdSN: 0x000fcbb6, protocol error.
    
    This patch simply avoids the direct ib_isert callback in lio_queue_status()
    for the special iscsi_execute_cmd() exception cases, that allows the problematic
    mutex_trylock() usage in iscsit_increment_maxcmdsn() to go away.
    Reported-by: default avatarMoussa Ba <moussaba@micron.com>
    Tested-by: default avatarMoussa Ba <moussaba@micron.com>
    Cc: <stable@vger.kernel.org> # v3.10+
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    5e8e6b4b
iscsi_target_configfs.c 56.3 KB