Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Jens Axboe
On 08/26/2016 09:17 AM, Keith Busch wrote: On Fri, Aug 26, 2016 at 04:35:57PM +0200, Christoph Hellwig wrote: On Fri, Aug 26, 2016 at 07:31:33AM -0700, Andy Lutomirski wrote: - Consider *deleting* the SCSI translation layer's power saving code. It looks almost entirely bogus to me. It has an

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Jens Axboe
On 08/26/2016 09:17 AM, Keith Busch wrote: On Fri, Aug 26, 2016 at 04:35:57PM +0200, Christoph Hellwig wrote: On Fri, Aug 26, 2016 at 07:31:33AM -0700, Andy Lutomirski wrote: - Consider *deleting* the SCSI translation layer's power saving code. It looks almost entirely bogus to me. It has an

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Jens Axboe
On 08/26/2016 08:31 AM, Andy Lutomirski wrote: On Aug 25, 2016 4:20 PM, "Jens Axboe" wrote: On 08/25/2016 01:54 AM, Andy Lutomirski wrote: On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig wrote: Ooops, yes. Are you looking into new nvme_set_features users?

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Jens Axboe
On 08/26/2016 08:31 AM, Andy Lutomirski wrote: On Aug 25, 2016 4:20 PM, "Jens Axboe" wrote: On 08/25/2016 01:54 AM, Andy Lutomirski wrote: On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig wrote: Ooops, yes. Are you looking into new nvme_set_features users? Another thing we need to

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Keith Busch
On Fri, Aug 26, 2016 at 04:35:57PM +0200, Christoph Hellwig wrote: > On Fri, Aug 26, 2016 at 07:31:33AM -0700, Andy Lutomirski wrote: > > - Consider *deleting* the SCSI translation layer's power saving code. > > It looks almost entirely bogus to me. It has an off-by-one in its > > NPSS handling,

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Keith Busch
On Fri, Aug 26, 2016 at 04:35:57PM +0200, Christoph Hellwig wrote: > On Fri, Aug 26, 2016 at 07:31:33AM -0700, Andy Lutomirski wrote: > > - Consider *deleting* the SCSI translation layer's power saving code. > > It looks almost entirely bogus to me. It has an off-by-one in its > > NPSS handling,

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Christoph Hellwig
On Fri, Aug 26, 2016 at 07:31:33AM -0700, Andy Lutomirski wrote: > - Consider *deleting* the SCSI translation layer's power saving code. > It looks almost entirely bogus to me. It has an off-by-one in its > NPSS handling, it hardcodes power state indices which is total BS, it > ignores the

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Christoph Hellwig
On Fri, Aug 26, 2016 at 07:31:33AM -0700, Andy Lutomirski wrote: > - Consider *deleting* the SCSI translation layer's power saving code. > It looks almost entirely bogus to me. It has an off-by-one in its > NPSS handling, it hardcodes power state indices which is total BS, it > ignores the

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Andy Lutomirski
On Aug 25, 2016 4:20 PM, "Jens Axboe" wrote: > > On 08/25/2016 01:54 AM, Andy Lutomirski wrote: >> >> On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig wrote: >>> >>> Ooops, yes. >>> >>> Are you looking into new nvme_set_features users? Another thing >>> we need to

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-26 Thread Andy Lutomirski
On Aug 25, 2016 4:20 PM, "Jens Axboe" wrote: > > On 08/25/2016 01:54 AM, Andy Lutomirski wrote: >> >> On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig wrote: >>> >>> Ooops, yes. >>> >>> Are you looking into new nvme_set_features users? Another thing >>> we need to tackle is either replacing

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-25 Thread Jens Axboe
On 08/25/2016 01:54 AM, Andy Lutomirski wrote: On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig wrote: Ooops, yes. Are you looking into new nvme_set_features users? Another thing we need to tackle is either replacing dma_addr argument with a a real kernel pointer (or just

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-25 Thread Jens Axboe
On 08/25/2016 01:54 AM, Andy Lutomirski wrote: On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig wrote: Ooops, yes. Are you looking into new nvme_set_features users? Another thing we need to tackle is either replacing dma_addr argument with a a real kernel pointer (or just kill it until

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-25 Thread Christoph Hellwig
On Thu, Aug 25, 2016 at 12:54:00AM -0700, Andy Lutomirski wrote: > I am, and I have a patch to do the former (and to add a length > argument). But that's not -stable material. Great! > While I have your attention: the new use is to enable APST (power > saving). In theory, it seems like I

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-25 Thread Christoph Hellwig
On Thu, Aug 25, 2016 at 12:54:00AM -0700, Andy Lutomirski wrote: > I am, and I have a patch to do the former (and to add a length > argument). But that's not -stable material. Great! > While I have your attention: the new use is to enable APST (power > saving). In theory, it seems like I

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-25 Thread Andy Lutomirski
On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig wrote: > Ooops, yes. > > Are you looking into new nvme_set_features users? Another thing > we need to tackle is either replacing dma_addr argument with a > a real kernel pointer (or just kill it until users show up) I am, and I

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-25 Thread Andy Lutomirski
On Thu, Aug 25, 2016 at 12:38 AM, Christoph Hellwig wrote: > Ooops, yes. > > Are you looking into new nvme_set_features users? Another thing > we need to tackle is either replacing dma_addr argument with a > a real kernel pointer (or just kill it until users show up) I am, and I have a patch to

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-25 Thread Christoph Hellwig
Ooops, yes. Are you looking into new nvme_set_features users? Another thing we need to tackle is either replacing dma_addr argument with a a real kernel pointer (or just kill it until users show up)

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-25 Thread Christoph Hellwig
Ooops, yes. Are you looking into new nvme_set_features users? Another thing we need to tackle is either replacing dma_addr argument with a a real kernel pointer (or just kill it until users show up)

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-24 Thread Jens Axboe
On 08/24/2016 04:52 AM, Andy Lutomirski wrote: nvme_set_features() callers seem to expect that passing NULL as the result pointer is acceptable. Teach nvme_set_features() not to try to write to the NULL address. For symmetry, make the same change to nvme_get_features(), despite the fact that

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-24 Thread Jens Axboe
On 08/24/2016 04:52 AM, Andy Lutomirski wrote: nvme_set_features() callers seem to expect that passing NULL as the result pointer is acceptable. Teach nvme_set_features() not to try to write to the NULL address. For symmetry, make the same change to nvme_get_features(), despite the fact that

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-24 Thread Sagi Grimberg
Looks fine, Reviewed-by: Sagi Grimberg

Re: [PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-24 Thread Sagi Grimberg
Looks fine, Reviewed-by: Sagi Grimberg

[PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-24 Thread Andy Lutomirski
nvme_set_features() callers seem to expect that passing NULL as the result pointer is acceptable. Teach nvme_set_features() not to try to write to the NULL address. For symmetry, make the same change to nvme_get_features(), despite the fact that all current callers pass a valid result pointer.

[PATCH] nvme: Fix nvme_get/set_features() with a NULL result pointer

2016-08-24 Thread Andy Lutomirski
nvme_set_features() callers seem to expect that passing NULL as the result pointer is acceptable. Teach nvme_set_features() not to try to write to the NULL address. For symmetry, make the same change to nvme_get_features(), despite the fact that all current callers pass a valid result pointer.