]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.drivers/mpt-return-all-sense-data
Fix oinkmaster patch.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / mpt-return-all-sense-data
CommitLineData
2cb7cef9
BS
1From: Mike Reed <mdr@sgi.com>
2Subject: MPT Fusion doesn't return all sense data
3References: bnc#466179
4
5This patch removes an inappropriate sizeof() test which truncated the amount of
6sense data returned to the size of a pointer.
7
8Signed-off-by: Mike Reed <mdr@sgi.com>
9Signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
10Signed-off-by: Hannes Reinecke <hare@suse.de>
11
12--- a/drivers/message/fusion/mptscsih.c 2009-01-08 12:46:11.000000000 -0600
13+++ b/drivers/message/fusion/mptscsih.c 2009-01-13 13:33:16.239522030 -0600
14@@ -112,8 +112,6 @@ int mptscsih_suspend(struct pci_dev *p
15 int mptscsih_resume(struct pci_dev *pdev);
16 #endif
17
18-#define SNS_LEN(scp) sizeof((scp)->sense_buffer)
19-
20 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
21 /**
22 * mptscsih_getFreeChainBuffer - Function to get a free chain
23@@ -2594,7 +2592,11 @@ mptscsih_copy_sense_data(struct scsi_cmn
24 /* Copy the sense received into the scsi command block. */
25 req_index = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
26 sense_data = ((u8 *)ioc->sense_buf_pool + (req_index * MPT_SENSE_BUFFER_ALLOC));
27- memcpy(sc->sense_buffer, sense_data, SNS_LEN(sc));
28+
29+ if (sense_count > SCSI_SENSE_BUFFERSIZE)
30+ sense_count = SCSI_SENSE_BUFFERSIZE;
31+
32+ memcpy(sc->sense_buffer, sense_data, sense_count);
33
34 /* Log SMART data (asc = 0x5D, non-IM case only) if required.
35 */