Commit:     35a7f2f698d309cc50d98e56312dd907427b7ba4
Parent:     3eb7a51a3ae0ed0227e051ecf75199fccbb4cc73
Author:     Darrick J. Wong <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 30 01:18:38 2007 -0800
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 11:15:05 2007 -0500

    [SCSI] sas_ata: sas_ata_qc_issue should return AC_ERR_*
    The sas_ata_qc_issue function was incorrectly written to return error
    codes such as -ENOMEM.  Since libata OR's qc->err_mask with the
    return value, It is necessary to make my code return one of the
    AC_ERR_ codes instead.  For now, use AC_ERR_SYSTEM because an error
    here means that the OS couldn't send the command to the controller.
    If anybody has a suggestion for a better AC_ERR_ code to use, please
    suggest it.
    Signed-off-by: Darrick J. Wong <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
 drivers/scsi/libsas/sas_ata.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index 0bb1a14..46e1dbe 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -123,7 +123,7 @@ static void sas_ata_task_done(struct sas_task *task)
 static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
-       int res = -ENOMEM;
+       int res;
        struct sas_task *task;
        struct domain_device *dev = qc->ap->private_data;
        struct sas_ha_struct *sas_ha = dev->port->ha;
@@ -135,7 +135,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd 
        task = sas_alloc_task(GFP_ATOMIC);
        if (!task)
-               goto out;
+               return AC_ERR_SYSTEM;
        task->dev = dev;
        task->task_proto = SAS_PROTOCOL_STP;
        task->task_done = sas_ata_task_done;
@@ -187,12 +187,10 @@ static unsigned int sas_ata_qc_issue(struct 
ata_queued_cmd *qc)
                SAS_DPRINTK("lldd_execute_task returned: %d\n", res);
-               if (res == -SAS_QUEUE_FULL)
-                       return -ENOMEM;
+               return AC_ERR_SYSTEM;
-       return res;
+       return 0;
 static u8 sas_ata_check_status(struct ata_port *ap)
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to