From nobody Mon Feb 9 23:14:44 2026 Received: from flow-a6-smtp.messagingengine.com (flow-a6-smtp.messagingengine.com [103.168.172.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A335B1632E7; Wed, 4 Feb 2026 05:08:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770181695; cv=none; b=i2gPW6BIWWDbUWrqnxY/Tl/JcB7IsxhMirjflJ91sDIW6XMajinMOWn4X27IlHGRoiabC/d2z1ISn2AA5/GCyNJpFkbL3zo5sapBqW9j7hdtLnYcoNYvPaT+FhqGjiqYj5GM92Bvl0jNd4ReGwmznJC3/ZakSOoaag+3jXMPDHM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770181695; c=relaxed/simple; bh=FB/uc3IA68XJYpoaP3UA2p1FkWkGkzu0EoP3vo0ZfU8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W7ZdYMflYHA0UCfsLai6FkkPnM6IH34h5QkOqZfiHyK4JCWZKu5GdbDvYWSqqYKCz4BbimdyjgNOgZ1epIBSvpLYxHSxt5ngpR2j50PJofftavMVh8tWHFVb9R878IZ+Er/QszgGRXNVESGLI2orE9K0112Six+G7noJY/T9XKA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ownmail.net; spf=pass smtp.mailfrom=ownmail.net; dkim=pass (2048-bit key) header.d=ownmail.net header.i=@ownmail.net header.b=DhtD8bzC; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=w89hP2rE; arc=none smtp.client-ip=103.168.172.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ownmail.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ownmail.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ownmail.net header.i=@ownmail.net header.b="DhtD8bzC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="w89hP2rE" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailflow.phl.internal (Postfix) with ESMTP id EA7B0138077B; Wed, 4 Feb 2026 00:08:14 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Wed, 04 Feb 2026 00:08:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ownmail.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:subject:subject:to:to; s=fm3; t=1770181694; x=1770188894; bh=3vylP70Td4gLvBkKBkP+NDaQ107NjHxVZqjmkf4RPM4=; b= DhtD8bzCE/oNQIkGTTjyqSX4LQFUqFhjVSWKj/iXxrgRLl9NMJgIFm1xZ4/+udL+ /9QWvwMQV6geJ18mtU4+cgzDERVj1ReQO2ExjsJaVPBAVXtasGRepSdMNCEs3Cen CSHYUma0vbM4ukuPPL8Z+pOn/nj6EBbbHKgw+8Uy+6hKfGk7XO7tQ6p6EyhH6c8C 6p87VF0V5HVZ3l4zZJvwKWrqJ1tuJ4YK8Vb4OGfaZgK4ZEwkYmQGCwmBQcSAAb+W YTqNDXuE4QXcuT2g5nwtYr+JVfmjJkqqHAoAEzlxhbyx6v3JmJad53Gh8DcrsokT ZZ8ubTAUQbE5Utbhr9g6Ng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1770181694; x=1770188894; bh=3 vylP70Td4gLvBkKBkP+NDaQ107NjHxVZqjmkf4RPM4=; b=w89hP2rEFqQl9e3q2 g2FP5CWLzoLxvBPctBENFDxM58CxydFLvse3FHdP6d0+csiZVe2ZvqhGTbwvpjLN 8RZExjMi7fsXAsrW2rNHsW8myHB3LnaOhRbyUB74IWtr8/qkS7dOTCDnbVKBtB1o TkoG0g9EuxvgI28XT+UnTGzKof8yNAjVTmIBkM2hvmtfEnwcacSmkVx000eCS3VM GKno6xlQSBDJjHWqV8Jzuvr5kjZ3q7qpw40XTCPMFdJu7SnRFt3E98DL/BqeNVEF P+RWyaXoyUXGMz2W7fIKHBAtXLUjLtTMg1lzqsBu+G8WvZ+9okCIlHHVcJNQBI95 IeHAQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddukedukeeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofgjfhhrggfgsedtkeertdertddtnecuhfhrohhmpefpvghilheu rhhofihnuceonhgvihhlsgesohifnhhmrghilhdrnhgvtheqnecuggftrfgrthhtvghrnh epveevkeffudeuvefhieeghffgudektdelkeejiedtjedugfeukedvkeffvdefvddunecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepnhgvihhlsg esohifnhhmrghilhdrnhgvthdpnhgspghrtghpthhtohepvddupdhmohguvgepshhmthhp ohhuthdprhgtphhtthhopehvihhrohesiigvnhhivhdrlhhinhhugidrohhrghdruhhkpd hrtghpthhtohepshgvlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphht thhopehlihhnuhigqdhunhhiohhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtg hpthhtoheplhhinhhugidqshgvtghurhhithihqdhmohguuhhlvgesvhhgvghrrdhkvghr nhgvlhdrohhrghdprhgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvg hlrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhn vghlrdhorhhgpdhrtghpthhtoheplhhinhhugidqfhhsuggvvhgvlhesvhhgvghrrdhkvg hrnhgvlhdrohhrghdprhgtphhtthhopehmihhklhhoshesshiivghrvgguihdrhhhupdhr tghpthhtohepjhgrtghksehsuhhsvgdrtgii X-ME-Proxy: Feedback-ID: iab3e480c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 4 Feb 2026 00:08:09 -0500 (EST) From: NeilBrown To: Christian Brauner , Alexander Viro , David Howells , Jan Kara , Chuck Lever , Jeff Layton , Miklos Szeredi , Amir Goldstein , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Stephen Smalley Cc: linux-kernel@vger.kernel.org, netfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-unionfs@vger.kernel.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org, selinux@vger.kernel.org Subject: [PATCH 01/13] fs/proc: Don't lock root inode when creating "self" and "thread-self" Date: Wed, 4 Feb 2026 15:57:45 +1100 Message-ID: <20260204050726.177283-2-neilb@ownmail.net> X-Mailer: git-send-email 2.50.0.107.gf914562f5916.dirty In-Reply-To: <20260204050726.177283-1-neilb@ownmail.net> References: <20260204050726.177283-1-neilb@ownmail.net> Reply-To: NeilBrown Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: NeilBrown proc_setup_self() and proc_setup_thread_self() are only called from proc_fill_super() which is before the filesystem is "live". So there is no need to lock the root directory when adding "self" and "thread-self". This is clear from simple_fill_super() which provides similar functionality for other filesystems and does not lock anything. The locking is not harmful, except that it may be confusing to a reader. As part of a an effort to centralise all locking for directories for name-based operations (prior to changing some locking rules), it is simplest to remove the locking here. Signed-off-by: NeilBrown Reviewed-by: Jeff Layton --- fs/proc/self.c | 3 --- fs/proc/thread_self.c | 3 --- 2 files changed, 6 deletions(-) diff --git a/fs/proc/self.c b/fs/proc/self.c index 62d2c0cfe35c..56adf1c68f7a 100644 --- a/fs/proc/self.c +++ b/fs/proc/self.c @@ -35,11 +35,9 @@ unsigned self_inum __ro_after_init; =20 int proc_setup_self(struct super_block *s) { - struct inode *root_inode =3D d_inode(s->s_root); struct dentry *self; int ret =3D -ENOMEM; =20 - inode_lock(root_inode); self =3D d_alloc_name(s->s_root, "self"); if (self) { struct inode *inode =3D new_inode(s); @@ -55,7 +53,6 @@ int proc_setup_self(struct super_block *s) } dput(self); } - inode_unlock(root_inode); =20 if (ret) pr_err("proc_fill_super: can't allocate /proc/self\n"); diff --git a/fs/proc/thread_self.c b/fs/proc/thread_self.c index d6113dbe58e0..61ac62c3fd9f 100644 --- a/fs/proc/thread_self.c +++ b/fs/proc/thread_self.c @@ -35,11 +35,9 @@ unsigned thread_self_inum __ro_after_init; =20 int proc_setup_thread_self(struct super_block *s) { - struct inode *root_inode =3D d_inode(s->s_root); struct dentry *thread_self; int ret =3D -ENOMEM; =20 - inode_lock(root_inode); thread_self =3D d_alloc_name(s->s_root, "thread-self"); if (thread_self) { struct inode *inode =3D new_inode(s); @@ -55,7 +53,6 @@ int proc_setup_thread_self(struct super_block *s) } dput(thread_self); } - inode_unlock(root_inode); =20 if (ret) pr_err("proc_fill_super: can't allocate /proc/thread-self\n"); --=20 2.50.0.107.gf914562f5916.dirty