Re: [dm-devel] [PATCH 15/16] block: split scsi_request out of struct request

2017-01-26 Thread Jens Axboe
On 01/26/2017 12:37 PM, Christoph Hellwig wrote: > On Thu, Jan 26, 2017 at 11:12:51AM -0800, Bart Van Assche wrote: >> Where does the '* 3' come from? I think that deserves a comment. >> Additionally, this patch introduces a new warning when building with W=1: > > It's a magic factor copied from t

Re: [dm-devel] [PATCH 15/16] block: split scsi_request out of struct request

2017-01-26 Thread Christoph Hellwig
On Thu, Jan 26, 2017 at 11:12:51AM -0800, Bart Van Assche wrote: > Where does the '* 3' come from? I think that deserves a comment. > Additionally, this patch introduces a new warning when building with W=1: It's a magic factor copied from the old code :( That beeing said I really wonder if we sh

Re: [dm-devel] [PATCH 15/16] block: split scsi_request out of struct request

2017-01-26 Thread Bart Van Assche
On 01/23/2017 07:29 AM, Christoph Hellwig wrote: > +int scsi_cmd_buf_len(struct request *rq) > +{ > + return scsi_req(rq)->cmd_len * 3; > +} > +EXPORT_SYMBOL(scsi_cmd_buf_len); Hello Christoph, Where does the '* 3' come from? I think that deserves a comment. Additionally, this patch introduce

Re: [dm-devel] [PATCH 15/16] block: split scsi_request out of struct request

2017-01-24 Thread Bart Van Assche
On Tue, 2017-01-24 at 09:09 +0100, h...@lst.de wrote: > On Tue, Jan 24, 2017 at 12:33:13AM +, Bart Van Assche wrote: > > Do we perhaps need a check before the above memcpy() call whether or not > > sense == NULL? > > Yes, probably. I didn't think of the case where the caller wouldn't > pass a

Re: [dm-devel] [PATCH 15/16] block: split scsi_request out of struct request

2017-01-24 Thread Hannes Reinecke
On 01/23/2017 04:29 PM, Christoph Hellwig wrote: > And require all drivers that want to support BLOCK_PC to allocate it > as the first thing of their private data. To support this the legacy > IDE and BSG code is switched to set cmd_size on their queues to let > the block layer allocate the additi

Re: [dm-devel] [PATCH 15/16] block: split scsi_request out of struct request

2017-01-24 Thread h...@lst.de
On Tue, Jan 24, 2017 at 12:33:13AM +, Bart Van Assche wrote: > Do we perhaps need a check before the above memcpy() call whether or not > sense == NULL? Yes, probably. I didn't think of the case where the caller wouldn't pass a sense buffer. Just curious, what's the callstack that caused thi

Re: [dm-devel] [PATCH 15/16] block: split scsi_request out of struct request

2017-01-23 Thread Bart Van Assche
On Mon, 2017-01-23 at 16:29 +0100, Christoph Hellwig wrote: > @@ -251,11 +251,13 @@ static int __scsi_execute(struct scsi_device *sdev, > const unsigned char *cmd, > * is invalid.  Prevent the garbage from being misinterpreted > * and prevent security leaks by zeroing out the exc

[dm-devel] [PATCH 15/16] block: split scsi_request out of struct request

2017-01-23 Thread Christoph Hellwig
And require all drivers that want to support BLOCK_PC to allocate it as the first thing of their private data. To support this the legacy IDE and BSG code is switched to set cmd_size on their queues to let the block layer allocate the additional space. Signed-off-by: Christoph Hellwig --- block