Displaying 14 results from an estimated 14 matches for "fuse_request_end".
2019 Oct 15
7
[PATCH 0/5] virtiofs: Fix couple of deadlocks
Hi,
We have couple of places which can result in deadlock. This patch series
fixes these.
We can be called with fc->bg_lock (for background requests) while
submitting a request. This leads to two constraints.
- We can't end requests in submitter's context and call fuse_end_request()
as it tries to take fc->bg_lock as well. So queue these requests on a
list and use a worker to
2019 Sep 05
0
[PATCH 01/18] virtiofs: Remove request from processing list before calling end
In error path we are calling fuse_request_end() but we need to clear
FR_SENT bit as well as remove request from processing queue. Otherwise
fuse_request_end() triggers a warning as well as other issues show up.
Signed-off-by: Vivek Goyal <vgoyal at redhat.com>
---
fs/fuse/virtio_fs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --gi...
2020 Jun 18
0
[PATCH AUTOSEL 5.4 096/266] virtiofs: schedule blocking async replies in separate worker
...thislen) {
+ WARN_ON(ap->descs[i].offset);
+ page = ap->pages[i];
+ zero_user_segment(page, len, thislen);
+ len = 0;
+ } else {
+ len -= thislen;
+ }
+ }
+ }
+
+ spin_lock(&fpq->lock);
+ clear_bit(FR_SENT, &req->flags);
+ spin_unlock(&fpq->lock);
+
+ fuse_request_end(fc, req);
+ spin_lock(&fsvq->lock);
+ dec_in_flight_req(fsvq);
+ spin_unlock(&fsvq->lock);
+}
+
+static void virtio_fs_complete_req_work(struct work_struct *work)
+{
+ struct virtio_fs_req_work *w =
+ container_of(work, typeof(*w), done_work);
+
+ virtio_fs_request_complete(w->req...
2020 Jun 18
0
[PATCH AUTOSEL 5.7 131/388] virtiofs: schedule blocking async replies in separate worker
...thislen) {
+ WARN_ON(ap->descs[i].offset);
+ page = ap->pages[i];
+ zero_user_segment(page, len, thislen);
+ len = 0;
+ } else {
+ len -= thislen;
+ }
+ }
+ }
+
+ spin_lock(&fpq->lock);
+ clear_bit(FR_SENT, &req->flags);
+ spin_unlock(&fpq->lock);
+
+ fuse_request_end(fc, req);
+ spin_lock(&fsvq->lock);
+ dec_in_flight_req(fsvq);
+ spin_unlock(&fsvq->lock);
+}
+
+static void virtio_fs_complete_req_work(struct work_struct *work)
+{
+ struct virtio_fs_req_work *w =
+ container_of(work, typeof(*w), done_work);
+
+ virtio_fs_request_complete(w->req...
2019 Sep 05
0
[PATCH 05/18] Maintain count of in flight requests for VQ_REQUEST queue
...changed, 4 insertions(+)
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index c46dd4d284d6..5df97dfee37d 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -360,6 +360,9 @@ static void virtio_fs_requests_done_work(struct work_struct *work)
spin_unlock(&fpq->lock);
fuse_request_end(fc, req);
+ spin_lock(&fsvq->lock);
+ fsvq->in_flight--;
+ spin_unlock(&fsvq->lock);
}
}
@@ -769,6 +772,7 @@ static int virtio_fs_enqueue_req(struct virtio_fs_vq *fsvq,
goto out;
}
+ fsvq->in_flight++;
notify = virtqueue_kick_prepare(vq);
spin_unlock(&fs...
2019 Oct 21
0
[PATCH 1/5] virtiofs: Do not end request in submission context
...rtqueue full. Retry submission */
> > @@ -965,7 +989,13 @@ __releases(fiq->lock)
> > clear_bit(FR_SENT, &req->flags);
> > list_del_init(&req->list);
> > spin_unlock(&fpq->lock);
> > - fuse_request_end(fc, req);
> > +
> > + /* Can't end request in submission context. Use a worker */
> > + spin_lock(&fsvq->lock);
> > + list_add_tail(&req->list, &fsvq->end_reqs);
> > + schedule_delayed_wor...
2019 Oct 21
0
[PATCH 5/5] virtiofs: Retry request submission from worker context
...spin_unlock(&fsvq->lock);
> > - return;
> > + break;
> > }
> >
> > list_del_init(&req->list);
> > spin_unlock(&fsvq->lock);
> > fuse_request_end(fc, req);
> > }
> > +
> > + /* Dispatch pending requests */
> > + while (1) {
> > + spin_lock(&fsvq->lock);
> > + req = list_first_entry_or_null(&fsvq->queued_reqs,
> > +...
2019 Sep 05
38
[PATCH 00/18] virtiofs: Fix various races and cleanups round 1
Hi,
Michael Tsirkin pointed out issues w.r.t various locking related TODO
items and races w.r.t device removal.
In this first round of cleanups, I have taken care of most pressing
issues.
These patches apply on top of following.
git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#virtiofs-v4
I have tested these patches with mount/umount and device removal using
qemu monitor. For
2019 Sep 05
0
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...fpq = &fs->vqs[queue_id].fud->pq;
> > + spin_lock(&fpq->lock);
> > + if (!fpq->connected) {
> > + spin_unlock(&fpq->lock);
> > + req->out.h.error = -ENODEV;
> > + pr_err("virtio-fs: %s disconnected\n", __func__);
> > + fuse_request_end(fc, req);
> > + return;
> > + }
> > + list_add_tail(&req->list, fpq->processing);
> > + spin_unlock(&fpq->lock);
> > + set_bit(FR_SENT, &req->flags);
> > + /* matches barrier in request_wait_answer() */
> > + smp_mb__after_atomic();...
2019 Sep 03
4
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...thislen);
> + len = 0;
> + } else {
> + len -= thislen;
> + }
> + }
> + }
> +
> + spin_lock(&fpq->lock);
> + clear_bit(FR_SENT, &req->flags);
> + list_del_init(&req->list);
> + spin_unlock(&fpq->lock);
> +
> + fuse_request_end(fc, req);
> + }
> +}
> +
> +/* Virtqueue interrupt handler */
> +static void virtio_fs_vq_done(struct virtqueue *vq)
> +{
> + struct virtio_fs_vq *fsvq = vq_to_fsvq(vq);
> +
> + dev_dbg(&vq->vdev->dev, "%s %s\n", __func__, fsvq->name);
> +
> +...
2019 Sep 03
4
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...thislen);
> + len = 0;
> + } else {
> + len -= thislen;
> + }
> + }
> + }
> +
> + spin_lock(&fpq->lock);
> + clear_bit(FR_SENT, &req->flags);
> + list_del_init(&req->list);
> + spin_unlock(&fpq->lock);
> +
> + fuse_request_end(fc, req);
> + }
> +}
> +
> +/* Virtqueue interrupt handler */
> +static void virtio_fs_vq_done(struct virtqueue *vq)
> +{
> + struct virtio_fs_vq *fsvq = vq_to_fsvq(vq);
> +
> + dev_dbg(&vq->vdev->dev, "%s %s\n", __func__, fsvq->name);
> +
> +...
2019 Oct 15
0
[PATCH 4/5] virtiofs: Count pending forgets as in_flight forgets
...c_in_flight_req(fsvq);
kfree(forget);
}
spin_unlock(&fsvq->lock);
return;
}
- fsvq->in_flight++;
notify = virtqueue_kick_prepare(vq);
spin_unlock(&fsvq->lock);
@@ -472,7 +467,7 @@ static void virtio_fs_requests_done_work(struct work_struct *work)
fuse_request_end(fc, req);
spin_lock(&fsvq->lock);
- fsvq->in_flight--;
+ dec_in_flight_req(fsvq);
spin_unlock(&fsvq->lock);
}
}
@@ -730,6 +725,7 @@ __releases(fiq->lock)
list_add_tail(&forget->list, &fsvq->queued_reqs);
schedule_delayed_work(&fsvq->dispat...
2019 Sep 06
1
[PATCH v4 15/16] virtio-fs: add virtiofs filesystem
...d].fud->pq;
> > > + spin_lock(&fpq->lock);
> > > + if (!fpq->connected) {
> > > + spin_unlock(&fpq->lock);
> > > + req->out.h.error = -ENODEV;
> > > + pr_err("virtio-fs: %s disconnected\n", __func__);
> > > + fuse_request_end(fc, req);
> > > + return;
> > > + }
> > > + list_add_tail(&req->list, fpq->processing);
> > > + spin_unlock(&fpq->lock);
> > > + set_bit(FR_SENT, &req->flags);
> > > + /* matches barrier in request_wait_answer() */
>...
2019 Sep 18
0
[PATCH v6] virtio-fs: add virtiofs filesystem
...thislen);
> + len = 0;
> + } else {
> + len -= thislen;
> + }
> + }
> + }
> +
> + spin_lock(&fpq->lock);
> + clear_bit(FR_SENT, &req->flags);
> + list_del_init(&req->list);
> + spin_unlock(&fpq->lock);
> +
> + fuse_request_end(fc, req);
> + spin_lock(&fsvq->lock);
> + fsvq->in_flight--;
> + spin_unlock(&fsvq->lock);
> + }
> +}
> +
> +/* Virtqueue interrupt handler */
> +static void virtio_fs_vq_done(struct virtqueue *vq)
> +{
> + struct virtio_fs_vq *fsvq = vq_to_fsvq(vq)...