* [PATCH] return valid data buffer length in scsi_bufflen() API using RQF_SPECIAL_PAYLOAD
@ 2017-02-13 11:55 Kashyap Desai
2017-02-13 13:36 ` Christoph Hellwig
0 siblings, 1 reply; 2+ messages in thread
From: Kashyap Desai @ 2017-02-13 11:55 UTC (permalink / raw)
To: linux-scsi, hch, Jens Axboe
Regression due to commit f9d03f96b988002027d4b28ea1b7a24729a4c9b5
block: improve handling of the magic discard payload
<megaraid_sas> and <mpt3sas> HBA FW encounter FW fault in DMA operation
while creating File system on SSDs.
Below CDB cause FW fault.
CDB: Write same(16) 93 08 00 00 00 00 00 00 00 00 00 00 80 00 00 00
Root cause is SCSI buffer length and DMA buffer length miss match for
WRITE SAME command.
Fix - return valid data buffer length in scsi_bufflen() API using
RQF_SPECIAL_PAYLOAD
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
---
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index 9fc1aec..1f796fc 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -180,7 +180,8 @@ static inline struct scatterlist *scsi_sglist(struct
scsi_cmnd *cmd)
static inline unsigned scsi_bufflen(struct scsi_cmnd *cmd)
{
- return cmd->sdb.length;
+ return (cmd->request->rq_flags & RQF_SPECIAL_PAYLOAD) ?
+ cmd->request->special_vec.bv_len :
cmd->sdb.length;
}
static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] return valid data buffer length in scsi_bufflen() API using RQF_SPECIAL_PAYLOAD
2017-02-13 11:55 [PATCH] return valid data buffer length in scsi_bufflen() API using RQF_SPECIAL_PAYLOAD Kashyap Desai
@ 2017-02-13 13:36 ` Christoph Hellwig
0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2017-02-13 13:36 UTC (permalink / raw)
To: Kashyap Desai; +Cc: linux-scsi, hch, Jens Axboe
Hi Kashyap,
can you try 4.10-rc8? It has "scsi: use blk_rq_payload_bytes" which
initializeѕ sdb->length to blk_rq_payload_bytes(), which should fix
your issue.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-13 13:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-13 11:55 [PATCH] return valid data buffer length in scsi_bufflen() API using RQF_SPECIAL_PAYLOAD Kashyap Desai
2017-02-13 13:36 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox