> virtqueue_add_outbuf() returns -ENOSPC when the virtqueue is full.  On
> this path it can also return -ENOMEM, when a split-ring DMA mapping
> fails, or -EIO, when the virtqueue is broken or a packed-ring mapping
> fails.  send_forget_request() turns only -ENOSPC into 1, so
> virtio_fs_hiprio_dispatch_work() stops and waits for a completion.  Any
> other error frees that FORGET and drops its in_flight count, then
> returns the negative errno.  The worker treats every non-zero return as
> a reason to stop, so the rest of queued_reqs is left unexamined.
> 
> hiprio dispatch_work is scheduled only from
> virtio_fs_hiprio_done_work(), which runs from that virtqueue interrupt.
> Once no descriptor is outstanding, the device raises no interrupt and
> nothing walks the list.  virtio_fs_send_forget() submits a new FORGET
> directly and does not schedule the worker.  The queued entries are
> reached again only if that new FORGET is placed on the virtqueue and
> [ ... ]
> continues with the rest of queued_reqs.  A full queue still returns 1.
> 
> Fixes: a62a8ef9d97d ("virtio-fs: add virtiofs filesystem")
> Cc: [email protected]
> Signed-off-by: Li Wang <[email protected]>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to