[PATCH 08/15] 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 <djwong@xxxxxxxxxx>
---

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 32f2b66..a33ef6d 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

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

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;
@@ -186,12 +186,10 @@ static unsigned int sas_ata_qc_issue(str
SAS_DPRINTK("lldd_execute_task returned: %d\n", res);

sas_free_task(task);
- if (res == -SAS_QUEUE_FULL)
- return -ENOMEM;
+ return AC_ERR_SYSTEM;
}

-out:
- return res;
+ return 0;
}

static u8 sas_ata_check_status(struct ata_port *ap)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH 6/13] maps#2: Move the page walker code to lib/
    ... * a callback for every bottom-level (PTE) page table. ... struct zap_details *); ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH] Remove inclusions of
    ... 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ... struct device_attribute dev_attr; ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [PATCH 6/6] udf: fix sparse warnings (shadowing & mismatch between declaration and definitio
    ... which struct member something should be performed. ... #ifdef CONFIG_UDF_NLS ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: linux-2.4.33 released
    ... I have one suggestion for the 2.4 tree, next time a few changes is ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [RFC][PATCH 4/5] I/OAT DMA support and TCP acceleration
    ... Just put the DMA cookie object explicitly into struct sk_buff, ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... Prev by Date: ...
    (Linux-Kernel)