On 8/25/16, 10:55 AM, "Andy Grover" <target-devel-owner@xxxxxxxxxxxxxxx on behalf of agrover@xxxxxxxxxx> wrote: > Instead of using -ERROR-style returns, use sense_reason_t. This lets us > remove tcmu_pass_op(), and return more correct sense values. > > Signed-off-by: Andy Grover <agrover@xxxxxxxxxx> <SNIP> > +static sense_reason_t > +tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd) > { > struct tcmu_dev *udev = tcmu_cmd->tcmu_dev; > struct se_cmd *se_cmd = tcmu_cmd->se_cmd; > @@ -405,7 +406,7 @@ static int tcmu_queue_cmd_ring(struct tcmu_cmd *tcmu_cmd) > DECLARE_BITMAP(old_bitmap, DATA_BLOCK_BITS); > > if (test_bit(TCMU_DEV_BIT_BROKEN, &udev->flags)) Since you changed everything to return static sense_reason_t, you might want to change: static sense_reason_t tcmu_queue_cmd(struct se_cmd *se_cmd) { struct se_device *se_dev = se_cmd->se_dev; struct tcmu_dev *udev = TCMU_DEV(se_dev); struct tcmu_cmd *tcmu_cmd; int ret; tcmu_cmd = tcmu_alloc_cmd(se_cmd); if (!tcmu_cmd) return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; ret = tcmu_queue_cmd_ring(tcmu_cmd); - if (ret < 0) { +if(ret != TCM_NO_SENSE) pr_err("TCMU: Could not queue command\n"); spin_lock_irq(&udev->commands_lock); idr_remove(&udev->commands, tcmu_cmd->cmd_id); spin_unlock_irq(&udev->commands_lock); kmem_cache_free(tcmu_cmd_cache, tcmu_cmd); } So instead of if (ret < 0) you have if(ret != TCM_NO_SENSE). -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html