From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B29A606A32F for ; Sat, 5 Dec 2026 03:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=Q2ayQ8wW Received: by kanga.kvack.org (Postfix) id C94C96B05C6; Fri, 4 Dec 2026 22:46:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C1EBC6B05C8; Fri, 4 Dec 2026 22:46:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE6A66B05CB; Fri, 4 Dec 2026 22:46:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 731126B05C6 for ; Fri, 4 Dec 2026 22:46:59 -0500 (EST) Received: from smtpin12.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 390824057D for ; Sat, 5 Dec 2026 03:46:58 +0000 (UTC) X-FDA: 85508543316.12.D642FC7 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf07.hostedemail.com (Postfix) with ESMTP id A12EF4000C for ; Sat, 5 Dec 2026 03:46:56 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=Q2ayQ8wW; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796442416; b=w2r15lTduXllrxrWd8u3x3vPT7bBIzDGjruRQT2D1249b05xWhh5qti5nL4gr8GjrhubcN 4fLzy/u+MfFrYEsYHyXhnje2ztYhxK7l3VZSJmHIcsQfl9OQ88uT3InH9nvz+xrUswwFfI TxDGK+BnQ05obDe7f1vF9XbwH+agMgo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796442416; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DZlVf9oMtDiOXiD/gXCBRXgTqFa/2jAXyscg0ZPn/ik=; b=VUkyz0JVqVIt9F1/N9ymR+2+BdYtmSJWCYl6+hWh4v22qLpMLczAtyFpIM7d8E84wglFZ0 gPKYJPahEygrLvynrl2nh/NZ5HvurOCQlPn6odtlKhfO2RAW5EIaqstxpzKMne0sg/n6OS XD1NbZN8fAy9Z/8Z/dOlWfhyVt4TcL0= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=Q2ayQ8wW; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf07.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 2184960AA3; Sat, 5 Dec 2026 03:46:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78F411F0092B; Sat, 5 Dec 2026 03:46:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796442415; bh=DZlVf9oMtDiOXiD/gXCBRXgTqFa/2jAXyscg0ZPn/ik=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Q2ayQ8wWh58+tlSLNksRRXFfhO81nwS6hRgPMd1WarLwPn8LVeAFP17zDEbCzxOIx Y6mBq2WA4UY+eVB/mDfusuCKvU4LsPhIFCHKCrr7TzqmYC1C4uegsz9hWcq/RwM71d pSH1f+Y3DsuPpVP0VRX/D+XzzZJBhZXK6+bpqPcBUynHyOVVND21IRv17+ubrHAQZQ YzJ68Ib2ja5HDxygFY2qmXyrj4uuqGFemqpjZclHbxAERPmKCXhrUdt1v2rKMbvmku ccbtA1uTnxf2fv8yueiRAAEk/2FRoZXehclT6egO6UWA+WcDuaf+rdO5ZT15vX/Akr WHxaP98TbHLCQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [RFC PATCH v10 03/28] mount: Add mnt_ns_get_root() Reply-To: sashiko-reviews@lists.linux.dev To: "Jarkko Sakkinen" Cc: bpf@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, "Aleksa Sarai" , "Alexander Mikhalitsyn" , "Alexander Viro" , "Alexei Starovoitov" , "Andrew Morton" , "Andrii Nakryiko" , "Andy Lutomirski" , "Arnd Bergmann" , "Baolin Wang" , "Ben Segall" , "Christian Brauner" , "Daniel Borkmann" , "David Hildenbrand" , "David Howells" , "David Woodhouse" , "Davidlohr Bueso" , "Dietmar Eggemann" , "Eduard Zingerman" , "Emil Tsalapatis" , "Eric Biggers" , "Georgia Garcia" , "Giuseppe Scrivano" , =?utf-8?b?R8O8bnRoZXIgTm9hY2s=?= , "Hugh Dickins" , "Ihor Solodrai" , "Ingo Molnar" , "James Morris" , "Jan Kara" , "Jason Gunthorpe" , "Jeff Layton" , "Jiri Olsa" , "John Johansen" , "Jonathan Corbet" , "Josef Bacik" , "Juri Lelli" , "Kees Cook" , "K Prateek Nayak" , "KP Singh" , "Kumar Kartikeya Dwivedi" , "Lennart Poettering" , "Liam R. Howlett" , "Manfred Spraul" , "Martin KaFai Lau" , "Matt Bobrowski" , "Mel Gorman" , "Michal Hocko" , =?utf-8?b?TWlja2HDq2wgU2FsYcO8bg==?= , "Mike Rapoport" , "Neal Gompa" , "Oleg Nesterov" , "Paul Moore" , "Pavel Tikhomirov" , "Peter Zijlstra" , "Randy Dunlap" , "Serge E. Hallyn" , "Serge Hallyn" , "Shuah Khan" , "Song Liu" , "Stephen Smalley" , "Steven Rostedt" , "Valentin Schneider" , "Vincent Guittot" , "Yonghong Song" , "Zygmunt Krynicki" In-Reply-To: <20261205032633.1702772-4-jarkko@kernel.org> References: <20261205032633.1702772-1-jarkko@kernel.org> <20261205032633.1702772-4-jarkko@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 05 Dec 2026 03:46:53 +0000 X-Rspamd-Server: rspam04 X-Rspam-User: X-Rspamd-Queue-Id: A12EF4000C X-Stat-Signature: c7erwauzjt7nimn93r6teojpw5fweo5f X-Spam-Status: No, score=-11.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-HE-Tag: 1796442416-242275 X-HE-Meta: U2FsdGVkX1/KpBZa6PGazEWyYJl8v2RP4Jki1+Cmg6yEch++Bd34Y7gfqtmJkmhZsXR37KvtM0KAeKCnTRs5pDJmS4Q6jNS5iT0uHwTiiiprR6KuGEf/CPYCJ6d+JHnspKl+8f3OLUMSZkcN9HrwZLD4SQkE2U0RJWP0VKcEBE7xZLH7M08zK080ZzUtLBnMV4vaByt3zjUI3Gi12yKYbOPll+xJJfGWQuwRNEZfdTSYZenc0blpwJLpY9yY0kjUlJqhbNvkC/hVgMM4Fn6iwcVMeR6iVA3YWG3PmkiTDy8dU7VMwDfbWg6b3VBiqx+Hc0z4gh3eOOP6pOVeJMHhAoVpQUC9nndwyJQ+o8BVX+hzfbQxZbGBePom8ifnKkqSXcu8+zLKDZ50izSqCpMOhcRRCAFa9vaI3mhN3NSpP1HqQId6rU8Y5+vkkNBpofQiIINlJN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kBC2TMY+xZbbxnv8/CrC4HQ/tIkbO03LoYB9OE6epdGhyWzYzjsjam0ju9tG5/1apfGSu4QNyEBd9PvmmyCbR96lskXT2+/xx385aD/mLpd51o6hNaT7BYnLKXfDNfF4MzYQawfiar+L8Zl0Bg1P8EMNVOtPrkXawdsLSNPkdEwLBC8uxqT4jqDv5a4tlRpTQsYNg+kaLKbqeWfdU5kQCmSdVvTxgikh9XVf+d2GvS61LhNRFaO3ubXhzuh8eP4UDjUtDEvdhExN1bjUXGFlQI/Ap8WphKAc4mjLfbWJzsm3vWGbt58OR4K1+QQBWQnWAO2h/WeEzNgUjSoE8tvQWU9ddeml9SwRwQyF4R/S23FxpRKOYVd1ZOFv56O1dE8SlsjAKPIKQNEld0hVP8GKyRX9Zg== Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] mount: missing API contract documentation for mnt_ns_get_root() -- commit 6f336bfd8a54d1c830f04491f0b986e5e814490e Author: Jarkko Sakkinen mount: Add mnt_ns_get_root() This commit adds mnt_ns_get_root() and declares it in include/linux/mnt_namespace.h to resolve the live root path of a mount namespace, returning -ENOENT if no filesystem is mounted over the initial root. > diff --git a/fs/namespace.c b/fs/namespace.c > index aecd05ac01705..781380945d784 100644 > --- a/fs/namespace.c > +++ b/fs/namespace.c > @@ -6708,6 +6708,22 @@ static void mntns_put(struct ns_common *ns) > put_mnt_ns(to_mnt_ns(ns)); > } > =20 > +int mnt_ns_get_root(struct mnt_namespace *mnt_ns, struct path *root) > +{ > + int err; > + > + err =3D vfs_path_lookup(mnt_ns->root->mnt.mnt_root, &mnt_ns->root->mnt, > + "/", LOOKUP_DOWN, root); > + if (err) > + return err; > + if (root->mnt =3D=3D &mnt_ns->root->mnt) { > + path_put(root); > + *root =3D (struct path){}; > + return -ENOENT; > + } > + return 0; > +} [Severity: Low] Since mnt_ns_get_root() is exposed as a cross-subsystem helper in include/linux/mnt_namespace.h, should it have a kernel-doc comment documenting its preconditions and ownership rules? Callers must hold an active reference to a non-anonymous mount namespace, since mnt_ns->root is dereferenced without namespace_sem and anonymous namespaces do not use a nullfs base root. Because it calls vfs_path_lookup() and path_put(), it requires sleepable context without mount_lock or namespace_sem held. On success, the caller must release *root with path_put(); on -ENOENT *root is zeroed, while on other lookup errors it is left untouched. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261205032633.1702= 772-1-jarkko@kernel.org?part=3D3