From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BF23EB64DC for ; Tue, 11 Jul 2023 12:02:17 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=arndb.de header.i=@arndb.de header.a=rsa-sha256 header.s=fm2 header.b=cCXa+nxM; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=Nc7Rjk/7; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4R0fcl5Vhpz3cYs for ; Tue, 11 Jul 2023 22:02:15 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=arndb.de header.i=@arndb.de header.a=rsa-sha256 header.s=fm2 header.b=cCXa+nxM; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm2 header.b=Nc7Rjk/7; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=arndb.de (client-ip=66.111.4.229; helo=new3-smtp.messagingengine.com; envelope-from=arnd@arndb.de; receiver=lists.ozlabs.org) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) (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 lists.ozlabs.org (Postfix) with ESMTPS id 4R0fBB44K7z30fk for ; Tue, 11 Jul 2023 21:42:42 +1000 (AEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 62331580233; Tue, 11 Jul 2023 07:42:40 -0400 (EDT) Received: from imap50 ([10.202.2.100]) by compute6.internal (MEProxy); Tue, 11 Jul 2023 07:42:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1689075760; x=1689082960; bh=ky TmtQ94Bg/o37lAnBcJXDTnDF6sa4YBDC0JstTG714=; b=cCXa+nxMGpyNXEY2Hl iIY0GaQ43JSV/7Brik2QU47h/O0ZGLZmBA1fh2THtqGsZmVh1PfFp5JgGnQ99QYI HrnoMrGDJyobAtWFUHHRwshNaTbLw+QYTPibyEm3UtKtQHdEczFD/GX+wFTCR7PY HdkYFiCWZ8BRRCJEsd18s8XJtQb51J85MCJk1Hp/jMsfnqxG1wMrs5IYJcrx9Ojh QSLJ5qAqOwC2nvcU9CHMlcoGykzaAs44QtfyB4p6q4kE0bCSo+B2qg4AtZ52Jq5M 97dKJHlgmnM5uxgSMvmvRNuRulgf0CvpmSSn1qka9gsizGyWAWoLQ+Ra4ONnwqzS LCVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1689075760; x=1689082960; bh=kyTmtQ94Bg/o3 7lAnBcJXDTnDF6sa4YBDC0JstTG714=; b=Nc7Rjk/7PPAkaeKyL39OpIc/i58KX oQYRCp7e+QjDXcoMcU3wowrAjI/QFwUgLhpDrydps1157zxrnjzpMrxOBhEetTdx rjDnBmiWa5Y1J53R2WWzkP4jjvdoV64C5Aq8mpI+igvw1Ua1JfbDhuqN78pZg/Z4 nPLI2nz/XDzVaccl4hhk4vACPJV1zgYNiW9jQj4JEDXdjnFXJh6bacHzMqR0n6Bi fjIwPkszBsEtseU6+gVYwVatcu4zNWhinzneCSr+ZXsCa7nZAaW4LzHYtCKJTFZx JbIpq+r9AlQrC8eJcXSxMRUzqKyLAYG3AJzWtl0Mqgcs0vzVCloj8oT5Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrfedtgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpefffeefudevhfehgfejudffudfhjeeftdfhfedtffehieelgfekveeifedujeej ueenucffohhmrghinhepshhouhhrtggvfigrrhgvrdhorhhgpdhmuhhslhdqlhhisggtrd horhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep rghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3F8831700089; Tue, 11 Jul 2023 07:42:39 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-531-gfdfa13a06d-fm-20230703.001-gfdfa13a0 Mime-Version: 1.0 Message-Id: <83363cbb-2431-4520-81a9-0d71f420cb36@app.fastmail.com> In-Reply-To: References: <87o8pscpny.fsf@oldenburg2.str.redhat.com> Date: Tue, 11 Jul 2023 13:42:19 +0200 From: "Arnd Bergmann" To: "Alexey Gladkov" , LKML , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Alexander Viro" Subject: Re: [PATCH v3 2/5] fs: Add fchmodat4() Content-Type: text/plain X-Mailman-Approved-At: Tue, 11 Jul 2023 21:56:57 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , linux-ia64@vger.kernel.org, fenghua.yu@intel.com, Alexander Shishkin , Palmer Dabbelt , heiko.carstens@de.ibm.com, x86@kernel.org, stefan@agner.ch, ldv@altlinux.org, David Howells , Kim Phillips , Paul Mackerras , Deepa Dinamani , "H. Peter Anvin" , sparclinux@vger.kernel.org, Will Deacon , Linux-Arch , linux-s390@vger.kernel.org, hare@suse.com, Yoshinori Sato , Helge Deller , linux-sh@vger.kernel.org, Russell King , Christian Borntraeger , Ingo Molnar , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, Catalin Marinas , jhogan@kernel.org, firoz.khan@linaro.org, Matt Turner , Florian Weimer , gor@linux.ibm.com, Peter Zijlstra , glebfm@altlinux.org, tycho@tycho.ws, Arnaldo Carvalho de Melo , linux-m68k@lists.linux-m68k.org, Borislav Petkov , Andy Lutomirski , Namhyung Kim , Thomas Gleixner , christian@brauner.io, rth@twiddle.net, Jens Axboe , "James E . J . Bottomley" , Michal Simek , Tony Luck , linux-parisc@vger.kernel.org, linux-mips@vger.kernel.org, ralf@linux-mips.org, paul.burton@mips.com, linux-alpha@vger.kernel.org, schwidefsky@de.ibm.com, Ivan Kokshaysky , linuxppc-dev@lists.ozlabs.org, "David S . Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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