Re: userfaultfd: two-step UFFDIO_API always gives -EINVAL

From: stsp
Date: Mon Nov 25 2024 - 12:07:47 EST


25.11.2024 19:58, Peter Xu пишет:
On Mon, Nov 25, 2024 at 07:15:10PM +0300, stsp wrote:
Man page clearly talks about
"the userfaultfd object" (one object)
when mandating the "two-step handshake".
I spent hours of head-scratching
before went looking into the sources,
and even then I was confident the man
page is right: people should always assume
documentation is correct, code is buggy.
Hmm yes. I didn't pay much attention initially, but then after I read the
latest man-pages/, especially "UFFDIO_API(2const)" I found it looks indeed
wrong in the doc.

In this case we can't change the code because we need to keep it working
like before to not break ABI. We may still update the doc.
I wonder if some non-ABI-breaker
is possible, like eg keep the current
behavior of "features=0", but allow
to (optionally) override that by a
non-0 request? Yes, I've seen kselftests
are trying to double-register after 0,
but IIRC they tried to register wrong
options, which would fail anyway.