Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-06 Thread Keith Busch
On Mon, Nov 06, 2017 at 10:13:24AM +0100, Christoph Hellwig wrote: > On Sat, Nov 04, 2017 at 09:38:45AM -0600, Keith Busch wrote: > > That's not quite right. For non-PI metadata formats, we use the > > 'nop_profile', which gets the metadata buffer allocated so we can safely > > use a metadata

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-06 Thread Keith Busch
On Mon, Nov 06, 2017 at 10:13:24AM +0100, Christoph Hellwig wrote: > On Sat, Nov 04, 2017 at 09:38:45AM -0600, Keith Busch wrote: > > That's not quite right. For non-PI metadata formats, we use the > > 'nop_profile', which gets the metadata buffer allocated so we can safely > > use a metadata

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-06 Thread Christoph Hellwig
On Sat, Nov 04, 2017 at 09:38:45AM -0600, Keith Busch wrote: > That's not quite right. For non-PI metadata formats, we use the > 'nop_profile', which gets the metadata buffer allocated so we can safely > use a metadata formatted namespace. There's no in-kernel user of the > allocated payload, but

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-06 Thread Christoph Hellwig
On Sat, Nov 04, 2017 at 09:38:45AM -0600, Keith Busch wrote: > That's not quite right. For non-PI metadata formats, we use the > 'nop_profile', which gets the metadata buffer allocated so we can safely > use a metadata formatted namespace. There's no in-kernel user of the > allocated payload, but

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-04 Thread Keith Busch
On Sat, Nov 04, 2017 at 09:18:25AM +0100, Christoph Hellwig wrote: > On Fri, Nov 03, 2017 at 09:02:04AM -0600, Keith Busch wrote: > > If the namespace has metadata, but the request doesn't have a metadata > > payload attached to it for whatever reason, we can't construct the command > > for that

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-04 Thread Keith Busch
On Sat, Nov 04, 2017 at 09:18:25AM +0100, Christoph Hellwig wrote: > On Fri, Nov 03, 2017 at 09:02:04AM -0600, Keith Busch wrote: > > If the namespace has metadata, but the request doesn't have a metadata > > payload attached to it for whatever reason, we can't construct the command > > for that

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-04 Thread Christoph Hellwig
On Fri, Nov 03, 2017 at 09:02:04AM -0600, Keith Busch wrote: > If the namespace has metadata, but the request doesn't have a metadata > payload attached to it for whatever reason, we can't construct the command > for that format. We also can't have the controller strip/generate the > payload with

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-04 Thread Christoph Hellwig
On Fri, Nov 03, 2017 at 09:02:04AM -0600, Keith Busch wrote: > If the namespace has metadata, but the request doesn't have a metadata > payload attached to it for whatever reason, we can't construct the command > for that format. We also can't have the controller strip/generate the > payload with

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Keith Busch
On Fri, Nov 03, 2017 at 01:53:40PM +0100, Christoph Hellwig wrote: > > - if (ns && ns->ms && > > + if (ns->ms && > > (!ns->pi_type || ns->ms != sizeof(struct t10_pi_tuple)) && > > !blk_integrity_rq(req) && !blk_rq_is_passthrough(req)) > > return BLK_STS_NOTSUPP; >

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Keith Busch
On Fri, Nov 03, 2017 at 01:53:40PM +0100, Christoph Hellwig wrote: > > - if (ns && ns->ms && > > + if (ns->ms && > > (!ns->pi_type || ns->ms != sizeof(struct t10_pi_tuple)) && > > !blk_integrity_rq(req) && !blk_rq_is_passthrough(req)) > > return BLK_STS_NOTSUPP; >

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Javier González
> On 3 Nov 2017, at 13.53, Christoph Hellwig wrote: > >> -if (ns && ns->ms && >> +if (ns->ms && >> (!ns->pi_type || ns->ms != sizeof(struct t10_pi_tuple)) && >> !blk_integrity_rq(req) && !blk_rq_is_passthrough(req)) >> return BLK_STS_NOTSUPP; >

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Javier González
> On 3 Nov 2017, at 13.53, Christoph Hellwig wrote: > >> -if (ns && ns->ms && >> +if (ns->ms && >> (!ns->pi_type || ns->ms != sizeof(struct t10_pi_tuple)) && >> !blk_integrity_rq(req) && !blk_rq_is_passthrough(req)) >> return BLK_STS_NOTSUPP; > >

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Christoph Hellwig
> - if (ns && ns->ms && > + if (ns->ms && > (!ns->pi_type || ns->ms != sizeof(struct t10_pi_tuple)) && > !blk_integrity_rq(req) && !blk_rq_is_passthrough(req)) > return BLK_STS_NOTSUPP; blk_rq_is_passthrough also can't be true here. How about:

Re: [PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Christoph Hellwig
> - if (ns && ns->ms && > + if (ns->ms && > (!ns->pi_type || ns->ms != sizeof(struct t10_pi_tuple)) && > !blk_integrity_rq(req) && !blk_rq_is_passthrough(req)) > return BLK_STS_NOTSUPP; blk_rq_is_passthrough also can't be true here. How about:

[PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Javier González
On the rw path, the ns is assumed to be set. However, a check is still done, inherited from the time the code resided at nvme_queue_rq(). Eliminate this check, which also eliminates a smatch complain for not doing proper NULL checks on ns. Signed-off-by: Javier González ---

[PATCH 1/3] nvme: do not check for ns on rw path

2017-11-03 Thread Javier González
On the rw path, the ns is assumed to be set. However, a check is still done, inherited from the time the code resided at nvme_queue_rq(). Eliminate this check, which also eliminates a smatch complain for not doing proper NULL checks on ns. Signed-off-by: Javier González ---