SCSI: libsas: fix taskfile corruption in sas_ata_qc_fill_rtf
authorDan Williams <dan.j.williams@intel.com>
Fri, 22 Jun 2012 17:52:34 +0000 (10:52 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2012 16:04:37 +0000 (09:04 -0700)
commit76c6b958de9e72947ef08b1c9509f094c34abd8f
tree2d6c6f2f668b3a846cb25904e7845e576e1486f2
parent5a89aae8085ef69a2ea9034ff8f5624327cd4efc
SCSI: libsas: fix taskfile corruption in sas_ata_qc_fill_rtf

commit 6ef1b512f4e6f936d89aa20be3d97a7ec7c290ac upstream.

fill_result_tf() grabs the taskfile flags from the originating qc which
sas_ata_qc_fill_rtf() promptly overwrites.  The presence of an
ata_taskfile in the sata_device makes it tempting to just copy the full
contents in sas_ata_qc_fill_rtf().  However, libata really only wants
the fis contents and expects the other portions of the taskfile to not
be touched by ->qc_fill_rtf.  To that end store a fis buffer in the
sata_device and use ata_tf_from_fis() like every other ->qc_fill_rtf()
implementation.

Reported-by: Praveen Murali <pmurali@logicube.com>
Tested-by: Praveen Murali <pmurali@logicube.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/aic94xx/aic94xx_task.c
drivers/scsi/libsas/sas_ata.c
include/scsi/libsas.h