This is a note to let you know that I've just added the patch titled

    mpt2sas: fix the incorrect scsi_dma_map error checking

to the 2.6.32-longterm tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.32.git;a=summary

The filename of the patch is:
     mpt2sas-fix-the-incorrect-scsi_dma_map-error-checkin.patch
and it can be found in the queue-2.6.32 subdirectory.

If you, or anyone else, feels it should not be added to the 2.6.32 longterm 
tree,
please let <[email protected]> know about it.


>From 27e43b26bac11e1beb804b84a2418b01e32b0bb8 Mon Sep 17 00:00:00 2001
From: FUJITA Tomonori <[email protected]>
Date: Tue, 9 Mar 2010 11:09:50 +0900
Subject: mpt2sas: fix the incorrect scsi_dma_map error checking

From: FUJITA Tomonori <[email protected]>

commit bb789d01620e5d36081b22edb6fb71cf55ff043c upstream.

scsi_dma_map() returns -1 if an error occurred (zero means that the
command has no data). So the following current code can't catch an
error:

sges_left = scsi_dma_map(scmd);
if (!sges_left) {
        sdev_printk(KERN_ERR, scmd->device, "pci_map_sg"
        " failed: request for %d bytes!\n", scsi_bufflen(scmd));
        return -ENOMEM;
}

Signed-off-by: FUJITA Tomonori <[email protected]>
Acked-by: "Desai, Kashyap" <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -945,7 +945,7 @@ _scsih_build_scatter_gather(struct MPT2S
        u32 chain_offset;
        u32 chain_length;
        u32 chain_flags;
-       u32 sges_left;
+       int sges_left;
        u32 sges_in_segment;
        u32 sgl_flags;
        u32 sgl_flags_last_element;
@@ -966,7 +966,7 @@ _scsih_build_scatter_gather(struct MPT2S
 
        sg_scmd = scsi_sglist(scmd);
        sges_left = scsi_dma_map(scmd);
-       if (!sges_left) {
+       if (sges_left < 0) {
                sdev_printk(KERN_ERR, scmd->device, "pci_map_sg"
                " failed: request for %d bytes!\n", scsi_bufflen(scmd));
                return -ENOMEM;


Patches currently in longterm-queue-2.6.32 which might be from 
[email protected] are

/home/gregkh/linux/longterm/longterm-queue-2.6.32/queue-2.6.32/mpt2sas-fix-the-incorrect-scsi_dma_map-error-checkin.patch

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to