We don't need the t_state_lock lock in compare_and_write_post while checking the scsi_status because we have just set it before calling the callback and there is no chance for races with other accesses. This patch removes it so in the next patch we can hold the lock when calling the callbacks. Signed-off-by: Mike Christie <michael.christie@xxxxxxxxxx> --- drivers/target/target_core_sbc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 7536ca797606..c1cf37a1b4ce 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -352,14 +352,12 @@ static sense_reason_t compare_and_write_post(struct se_cmd *cmd, bool success, struct se_device *dev = cmd->se_dev; sense_reason_t ret = TCM_NO_SENSE; - spin_lock_irq(&cmd->t_state_lock); if (success) { *post_ret = 1; if (cmd->scsi_status == SAM_STAT_CHECK_CONDITION) ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; } - spin_unlock_irq(&cmd->t_state_lock); /* * Unlock ->caw_sem originally obtained during sbc_compare_and_write() -- 2.25.1