Displaying 15 results from an estimated 15 matches for "virtio_fs_stop_all_queu".
Did you mean:
virtio_fs_stop_all_queues
2019 Sep 05
0
[PATCH 07/18] virtiofs: Stop virtiofs queues when device is being removed
...++++++++
1 file changed, 14 insertions(+)
diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index f68a25ca9e9d..90e7b2f345e5 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -493,10 +493,24 @@ static int virtio_fs_probe(struct virtio_device *vdev)
return ret;
}
+static void virtio_fs_stop_all_queues(struct virtio_fs *fs)
+{
+ struct virtio_fs_vq *fsvq;
+ int i;
+
+ for (i = 0; i < fs->nvqs; i++) {
+ fsvq = &fs->vqs[i];
+ spin_lock(&fsvq->lock);
+ fsvq->connected = false;
+ spin_unlock(&fsvq->lock);
+ }
+}
+
static void virtio_fs_remove(struct virtio_device...
2019 Sep 05
0
[PATCH 15/18] virtiofs: Make virtio_fs object refcounted
...vdev->priv = fs;
ret = virtio_fs_read_tag(vdev, fs);
@@ -570,18 +595,18 @@ static void virtio_fs_remove(struct virtio_device *vdev)
{
struct virtio_fs *fs = vdev->priv;
+ mutex_lock(&virtio_fs_mutex);
+ list_del_init(&fs->list);
+ mutex_unlock(&virtio_fs_mutex);
+
virtio_fs_stop_all_queues(fs);
virtio_fs_drain_all_queues(fs);
vdev->config->reset(vdev);
virtio_fs_cleanup_vqs(vdev, fs);
- mutex_lock(&virtio_fs_mutex);
- list_del(&fs->list);
- mutex_unlock(&virtio_fs_mutex);
-
vdev->priv = NULL;
- kfree(fs->vqs);
- kfree(fs);
+ /* Put device refere...
2019 Sep 06
2
[PATCH 15/18] virtiofs: Make virtio_fs object refcounted
On Thu, Sep 05, 2019 at 03:48:56PM -0400, Vivek Goyal wrote:
> This object is used both by fuse_connection as well virt device. So make
> this object reference counted and that makes it easy to define life cycle
> of the object.
>
> Now deivce can be removed while filesystem is still mounted. This will
> cleanup all the virtqueues but virtio_fs object will still be around and
2019 Sep 06
2
[PATCH 15/18] virtiofs: Make virtio_fs object refcounted
On Thu, Sep 05, 2019 at 03:48:56PM -0400, Vivek Goyal wrote:
> This object is used both by fuse_connection as well virt device. So make
> this object reference counted and that makes it easy to define life cycle
> of the object.
>
> Now deivce can be removed while filesystem is still mounted. This will
> cleanup all the virtqueues but virtio_fs object will still be around and
2019 Sep 06
0
[PATCH 15/18] virtiofs: Make virtio_fs object refcounted
...s->refcount);
vdev->priv = fs;
ret = virtio_fs_read_tag(vdev, fs);
@@ -570,18 +595,18 @@ static void virtio_fs_remove(struct virt
{
struct virtio_fs *fs = vdev->priv;
+ mutex_lock(&virtio_fs_mutex);
+ list_del_init(&fs->list);
+ mutex_unlock(&virtio_fs_mutex);
+
virtio_fs_stop_all_queues(fs);
virtio_fs_drain_all_queues(fs);
vdev->config->reset(vdev);
virtio_fs_cleanup_vqs(vdev, fs);
- mutex_lock(&virtio_fs_mutex);
- list_del(&fs->list);
- mutex_unlock(&virtio_fs_mutex);
-
vdev->priv = NULL;
- kfree(fs->vqs);
- kfree(fs);
+ /* Put device refere...
2019 Sep 06
2
[PATCH 16/18] virtiofs: Use virtio_fs_mutex for races w.r.t ->remove and mount path
On Thu, Sep 05, 2019 at 03:48:57PM -0400, Vivek Goyal wrote:
> It is possible that a mount is in progress and device is being removed at
> the same time. Use virtio_fs_mutex to avoid races.
>
> This also takes care of bunch of races and removes some TODO items.
>
> Signed-off-by: Vivek Goyal <vgoyal at redhat.com>
> ---
> fs/fuse/virtio_fs.c | 32
2019 Sep 06
2
[PATCH 16/18] virtiofs: Use virtio_fs_mutex for races w.r.t ->remove and mount path
On Thu, Sep 05, 2019 at 03:48:57PM -0400, Vivek Goyal wrote:
> It is possible that a mount is in progress and device is being removed at
> the same time. Use virtio_fs_mutex to avoid races.
>
> This also takes care of bunch of races and removes some TODO items.
>
> Signed-off-by: Vivek Goyal <vgoyal at redhat.com>
> ---
> fs/fuse/virtio_fs.c | 32
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 08/18] virtiofs: Drain all pending requests during ->remove time
...;
+
+ virtio_fs_drain_queue(fsvq);
+ }
+}
+
/* Add a new instance to the list or return -EEXIST if tag name exists*/
static int virtio_fs_add_instance(struct virtio_fs *fs)
{
@@ -511,6 +560,7 @@ static void virtio_fs_remove(struct virtio_device *vdev)
struct virtio_fs *fs = vdev->priv;
virtio_fs_stop_all_queues(fs);
+ virtio_fs_drain_all_queues(fs);
vdev->config->reset(vdev);
virtio_fs_cleanup_vqs(vdev, fs);
@@ -865,37 +915,6 @@ __releases(fiq->waitq.lock)
}
}
-static void virtio_fs_flush_hiprio_queue(struct virtio_fs_vq *fsvq)
-{
- struct virtio_fs_forget *forget;
-
- WARN_ON(fsvq-&...
2019 Sep 05
0
[PATCH 11/18] virtiofs: stop and drain queues after sending DESTROY
...nd_init(fc, init_req);
return 0;
@@ -1026,6 +1025,12 @@ static void virtio_kill_sb(struct super_block *sb)
virtio_fs_drain_all_queues(vfs);
fuse_kill_sb_anon(sb);
+
+ /* fuse_kill_sb_anon() must have sent destroy. Stop all queues
+ * and drain one more time and free fuse devices.
+ */
+ virtio_fs_stop_all_queues(vfs);
+ virtio_fs_drain_all_queues(vfs);
virtio_fs_free_devs(vfs);
}
--
2.20.1
2019 Oct 30
0
[PATCH 3/3] virtiofs: Use completions while waiting for queue to be drained
....name, sizeof(fs->vqs[i].name),
"requests.%u", i - VQ_REQUEST);
callbacks[i] = virtio_fs_vq_done;
@@ -684,7 +703,7 @@ static void virtio_fs_remove(struct virtio_device *vdev)
/* This device is going away. No one should get new reference */
list_del_init(&fs->list);
virtio_fs_stop_all_queues(fs);
- virtio_fs_drain_all_queues(fs);
+ virtio_fs_drain_all_queues_locked(fs);
vdev->config->reset(vdev);
virtio_fs_cleanup_vqs(vdev, fs);
--
2.20.1
2019 Sep 05
0
[PATCH 16/18] virtiofs: Use virtio_fs_mutex for races w.r.t ->remove and mount path
...@@ -596,9 +600,8 @@ static void virtio_fs_remove(struct virtio_device *vdev)
struct virtio_fs *fs = vdev->priv;
mutex_lock(&virtio_fs_mutex);
+ /* This device is going away. No one should get new reference */
list_del_init(&fs->list);
- mutex_unlock(&virtio_fs_mutex);
-
virtio_fs_stop_all_queues(fs);
virtio_fs_drain_all_queues(fs);
vdev->config->reset(vdev);
@@ -607,6 +610,7 @@ static void virtio_fs_remove(struct virtio_device *vdev)
vdev->priv = NULL;
/* Put device reference on virtio_fs object */
virtiofs_put(fs);
+ mutex_unlock(&virtio_fs_mutex);
}
#ifdef CO...
2019 Sep 06
0
[PATCH 16/18] virtiofs: Use virtio_fs_mutex for races w.r.t ->remove and mount path
...tio_fs_vq *fsvq)
@@ -596,9 +600,8 @@ static void virtio_fs_remove(struct virt
struct virtio_fs *fs = vdev->priv;
mutex_lock(&virtio_fs_mutex);
+ /* This device is going away. No one should get new reference */
list_del_init(&fs->list);
- mutex_unlock(&virtio_fs_mutex);
-
virtio_fs_stop_all_queues(fs);
virtio_fs_drain_all_queues(fs);
vdev->config->reset(vdev);
@@ -607,6 +610,7 @@ static void virtio_fs_remove(struct virt
vdev->priv = NULL;
/* Put device reference on virtio_fs object */
virtio_fs_put(fs);
+ mutex_unlock(&virtio_fs_mutex);
}
#ifdef CONFIG_PM_SLEEP
@...
2019 Sep 18
0
[PATCH v6] virtio-fs: add virtiofs filesystem
...stance(fs);
> + if (ret < 0)
> + goto out_vqs;
> +
> + return 0;
> +
> +out_vqs:
> + vdev->config->reset(vdev);
> + virtio_fs_cleanup_vqs(vdev, fs);
> +
> +out:
> + vdev->priv = NULL;
> + kfree(fs);
> + return ret;
> +}
> +
> +static void virtio_fs_stop_all_queues(struct virtio_fs *fs)
> +{
> + struct virtio_fs_vq *fsvq;
> + int i;
> +
> + for (i = 0; i < fs->nvqs; i++) {
> + fsvq = &fs->vqs[i];
> + spin_lock(&fsvq->lock);
> + fsvq->connected = false;
> + spin_unlock(&fsvq->lock);
> + }
> +...
2019 Oct 30
6
[PATCH 0/3] virtiofs: Small Cleanups for 5.5
Hi Miklos,
Here are few small cleanups for virtiofs for 5.5. I had received some
comments from Michael Tsirkin on original virtiofs patches and these
cleanups are result of these comments.
Thanks
Vivek
Vivek Goyal (3):
virtiofs: Use a common function to send forget
virtiofs: Do not send forget request "struct list_head" element
virtiofs: Use completions while waiting for queue