[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/6] virtiofsd: Drop ->vu_dispatch_rwlock while waiting for t
From: |
Greg Kurz |
Subject: |
Re: [PATCH 1/6] virtiofsd: Drop ->vu_dispatch_rwlock while waiting for thread to exit |
Date: |
Fri, 29 Jan 2021 13:03:09 +0100 |
On Tue, 26 Jan 2021 13:33:36 -0500
Vivek Goyal <vgoyal@redhat.com> wrote:
[...]
> >
> > Also, since pthread_rwlock_wrlock() can fail, I think we should
> > always check it's return value, at least with an assert() like
> > already done elsewhere.
>
> Will check return code of pthread_rwlock_wrlock() and probably use
> assert().
>
It turns out that pthread_rwlock_rdlock() and pthread_rwlock_unlock() can
also fail for various reasons that would likely indicate a programming
error, but their return values are never checked anywhere.
I have a patch to address this globally in this file. Should I post it
now or you prefer this series goes first ?
> Vivek
>
> >
> > > for (int i = 0; i < se->virtio_dev->nqueues; i++) {
> > > if (!se->virtio_dev->qi[i]) {
> > > continue;
> > > @@ -961,6 +974,7 @@ int virtio_loop(struct fuse_session *se)
> > > fuse_log(FUSE_LOG_INFO, "%s: Stopping queue %d thread\n",
> > > __func__, i);
> > > fv_queue_cleanup_thread(se->virtio_dev, i);
> > > }
> > > + pthread_rwlock_unlock(&se->virtio_dev->vu_dispatch_rwlock);
> > >
> > > fuse_log(FUSE_LOG_INFO, "%s: Exit\n", __func__);
> > >
> >
>
- Re: [PATCH 2/6] libvhost-user: Use slave_mutex in all slave messages, (continued)
[PATCH 6/6] virtiofsd: Opt in for slave start/stop/shutdown functionality, Vivek Goyal, 2021/01/25
[PATCH 3/6] vhost-user: Return error code from slave_read(), Vivek Goyal, 2021/01/25
[PATCH 1/6] virtiofsd: Drop ->vu_dispatch_rwlock while waiting for thread to exit, Vivek Goyal, 2021/01/25
[PATCH 4/6] qemu, vhost-user: Extend protocol to start/stop/flush slave channel, Vivek Goyal, 2021/01/25
[PATCH 5/6] libvhost-user: Add support to start/stop/flush slave channel, Vivek Goyal, 2021/01/25