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

Alejandro Colomar <[email protected]> Tue, 2 Jun 2026 00:19:39 +0200
Newsgroups org.kernel.vger.linux-man,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel
Message-ID <ah4FXUpcE-6xlcDs@devuan>
Hi,

On 2026-05-29T23:45:55+0200, Alejandro Colomar wrote:
> 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.

I've applied the patch and tag now.  Thanks!


Have a lovely night!
Alex

> 
> 
> 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>



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

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmoeBXoACgkQ64mZXMKQ
wqmSKQ/+OB9qZsXi0bFw5jXsbSic3/Z1rzCXQ+cBWfkikbxPIrHk0izfD9Qx9Azs
3pRZu56HL5ygbdjTLUwgMM5zu8GQ8p9aTfl/HAm4TxVBa0PPqO9ZY4+B1QiqR4HZ
jW0QNZWLh7AsFJ/fIxMV7QPogB9l2rml90dHTuTNfYgIqjvpuDXTNxnuHkC8NFrD
vL66WGgUVPRrNd4iIlqxBMdThxBS7P/5zQctgS42oRtMmJhzYZq52q4nnxEg9kGm
P00pxwLR2qZbOaQfc0mdhkIcu9HU9jDBekbnTEpqw/oFoGTDGfl7zgGSEPVCjWox
tIWvbJFrXRFAGxn5KdRYOyK/y0nuiW4lh0h/fARy4fAND0h9QiR8TNkZbv09Csec
aEHp99ydR3yELLtbUinc/QNZ0xv5iOgzVdAdqjZZNeUjm2/wwRkW7I9mdeZf0DTL
3D9aTK+eKS8rGqOw+lSkxdPQ+BY4Mkqqe0GvxgGeb77MjmVBWX/hExnFxwTZGarv
TKh9fmQIeHP3d9auQfomP/rEZHrId6m915sJW9Gf0myif/YRMvbAbRyoIzT056Dp
jMNtQh1lR8CFHHnElpkgYt7yLsaWeyeUV1WSNJ5xZ17vOKX/AqxIHysycSnen1fc
jpXrucVD0wBMzRhNarejoCV8/rQeHrSi2hHiD6Jo4XuobP+nhDQ=
=8Bu2
-----END PGP SIGNATURE-----