fnic: fix fnic_scsi_host_{start,end}_tag
authorChristoph Hellwig <hch@lst.de>
Sat, 10 Nov 2018 08:30:44 +0000 (09:30 +0100)
committerJens Axboe <axboe@kernel.dk>
Sat, 10 Nov 2018 15:03:44 +0000 (08:03 -0700)
The way these functions abuse ->special to try to store the dummy
request looks completely broken, given that it actually stores the
original scsi command.

Instead switch to ->host_scribble and store the actual dummy command.

Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/scsi/fnic/fnic_scsi.c

index 96acfcecd540d8f9d9dbba0f063823123954a9b7..cafbcfb85bfa64e3f4440d4e0fec05c8d4d4e5a5 100644 (file)
@@ -2274,7 +2274,7 @@ fnic_scsi_host_start_tag(struct fnic *fnic, struct scsi_cmnd *sc)
                return SCSI_NO_TAG;
 
        sc->tag = sc->request->tag = dummy->tag;
-       sc->request->special = sc;
+       sc->host_scribble = (unsigned char *)dummy;
 
        return dummy->tag;
 }
@@ -2286,7 +2286,7 @@ fnic_scsi_host_start_tag(struct fnic *fnic, struct scsi_cmnd *sc)
 static inline void
 fnic_scsi_host_end_tag(struct fnic *fnic, struct scsi_cmnd *sc)
 {
-       struct request *dummy = sc->request->special;
+       struct request *dummy = (struct request *)sc->host_scribble;
 
        blk_mq_free_request(dummy);
 }