Re: [PATCH 08/18] virtiofs: Drain all pending requests during ->remove time

2019-09-09 Thread Stefan Hajnoczi
On Fri, Sep 06, 2019 at 10:18:49AM -0400, Michael S. Tsirkin wrote: > On Fri, Sep 06, 2019 at 10:17:05AM -0400, Vivek Goyal wrote: > > On Fri, Sep 06, 2019 at 11:52:10AM +0100, Stefan Hajnoczi wrote: > > > On Thu, Sep 05, 2019 at 03:48:49PM -0400, Vivek Goyal wrote: > > > > +static void virtio_fs_d

Re: [PATCH 08/18] virtiofs: Drain all pending requests during ->remove time

2019-09-06 Thread Michael S. Tsirkin
On Fri, Sep 06, 2019 at 10:17:05AM -0400, Vivek Goyal wrote: > On Fri, Sep 06, 2019 at 11:52:10AM +0100, Stefan Hajnoczi wrote: > > On Thu, Sep 05, 2019 at 03:48:49PM -0400, Vivek Goyal wrote: > > > +static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq) > > > +{ > > > + WARN_ON(fsvq->in_flig

Re: [PATCH 08/18] virtiofs: Drain all pending requests during ->remove time

2019-09-06 Thread Vivek Goyal
On Fri, Sep 06, 2019 at 11:52:10AM +0100, Stefan Hajnoczi wrote: > On Thu, Sep 05, 2019 at 03:48:49PM -0400, Vivek Goyal wrote: > > +static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq) > > +{ > > + WARN_ON(fsvq->in_flight < 0); > > + > > + /* Wait for in flight requests to finish.*/ >

Re: [PATCH 08/18] virtiofs: Drain all pending requests during ->remove time

2019-09-06 Thread Stefan Hajnoczi
On Thu, Sep 05, 2019 at 03:48:49PM -0400, Vivek Goyal wrote: > +static void virtio_fs_drain_queue(struct virtio_fs_vq *fsvq) > +{ > + WARN_ON(fsvq->in_flight < 0); > + > + /* Wait for in flight requests to finish.*/ > + while (1) { > + spin_lock(&fsvq->lock); > +

[PATCH 08/18] virtiofs: Drain all pending requests during ->remove time

2019-09-05 Thread Vivek Goyal
When device is going away, drain all pending requests. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 83 - 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 90e7b2f345e5..d5730a50b303