Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Benjamin Block
On Fri, Aug 11, 2017 at 05:35:53PM +0200, Christoph Hellwig wrote: > On Fri, Aug 11, 2017 at 05:32:03PM +0200, Benjamin Block wrote: > > So when the bsg interface is used with something different than the > > bsg-lib request queue? > > Yes. > > > I haven't actually thought about that (presuming

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Christoph Hellwig
On Fri, Aug 11, 2017 at 05:32:03PM +0200, Benjamin Block wrote: > So when the bsg interface is used with something different than the > bsg-lib request queue? Yes. > I haven't actually thought about that (presuming > the bsg-lib queue was the only one being used). Fair enough, I haven't >

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Benjamin Block
On Fri, Aug 11, 2017 at 04:36:49PM +0200, Christoph Hellwig wrote: > On Fri, Aug 11, 2017 at 03:49:29PM +0200, Benjamin Block wrote: > > On Fri, Aug 11, 2017 at 11:14:15AM +0200, Christoph Hellwig wrote: > > > But patch 1 still creates an additional copy of the sense data for > > > all bsg users.

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Christoph Hellwig
On Fri, Aug 11, 2017 at 03:49:29PM +0200, Benjamin Block wrote: > On Fri, Aug 11, 2017 at 11:14:15AM +0200, Christoph Hellwig wrote: > > But patch 1 still creates an additional copy of the sense data for > > all bsg users. > > > > Huh? What additional copy? There is one reply-buffer and that is

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Benjamin Block
On Fri, Aug 11, 2017 at 11:14:15AM +0200, Christoph Hellwig wrote: > But patch 1 still creates an additional copy of the sense data for > all bsg users. > Huh? What additional copy? There is one reply-buffer and that is copied into the user-buffer should it contain valid data. Just like in your

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Christoph Hellwig
But patch 1 still creates an additional copy of the sense data for all bsg users. Can you test the patch below which implements my suggestion? Your other patches should still apply fine on top modulo minor context changes. --- >From 4cd32ee48e334b62b55bff0d380833b978454040 Mon Sep 17 00:00:00

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Christoph Hellwig
My point was that we now gurantee that that the sense data is not a stack pointer an a driver can DMA to it. Now for BSG the sense data is "just" abused as reply, but the point still stands - we don't want to pass a possible stack pointer to drivers in a data buffer because we want to allow DMA