Re: [PATCH] 9p: Add missing read barrier in virtio zero-copy path

Gui-Dong Han <[email protected]> Wed, 17 Jun 2026 20:55:29 +0800
Newsgroups dev.linux.lists.v9fs,org.kernel.vger.linux-kernel
Message-ID <CALbr=LbuWzRo+fndQFEnhVJTfSPsEfKqwUri9ovyUe+dkXXx9g@mail.gmail.com>
On Mon, Jun 15, 2026 at 9:13 PM Dominique Martinet
<[email protected]> wrote:
>
> Gui-Dong Han wrote on Fri, May 29, 2026 at 03:54:41PM +0800:
> > Commit 2b6e72ed747f ("9P: Add memory barriers to protect request
> > fields over cb/rpc threads handoff") added a read barrier after
> > p9_client_rpc() waits for req->status, pairing with the write barrier in
> > p9_client_cb(). The virtio zero-copy wait path was missed.
> >
> > Add the same read barrier after the zero-copy wait before reading the
> > completed request.
> >
> > Fixes: abfa034e4b8e ("fs/9p: Update zero-copy implementation in 9p")
>
> This doesn't make sense, the wmb was added a few years later, so I guess
> this should be
> Fixes: 2b6e72ed747f ("9P: Add memory barriers to protect request fields over cb/rpc threads handoff")
>
> With that said, a rmb here makes sense, so picking up (with fix tag
> fixed up)

Hi Dominique,

Thanks for taking it.

I was also unsure about the Fixes tag. abfa034e4b8e introduced the
lockless zero-copy path, while 2b6e72ed747f introduced the wmb/rmb
handoff rule completed here. Your choice makes sense to me.

I understand you will fix it up when applying the patch. I can also send
a v2 if you prefer.

Thanks,
Gui-Dong Han