public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Hannes Reinecke <hare@suse.com>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: Re: [PATCH v2 09/12] Make scsi_mq_prep_fn() call scsi_init_command()
Date: Fri, 2 Jun 2017 09:22:27 +0200	[thread overview]
Message-ID: <20170602072227.GH560@lst.de> (raw)
In-Reply-To: <20170601232711.29062-10-bart.vanassche@sandisk.com>

I like this idea, but..

> -void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd)
> +void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd,
> +		       struct scsi_data_buffer *prot_sdb)
>  {
>  	void *buf = cmd->sense_buffer;
> -	void *prot = cmd->prot_sdb;
>  	unsigned int unchecked_isa_dma = cmd->flags & SCMD_UNCHECKED_ISA_DMA;
>  
>  	/* zero out the cmd, except for the embedded scsi_request */
> @@ -1164,7 +1164,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd)
>  
>  	cmd->device = dev;
>  	cmd->sense_buffer = buf;
> -	cmd->prot_sdb = prot;
> +	cmd->prot_sdb = prot_sdb;

What would be the problem of always preserving the original prot_sdb
value instead of passing it by argument?  You;d just need to initialize
it in scsi_init_request when the command is allocated.

  reply	other threads:[~2017-06-02  7:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-01 23:26 [PATCH v2 00/12] SCSI patches for kernel v4.13 Bart Van Assche
2017-06-01 23:27 ` [PATCH v2 01/12] Avoid that scsi_exit_rq() triggers a use-after-free Bart Van Assche
2017-06-02  7:16   ` Christoph Hellwig
2017-06-01 23:27 ` [PATCH v2 02/12] Split scsi_internal_device_block() Bart Van Assche
2017-06-02  7:16   ` Christoph Hellwig
2017-06-01 23:27 ` [PATCH v2 03/12] Create two versions of scsi_internal_device_unblock() Bart Van Assche
2017-06-02  7:16   ` Christoph Hellwig
2017-06-01 23:27 ` [PATCH v2 04/12] Protect SCSI device state changes with a mutex Bart Van Assche
2017-06-02  7:17   ` Christoph Hellwig
2017-06-01 23:27 ` [PATCH v2 05/12] Introduce scsi_start_queue() Bart Van Assche
2017-06-02  7:17   ` Christoph Hellwig
2017-06-01 23:27 ` [PATCH v2 06/12] Make __scsi_remove_device go straight from BLOCKED to DEL Bart Van Assche
2017-06-02  7:18   ` Christoph Hellwig
2017-06-02 20:58     ` Bart Van Assche
2017-06-01 23:27 ` [PATCH v2 07/12] Only add commands to the device command list if required by the LLD Bart Van Assche
2017-06-01 23:27 ` [PATCH v2 08/12] Introduce scsi_mq_sgl_size() Bart Van Assche
2017-06-02  7:18   ` Christoph Hellwig
2017-06-01 23:27 ` [PATCH v2 09/12] Make scsi_mq_prep_fn() call scsi_init_command() Bart Van Assche
2017-06-02  7:22   ` Christoph Hellwig [this message]
2017-06-02 17:49     ` Bart Van Assche
2017-06-01 23:27 ` [PATCH v2 10/12] snic: Remove code that zeroes driver-private command data Bart Van Assche
2017-06-02  7:22   ` Christoph Hellwig
2017-06-01 23:27 ` [PATCH v2 11/12] virtio: " Bart Van Assche
2017-06-02  7:23   ` Christoph Hellwig
2017-06-02 21:01     ` Bart Van Assche
2017-06-01 23:27 ` [PATCH v2 12/12] xen/scsifront: " Bart Van Assche
2017-06-02  7:23   ` Christoph Hellwig
2017-06-02 21:08 ` [PATCH v2 00/12] SCSI patches for kernel v4.13 Martin K. Petersen
2017-06-02 21:10   ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170602072227.GH560@lst.de \
    --to=hch@lst.de \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=bart.vanassche@sandisk.com \
    --cc=hare@suse.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox