Thread (1 message) 1 message, 1 author, 2017-01-12

Re: [Regression] fstrim hangs on Hyper-V: caused by "block: improve handling of the magic discard payload"

From: Christoph Hellwig <hch@lst.de>
Date: 2017-01-12 18:18:37
Subsystem: scsi subsystem, the rest · Maintainers: "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

Possibly related (same subject, not in this thread)

Next try:  (I've also dropped most of the Cc list)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index c35b6de..2f358f7 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1018,7 +1018,10 @@ static int scsi_init_sgtable(struct request *req, struct scsi_data_buffer *sdb)
 	count = blk_rq_map_sg(req->q, req, sdb->table.sgl);
 	BUG_ON(count > sdb->table.nents);
 	sdb->table.nents = count;
-	sdb->length = blk_rq_bytes(req);
+	if (req->rq_flags & RQF_SPECIAL_PAYLOAD)
+		sdb->length = req->special_vec.bv_len;
+	else
+		sdb->length = blk_rq_bytes(req);
 	return BLKPREP_OK;
 }
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help