[PATCH v2 0/3] virtiofs: hiprio FORGET robustness and no-reply request completion

Li Wang posted 3 patches 2 months, 2 weeks ago
fs/fuse/virtio_fs.c | 37 +++++++++++++++++++++++++++++--------
1 file changed, 29 insertions(+), 8 deletions(-)
[PATCH v2 0/3] virtiofs: hiprio FORGET robustness and no-reply request completion
Posted by Li Wang 2 months, 2 weeks ago
This series fixes virtiofs completion for FUSE requests that do not use a
reply descriptor, tightens hiprio FORGET handling when virtqueue submission
fails transiently, and prevents the hiprio worker from stalling when one
FORGET must be dropped after an unrecoverable error.

The first patch addresses correctness: completing a no-reply request must
not interpret the reply header fields, otherwise it will cause underflow, 
and the bounce buffer allocated for the absent out header must be freed.

The host may complete virtio requests without an out descriptor (e.g.
FUSE_FORGET). The completion path must not run copy_args_from_argbuf(),
which expects a valid fuse_out_header from the reply path. This series also
ensures virtio_fs_verify_response() runs only for real replies (FR_ISREPLY),
and frees req->argbuf on the no-reply path to avoid a per-request leak.

Changes since v1
------------------------------
Patch 1: v1 only guarded copy_args_from_argbuf() with FR_ISREPLY. v2 also
kfree(req->argbuf) when !FR_ISREPLY (the buffer was allocated in
copy_args_to_argbuf for an out header that never arrives), and gates
virtio_fs_verify_response() in virtio_fs_requests_done_work() on FR_ISREPLY
so uninitialized fuse_out_header is never verified.

Patch 2: behavior matches v1. The commit message is expanded to explain 
transient GFP_ATOMIC exhaustion and why dropping the FORGET would skew 
nlookup and leak kernel state.

Patch 3: behavior matches v1. The commit message documents the
return-value contract with virtio_fs_hiprio_dispatch_work() and the stall
risk on the nonzero path.

Commit messages were rewritten for clearer rationale.

Li Wang (3):
  virtiofs: Complete no-reply virtio requests without parsing the out
    header
  virtiofs: Retry hiprio FORGET when virtqueue_add_outbuf() returns
    -ENOMEM
  virtiofs: Do not stall hiprio FORGET dispatch after dropping one
    request

 fs/fuse/virtio_fs.c | 37 +++++++++++++++++++++++++++++--------
 1 file changed, 29 insertions(+), 8 deletions(-)

-- 
2.34.1
Re: [PATCH v2 0/3] virtiofs: hiprio FORGET robustness and no-reply request completion
Posted by Miklos Szeredi 1 week, 3 days ago
On Thu, 2 Apr 2026 at 12:45, Li Wang <liwang@kylinos.cn> wrote:
>
> This series fixes virtiofs completion for FUSE requests that do not use a
> reply descriptor, tightens hiprio FORGET handling when virtqueue submission
> fails transiently, and prevents the hiprio worker from stalling when one
> FORGET must be dropped after an unrecoverable error.

Can someone from the virtiofs team please review this?

Thanks,
Miklos
Re: [PATCH v2 0/3] virtiofs: hiprio FORGET robustness and no-reply request completion
Posted by Stefan Hajnoczi 1 week, 2 days ago
On Thu, Jun 11, 2026 at 5:34 AM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Thu, 2 Apr 2026 at 12:45, Li Wang <liwang@kylinos.cn> wrote:
> >
> > This series fixes virtiofs completion for FUSE requests that do not use a
> > reply descriptor, tightens hiprio FORGET handling when virtqueue submission
> > fails transiently, and prevents the hiprio worker from stalling when one
> > FORGET must be dropped after an unrecoverable error.
>
> Can someone from the virtiofs team please review this?

German: Are you available to review this? I am can review patches as a
fallback but would prefer for you to handle them most of the time
since I haven't been actively involved in virtiofs for some time.

Thanks,
Stefan