Re: [PATCHv2 1/3] target/user: Use sense_reason_t in tcmu_queue_cmd_ring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/05/2016 12:32 PM, Bryant G. Ly wrote:
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).

You're right. (I really hate how loose C is with types, grumble grumble)

Would you like to submit a patch that Nick can apply with a Signed-off-by and also correct whitespace, or would you like me to take it from here?

Acked-by: Andy Grover <agrover@xxxxxxxxxx>

Thanks -- Regards -- Andy

--
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



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux