Re: [PATCH v3 2/5] fs: Add fchmodat4()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Christian Brauner <brauner@xxxxxxxxxx>
- Subject: Re: [PATCH v3 2/5] fs: Add fchmodat4()
- From: Alexey Gladkov <legion@xxxxxxxxxx>
- Date: Tue, 11 Jul 2023 14:51:01 +0200
- Cc: Arnd Bergmann <arnd@xxxxxxxx>, LKML <linux-kernel@xxxxxxxxxxxxxxx>, linux-api@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxx>, "James E . J . Bottomley" <James.Bottomley@xxxxxxxxxxxxxxxxxxxxx>, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>, Jens Axboe <axboe@xxxxxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, christian@xxxxxxxxxx, Rich Felker <dalias@xxxxxxxx>, "David S . Miller" <davem@xxxxxxxxxxxxx>, Deepa Dinamani <deepa.kernel@xxxxxxxxx>, Helge Deller <deller@xxxxxx>, David Howells <dhowells@xxxxxxxxxx>, fenghua.yu@xxxxxxxxx, firoz.khan@xxxxxxxxxx, Florian Weimer <fweimer@xxxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, glebfm@xxxxxxxxxxxx, gor@xxxxxxxxxxxxx, hare@xxxxxxxx, heiko.carstens@xxxxxxxxxx, "H. Peter Anvin" <hpa@xxxxxxxxx>, Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>, jhogan@xxxxxxxxxx, Kim Phillips <kim.phillips@xxxxxxx>, ldv@xxxxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, Linux-Arch <linux-arch@xxxxxxxxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, Russell King <linux@xxxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx, Andy Lutomirski <luto@xxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Namhyung Kim <namhyung@xxxxxxxxxx>, paul.burton@xxxxxxxx, Paul Mackerras <paulus@xxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, ralf@xxxxxxxxxxxxxx, rth@xxxxxxxxxxx, schwidefsky@xxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, stefan@xxxxxxxx, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, tycho@xxxxxxxx, Will Deacon <will@xxxxxxxxxx>, x86@xxxxxxxxxx, Yoshinori Sato <ysato@xxxxxxxxxxxxx>
- In-reply-to: <20230711-demolieren-nilpferd-80ffe47563ad@brauner>
- References: <87o8pscpny.fsf@oldenburg2.str.redhat.com> <cover.1689074739.git.legion@kernel.org> <d11b93ad8e3b669afaff942e25c3fca65c6a983c.1689074739.git.legion@kernel.org> <83363cbb-2431-4520-81a9-0d71f420cb36@app.fastmail.com> <20230711-demolieren-nilpferd-80ffe47563ad@brauner>
On Tue, Jul 11, 2023 at 01:52:01PM +0200, Christian Brauner wrote:
> On Tue, Jul 11, 2023 at 01:42:19PM +0200, Arnd Bergmann wrote:
> > On Tue, Jul 11, 2023, at 13:25, Alexey Gladkov wrote:
> > > From: Palmer Dabbelt <palmer@xxxxxxxxxx>
> > >
> > > On the userspace side fchmodat(3) is implemented as a wrapper
> > > function which implements the POSIX-specified interface. This
> > > interface differs from the underlying kernel system call, which does not
> > > have a flags argument. Most implementations require procfs [1][2].
> > >
> > > There doesn't appear to be a good userspace workaround for this issue
> > > but the implementation in the kernel is pretty straight-forward.
> > >
> > > The new fchmodat4() syscall allows to pass the AT_SYMLINK_NOFOLLOW flag,
> > > unlike existing fchmodat.
> > >
> > > [1]
> > > https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/fchmodat.c;h=17eca54051ee28ba1ec3f9aed170a62630959143;hb=a492b1e5ef7ab50c6fdd4e4e9879ea5569ab0a6c#l35
> > > [2]
> > > https://git.musl-libc.org/cgit/musl/tree/src/stat/fchmodat.c?id=718f363bc2067b6487900eddc9180c84e7739f80#n28
> > >
> > > Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxx>
> > > Signed-off-by: Alexey Gladkov <legion@xxxxxxxxxx>
> >
> > I don't know the history of why we ended up with the different
> > interface, or whether this was done intentionally in the kernel
> > or if we want this syscall.
> >
> > Assuming this is in fact needed, I double-checked that the
> > implementation looks correct to me and is portable to all the
> > architectures, without the need for a compat wrapper.
> >
> > Acked-by: Arnd Bergmann <arnd@xxxxxxxx>
>
> The system call itself is useful afaict. But please,
>
> s/fchmodat4/fchmodat2/
Sure. I will.
> With very few exceptions we don't version by argument number but by
> revision and we should stick to one scheme:
>
> openat()->openat2()
> eventfd()->eventfd2()
> clone()/clone2()->clone3()
> dup()->dup2()->dup3() // coincides with nr of arguments
> pipe()->pipe2() // coincides with nr of arguments
> renameat()->renameat2()
>
--
Rgrds, legion
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]