Re: [PATCH 1/6] fnic: fix fnic_scsi_host_{start,end}_tag

2018-11-10 Thread Hannes Reinecke
On 11/9/18 7:32 PM, Christoph Hellwig wrote:
> They 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.
> 
> Signed-off-by: Christoph Hellwig 
> ---
>  drivers/scsi/fnic/fnic_scsi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
> index 96acfcecd540..cafbcfb85bfa 100644
> --- a/drivers/scsi/fnic/fnic_scsi.c
> +++ b/drivers/scsi/fnic/fnic_scsi.c
> @@ -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);
>  }
> 
The entire device_reset for fnic should be redone; which reminds me to
redo my scsi-eh rework rebased.

But until then:

Reviewed-by: Hannes Reinecke 

Cheers,

Hannes
-- 
Dr. Hannes ReineckeTeamlead Storage & Networking
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)


[PATCH 1/6] fnic: fix fnic_scsi_host_{start,end}_tag

2018-11-10 Thread Christoph Hellwig
They 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.

Signed-off-by: Christoph Hellwig 
---
 drivers/scsi/fnic/fnic_scsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 96acfcecd540..cafbcfb85bfa 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -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);
 }
-- 
2.19.1



[PATCH 1/6] fnic: fix fnic_scsi_host_{start,end}_tag

2018-11-09 Thread Christoph Hellwig
They 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.

Signed-off-by: Christoph Hellwig 
---
 drivers/scsi/fnic/fnic_scsi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 96acfcecd540..cafbcfb85bfa 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -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);
 }
-- 
2.19.1