Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37077499rwd; Tue, 11 Jul 2023 09:09:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlEdE7+07JwsK8m5pdXFkE240+Kci2337GP+vp4PNT/RWh88lPtdF7clWR/GinR/hEYdE8fm X-Received: by 2002:a05:6a00:124c:b0:66b:6021:10fe with SMTP id u12-20020a056a00124c00b0066b602110femr20537192pfi.31.1689091741199; Tue, 11 Jul 2023 09:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689091741; cv=none; d=google.com; s=arc-20160816; b=DuOvaSXV8Bc7fHKdim/xT49bC0zPgm3CM8YcTkUet0siCEw1m6reXVu3Kc7M+t2Hp3 9kxCvoDUCuBVdip9Bt7GzJEtcoTDh+o5LEIuvDVrhMwZvWDp/kHi+mzfXpXUxWYuvnNY frXg9L7heQPJ2Zf4NCE2QLrvI0MZZwZzZXx5Hs0Go/nrx20vX706txKZUGe9A6hjrFeA PuCYT59fcVzDN/vtF40Nu1j1687lVh2P1XW5irvo2/4JXkx/aArtMdssTnXqK5IlP/rQ dIL/C7Zcp1IOtBKn6Y+dySLNceLBSIjL0U/Nf7K2ki1Azb953UMsyorAvkELwXwivj39 cbtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x9tWwKbDfzyZusxEDlpQGi4LRqWqRshdEX1OKG5/b6E=; fh=qlazM1zjbYXqeZcmWI/Hxn6U6IJyxMDGSPRdPLnw1FE=; b=mNsr5kGzDvrQt5iPQhlfMZ61m9FBQZjczaBuoVU41LDm2ebkuk6v0EVgWmhayOfr8G OTLylb3tkrUYdPxLh2B7watYKvgS8SYl+qXoDV2Jm5Xbb7tf6hthaQ9z8tt+WGfPn/HL 2cgdZ/B3rqxZ7j6Jmn25ABtc5oyuz31mF9zuUPk7SqrU4wkI/bQWaMsChB7clYAg//LD QFj69bjqyx5MuG8vE0+KGeC5pbZtrfRu7GTMgDa2PaBJ3LjZ9UqisrU8AnGt0no/JqQq hbT7eCSYH83gsACQ5GctMVJXhjUgwONby8s/tSwXQ6gPvuhVpkJE9Ry2567V3DEbP8HJ iHUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oEo8yqXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a056a0015d000b0066891ffdfd5si1683400pfu.358.2023.07.11.09.08.48; Tue, 11 Jul 2023 09:09:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oEo8yqXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232016AbjGKPYU (ORCPT + 99 others); Tue, 11 Jul 2023 11:24:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231846AbjGKPYO (ORCPT ); Tue, 11 Jul 2023 11:24:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FA5B10D4; Tue, 11 Jul 2023 08:24:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0D3C96155C; Tue, 11 Jul 2023 15:24:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46E26C433C8; Tue, 11 Jul 2023 15:23:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689089052; bh=nyE4suotIowU8lKnKt+Umw+WI2Pk9iMcLZepBf+apY8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oEo8yqXLBQcJ016nZmVI6o/nx3t9By5un0RV4fbIKnHDk0VPSpp+yaNMirBtqzWpT bol75aJRCGOWCT+N9yMrkrQVwEwDB8XWpgODtk3yI+ILPLq5smsYwABPzHWMi/M7KG kUQJPylWrx/7Ql611uTnEHF8Ca7MkikIUy5rcrlWGkGARPI3nHILM6AFuZYEin+imM n1HaEaVU7q0NQmuz7v6I6ZbkSVwp4NjRBykveJpCllqGcxPS/L657fKrCDqE1FNaLz 6d5tD55ouC0ebYXHDNhkXWIbv52u/QY77xgQ0vpiUD4ePJr/j3HQZKSAuDU9No0IwC 1j5Imns1pImTQ== Date: Tue, 11 Jul 2023 17:23:50 +0200 From: Alexey Gladkov To: Christian Brauner Cc: Arnd Bergmann , LKML , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, Alexander Viro , Palmer Dabbelt , "James E . J . Bottomley" , Arnaldo Carvalho de Melo , Alexander Shishkin , Jens Axboe , Benjamin Herrenschmidt , Christian Borntraeger , Borislav Petkov , Catalin Marinas , christian@brauner.io, Rich Felker , "David S . Miller" , Deepa Dinamani , Helge Deller , David Howells , fenghua.yu@intel.com, firoz.khan@linaro.org, Florian Weimer , Geert Uytterhoeven , glebfm@altlinux.org, gor@linux.ibm.com, hare@suse.com, heiko.carstens@de.ibm.com, "H. Peter Anvin" , Ivan Kokshaysky , jhogan@kernel.org, Kim Phillips , ldv@altlinux.org, linux-alpha@vger.kernel.org, Linux-Arch , linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, Russell King , linuxppc-dev@lists.ozlabs.org, Andy Lutomirski , Matt Turner , Ingo Molnar , Michal Simek , Michael Ellerman , Namhyung Kim , paul.burton@mips.com, Paul Mackerras , Peter Zijlstra , ralf@linux-mips.org, rth@twiddle.net, schwidefsky@de.ibm.com, sparclinux@vger.kernel.org, stefan@agner.ch, Thomas Gleixner , Tony Luck , tycho@tycho.ws, Will Deacon , x86@kernel.org, Yoshinori Sato Subject: Re: [PATCH v3 2/5] fs: Add fchmodat4() Message-ID: References: <87o8pscpny.fsf@oldenburg2.str.redhat.com> <83363cbb-2431-4520-81a9-0d71f420cb36@app.fastmail.com> <20230711-demolieren-nilpferd-80ffe47563ad@brauner> <20230711-verpennen-turnier-717bb9682e19@brauner> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230711-verpennen-turnier-717bb9682e19@brauner> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 11, 2023 at 04:01:03PM +0200, Christian Brauner wrote: > On Tue, Jul 11, 2023 at 02:51:01PM +0200, Alexey Gladkov wrote: > > 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 > > > > > > > > > > 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 > > > > > Signed-off-by: Alexey Gladkov > > > > > > > > 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 > > > > > > The system call itself is useful afaict. But please, > > > > > > s/fchmodat4/fchmodat2/ > > > > Sure. I will. > > Thanks. Can you also wire this up for every architecture, please? > I don't see that this has been done in this series. Sure. I have already added in all architectures as far as I can tell: $ diff -s <(find arch/ -name '*.tbl' |sort -u) <(git grep -lw fchmodat2 arch/ |sort -u) Files /dev/fd/63 and /dev/fd/62 are identical -- Rgrds, legion