[PATCH v2] vhost: fix VDUSE device destruction failure

David Marchand david.marchand at redhat.com
Tue Mar 5 10:05:10 CET 2024


On Mon, Mar 4, 2024 at 11:36 AM David Marchand
<david.marchand at redhat.com> wrote:
>
> From: Maxime Coquelin <maxime.coquelin at redhat.com>
>
> VDUSE_DESTROY_DEVICE ioctl can fail because the device's
> chardev is not released despite close syscall having been
> called. It happens because the events handler thread is
> still polling the file descriptor.
>
> fdset_pipe_notify() is not enough because it does not
> ensure the notification has been handled by the event
> thread, it just returns once the notification is sent.
>
> To fix this, this patch introduces a synchronization
> mechanism based on pthread's condition, so that
> fdset_pipe_notify_sync() only returns once the pipe's
> read callback has been executed.
>
> Fixes: 51d018fdac4e ("vhost: add VDUSE events handler")
> Cc: stable at dpdk.org
>
> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> Changes since v1:
> - sync'd only when in VDUSE destruction path,
> - added explicit init of sync_mutex,

Applied, thanks.


-- 
David Marchand



More information about the stable mailing list