Re: [PATCH v2 2/4] Add fchmodat4(), a new syscall
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Palmer Dabbelt <palmer@xxxxxxxxxx>
- Subject: Re: [PATCH v2 2/4] Add fchmodat4(), a new syscall
- From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 17 Jul 2019 02:48:02 +0100
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-api@xxxxxxxxxxxxxxx, Arnd Bergmann <arnd@xxxxxxxx>, rth@xxxxxxxxxxx, ink@xxxxxxxxxxxxxxxxxxxx, mattst88@xxxxxxxxx, linux@xxxxxxxxxxxxxxx, catalin.marinas@xxxxxxx, will@xxxxxxxxxx, tony.luck@xxxxxxxxx, fenghua.yu@xxxxxxxxx, geert@xxxxxxxxxxxxxx, monstr@xxxxxxxxx, ralf@xxxxxxxxxxxxxx, paul.burton@xxxxxxxx, jhogan@xxxxxxxxxx, James.Bottomley@xxxxxxxxxxxxxxxxxxxxx, deller@xxxxxx, benh@xxxxxxxxxxxxxxxxxxx, paulus@xxxxxxxxx, mpe@xxxxxxxxxxxxxx, heiko.carstens@xxxxxxxxxx, gor@xxxxxxxxxxxxx, borntraeger@xxxxxxxxxx, ysato@xxxxxxxxxxxxxxxxxxxx, dalias@xxxxxxxx, davem@xxxxxxxxxxxxx, luto@xxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, hpa@xxxxxxxxx, x86@xxxxxxxxxx, peterz@xxxxxxxxxxxxx, acme@xxxxxxxxxx, alexander.shishkin@xxxxxxxxxxxxxxx, jolsa@xxxxxxxxxx, namhyung@xxxxxxxxxx, dhowells@xxxxxxxxxx, firoz.khan@xxxxxxxxxx, stefan@xxxxxxxx, schwidefsky@xxxxxxxxxx, axboe@xxxxxxxxx, christian@xxxxxxxxxx, hare@xxxxxxxx, deepa.kernel@xxxxxxxxx, tycho@xxxxxxxx, kim.phillips@xxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx
- In-reply-to: <20190717012719.5524-3-palmer@sifive.com>
- References: <20190717012719.5524-1-palmer@sifive.com> <20190717012719.5524-3-palmer@sifive.com>
- User-agent: Mutt/1.11.3 (2019-02-01)
On Tue, Jul 16, 2019 at 06:27:17PM -0700, Palmer Dabbelt wrote:
> -int do_fchmodat(int dfd, const char __user *filename, umode_t mode)
> +int do_fchmodat4(int dfd, const char __user *filename, umode_t mode, int flags)
> {
> struct path path;
> int error;
> - unsigned int lookup_flags = LOOKUP_FOLLOW;
> + unsigned int lookup_flags;
> +
> + if (unlikely(flags & ~AT_SYMLINK_NOFOLLOW))
> + return -EINVAL;
> +
> + lookup_flags = flags & AT_SYMLINK_NOFOLLOW ? 0 : LOOKUP_FOLLOW;
> +
Why not do that in sys_fchmodat4() itself, passing lookup_flags to
do_fchmodat() and updating old callers to pass it 0 as extra argument?
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]