Re: [PATCH] man/man2/fanotify_mark.2: AT_FDCWD plus NULL path doesn't work

Alejandro Colomar <[email protected]> Fri, 29 May 2026 23:45:50 +0200
Newsgroups org.kernel.vger.linux-man,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel
Message-ID <ahoIuOuC7q5M24dV@devuan>
Hi Jann, Amir,

On 2026-05-29T23:38:11+0200, Amir Goldstein wrote:
> On Fri, May 29, 2026 at 7:27 PM Jann Horn <[email protected]> wrote:
> >
> > The fanotify_mark.2 manpage claims that AT_FDCWD works with a NULL path,
> > but there is no kernel code for that - in fanotify_find_path(), in the
> > `if (filename == NULL)` block, the fd is only used for a normal FD
> > lookup.
> >
> > This was also already the case when this manpage was written back in
> > 2014, so remove the bogus documentation.
> >
> > Fixes: c200b422d ("fanotify_mark.2: New page documenting fanotify_mark(2)")
> > Signed-off-by: Jann Horn <[email protected]>
> 
> Hah,  never noticed this.
> Apparently, hallucinations already existed in 2014 :D
> 
> Acked-by: Amir Goldstein <[email protected]>

Thanks!  I've added the author of the fixed commit in the recipients.
I'll apply on Monday or so.


Have a lovely night!
Alex

> 
> > ---
> >  man/man2/fanotify_mark.2 | 8 --------
> >  1 file changed, 8 deletions(-)
> >
> > diff --git a/man/man2/fanotify_mark.2 b/man/man2/fanotify_mark.2
> > index e561ffd21..a3b77537c 100644
> > --- a/man/man2/fanotify_mark.2
> > +++ b/man/man2/fanotify_mark.2
> > @@ -560,14 +560,6 @@ defines the filesystem object to be marked.
> >  .IP \[bu]
> >  If
> >  .I path
> > -is NULL, and
> > -.I dirfd
> > -takes the special value
> > -.BR AT_FDCWD ,
> > -the current working directory is to be marked.
> > -.IP \[bu]
> > -If
> > -.I path
> >  is absolute, it defines the filesystem object to be marked, and
> >  .I dirfd
> >  is ignored.
> >
> > ---
> > base-commit: 9db8ca91f920b9aba40ed68de6b8da0ca9dbefaa
> > change-id: 20260529-fan-mark-cwd-1c760106eff9
> >
> > Best regards,
> > --
> > Jann Horn <[email protected]>
> >
> 

-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmoaCQcACgkQ64mZXMKQ
wqkzew//UtRs6a5IKolqwnQlnQdG1WpGhmJMeDziqCMW1df2nEh/obDXhqDoqWTW
imXqMfW8MVaFFCmkNw2+AiGY9VdtItxCo9MAjo6C/PgJLj93O1UtcTXDP6ai1w4s
hI68IYUq2EmI91NKYOBm8pSlzYIum1ohsWkw3tKmXxGqu1SlZBA4TzIHpQvsxLnH
uCSy3ruFFwcdgnJMH8WTU71oQwS9FQd7mda74YmzFfj0iFOG3lk5tncy+ifQYPF5
Qb1vR50JlYUG0vvPd7MGtFCK/I/JCqeyFr99fISEl3o664w5S5+TrHmMYzStg2I7
EW3WPoHpUiFNpWawVNu9W9fWuqAOCvUrUzfk7VKPRkVUIK4PR24MYhhS+mtQmr+z
PZVUjcs25OVHNi44PF2XSX5nxMY7kddHlFVrm+iRtzKa4+bkP5XMQ6ePYaIicwzg
MNUmxCkJedhsP0pu9qUNRJqgtHsuMdv50Q4n1RhQRwyk8WjgxRe1tYMtUk0cqVM3
OMXbvjDdd+bsCzuLnhT5AGGZrouv8XapsdqeiW2mG77bpZipw1d0vxLniL1AkzlQ
ZVQgBwjjqZCm/QU7duQpt9KQ2TU5pS+eyOsaUgUlFHQFjEkVFuvdVOnfWamnGzz4
ki1u6rQKuBeqj6YMl5MLGMRxgp4Q5j/bXMorR1CDb9yPrMwi/8A=
=gXT6
-----END PGP SIGNATURE-----