Re: [PATCH v3] vfs: support statx(..., NULL, AT_EMPTY_PATH, ...)

From: Mateusz Guzik
Date: Wed Sep 25 2024 - 11:57:04 EST


On Wed, Sep 25, 2024 at 4:30 PM Xi Ruoyao <xry111@xxxxxxxxxxx> wrote:
> There's a special case, AT_FDCWD + NULL + AT_EMPTY_PATH, still resulting
> EFAULT, while AT_FDCWD + "" + AT_EMPTY_PATH is OK (returning the stat of
> current directory).
>
> I know allowing NULL with AT_FDCWD won't produce any performance gain,
> but it seems the difference would make the document of the API more
> nasty.
>
> So is it acceptable to make the kernel "hide" this difference, i.e.
> accept AT_FDCWD + NULL + AT_EMPTY_PATH as-is AT_FDCWD + "" +
> AT_EMPTY_PATH?
>

huh, that indeed makes sense to add. kind of weird this was not sorted
out at the time, but i'm not going to pointer a finger at myself :) so
ACK from me as far as the idea goes

I presume you can do the honors? :)

--
Mateusz Guzik <mjguzik gmail.com>