summaryrefslogtreecommitdiff
path: root/tools/virtiofsd/passthrough_seccomp.c
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2021-02-03 19:24:34 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2021-02-16 17:03:09 +0000
commit525a3030a82714693c2045d390b698dd4e2090bd (patch)
tree349205ed8eae178e84aa315605ec4a43bff6a260 /tools/virtiofsd/passthrough_seccomp.c
parent0958ee89b6fb8542867ca68203626d6aef522e8f (diff)
downloadqemu-525a3030a82714693c2045d390b698dd4e2090bd.zip
virtiofsd: vu_dispatch locking should never fail
pthread_rwlock_rdlock() and pthread_rwlock_wrlock() can fail if a deadlock condition is detected or the current thread already owns the lock. They can also fail, like pthread_rwlock_unlock(), if the mutex wasn't properly initialized. None of these are ever expected to happen with fv_VuDev::vu_dispatch_rwlock. Some users already check the return value and assert, some others don't. Introduce rdlock/wrlock/unlock wrappers that just do the former and use them everywhere for improved consistency and robustness. This is just cleanup. It doesn't fix any actual issue. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <20210203182434.93870-1-groug@kaod.org> Reviewed-by: Vivek Goyal <vgoyal@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools/virtiofsd/passthrough_seccomp.c')
0 files changed, 0 insertions, 0 deletions