From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow-a2-smtp.messagingengine.com (flow-a2-smtp.messagingengine.com [103.168.172.137]) (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 2F6FB33A9C4; Tue, 24 Feb 2026 22:25:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.137 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771971962; cv=none; b=CX1XtqMiUWoFYxxNbwiRWqB8t26d3UIuL+thzkn7Mbw+CQxw7xOT+/MjAjTCapb0/8F/Uk7GHwLWAqAlgXUrFPRWuM/D6XYNRHdRm7HdbiianuSVNjJYXY0t1Of5UNu0K8L1q+Tl2VRiA++QVhrfSitfoIUPY2wJGB2+lkxRFDo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771971962; c=relaxed/simple; bh=XNsgNmZoNlsbdzYWAoyx+rMJkU0C5hWhl58m7ePFqX8=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JMAVZm8FpKEv8A1iJbO3iKwS+SwnPZZCQKWuAbC4LVyjaXIEe70ednw5htv9S3FVtVkMQLWjiJgu0akPfEKA/8kTFxsDADBWZJVaaql8i/W4i9ss8Fq/tYyvgZ+O0wstU2TVH4sexWAZcJk7l+YNf13f8Cw4v09HTw/R81JIkd8= 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=Bm41EYvD; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=YVWCZYzt; arc=none smtp.client-ip=103.168.172.137 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="Bm41EYvD"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YVWCZYzt" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailflow.phl.internal (Postfix) with ESMTP id 3CA271380B87; Tue, 24 Feb 2026 17:25:58 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 24 Feb 2026 17:25:58 -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:message-id:mime-version:reply-to:reply-to:subject :subject:to:to; s=fm3; t=1771971958; x=1771979158; bh=h1rNXkHkcZ 4cMhepaUBJCHY4sMt0fLPm1jE4sfNdLx8=; b=Bm41EYvDY3wWjoKO9Dg4GQs+K7 cZ+9rkdCqW4DWg2/n02Xxhll8WET1UKRv2xjVnyISv5eTeXPxw9lMuqv5LWlj2/l YzC39szJXiGzqhHmPIW5unvAljd9AINf44jC46QUbSkxJC4Uzj5S8g9wTyymc5eK 6umAKASGZ5SNoXvX4WYCPTmKnbviVxKOlaNXi81+nMH7HsX3Dwh2OQCaVce5MXUm TOefBGwt4W4JhCs2+rPA2w1fHcgyz/0nJrkPoTgnTm7f1ragqA5M49ZsUqF41+Lz 48FljGfvzG8iuI1HHzhizGeeqEg7uEPgx68xfh1Fw0MLAPKTcktOG4vlSi/g== 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:message-id:mime-version:reply-to:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1771971958; x=1771979158; bh=h1rNXkHkcZ4cMhepaUBJCHY4sMt0 fLPm1jE4sfNdLx8=; b=YVWCZYztzFJEgw0/P15jwVo2Zq6mHpQLCPU8/3LKBLGh 57MvUxA/kPjZOfEgwroCqeJIvAocpDonpTTzeO7VkSd0vdcYEgfAjfz1S+J27yPH ibp9xn/SlbXIOAANLTgfTdZ1VBtOVuFLNu74RzyUBZ2rzwFmi84V1lO1ee7nU5eU Swv0iwDFvsYUytGKwUXuWkuDN3ReejDJF50ww/Sv1JfeqxdlO97psVCMg5qpJdLN l5589hLjqQ/AdCfNnx6DH184ui/VMrHllibdRaU1oS7s4SUxTuLHTlhmeIUXIPmc 3w/hA6dPTMTYuh/8a/5BjLr6Ydwxhtk1buo0GnixtA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvgedufeejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhephffvvefufffkofhrggfgsedtkeertdertddtnecuhfhrohhmpefpvghilheurhho fihnuceonhgvihhlsgesohifnhhmrghilhdrnhgvtheqnecuggftrfgrthhtvghrnhepge etfeegtddtvdeigfegueevfeelleelgfejueefueektdelieeikeevtdelveelnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepnhgvihhlsgesoh ifnhhmrghilhdrnhgvthdpnhgspghrtghpthhtohepvddvpdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehvihhrohesiigvnhhivhdrlhhinhhugidrohhrghdruhhkpdhrtg hpthhtohepshgvlhhinhhugiesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthho pehlihhnuhigqdhunhhiohhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpth htoheplhhinhhugidqshgvtghurhhithihqdhmohguuhhlvgesvhhgvghrrdhkvghrnhgv lhdrohhrghdprhgtphhtthhopehlihhnuhigqdhnfhhssehvghgvrhdrkhgvrhhnvghlrd horhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghl rdhorhhgpdhrtghpthhtoheplhhinhhugidqfhhsuggvvhgvlhesvhhgvghrrdhkvghrnh gvlhdrohhrghdprhgtphhtthhopehmihhklhhoshesshiivghrvgguihdrhhhupdhrtghp thhtohepjhgrtghksehsuhhsvgdrtgii X-ME-Proxy: Feedback-ID: i9d664b8f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Feb 2026 17:25:50 -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 , "Darrick J. Wong" 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 v3 00/15] Further centralising of directory locking for name ops. Date: Wed, 25 Feb 2026 09:16:45 +1100 Message-ID: <20260224222542.3458677-1-neilb@ownmail.net> X-Mailer: git-send-email 2.50.0.107.gf914562f5916.dirty Reply-To: NeilBrown Precedence: bulk X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Following Chris Mason's tool-based review, here is v3 with some fixes. Particularly 06/15 mistakenly tested the result of start_creating for NULL and 09/15 had some really messed up flow in error handling. Also human-language typos fixed. This code is in github.com:neilbrown/linux.git branch pdirops For anyone interested, my next batch is in branch pdirops-next Original patch description below. Thanks, NeilBrown I am working towards changing the locking rules for name-operations: locking the name rather than the whole directory. The current part of this process is centralising all the locking so that it can be changed in one place. Recently "start_creating", "start_removing", "start_renaming" and related interaces were added which combine the locking and the lookup. At that time many callers were changed to use the new interfaces. However there are still an assortment of places out side of fs/namei.c where the directory is locked explictly, whether with inode_lock() or lock_rename() or similar. These were missed in the first pass for an assortment of uninteresting reasons. This series addresses the remaining places where explicit locking is used, and changes them to use the new interfaces, or otherwise removes the explicit locking. The biggest changes are in overlayfs. The other changes are quite simple, though maybe the cachefiles changes is the least simple of those. I'm running the --overlay tests in xfstests and nothing has popped yet. I'll continue with this and run some NFS tests too. Thanks for your review of these patches! NeilBrown [PATCH v3 01/15] VFS: note error returns in documentation for various [PATCH v3 02/15] fs/proc: Don't lock root inode when creating "self" [PATCH v3 03/15] VFS: move the start_dirop() kerndoc comment to [PATCH v3 04/15] libfs: change simple_done_creating() to use [PATCH v3 05/15] Apparmor: Use simple_start_creating() / [PATCH v3 06/15] selinux: Use simple_start_creating() / [PATCH v3 07/15] nfsd: switch purge_old() to use [PATCH v3 08/15] VFS: make lookup_one_qstr_excl() static. [PATCH v3 09/15] ovl: Simplify ovl_lookup_real_one() [PATCH v3 10/15] cachefiles: change cachefiles_bury_object to use [PATCH v3 11/15] ovl: pass name buffer to ovl_start_creating_temp() [PATCH v3 12/15] ovl: change ovl_create_real() to get a new lock when [PATCH v3 13/15] ovl: use is_subdir() for testing if one thing is a [PATCH v3 14/15] ovl: remove ovl_lock_rename_workdir() [PATCH v3 15/15] VFS: unexport lock_rename(), lock_rename_child(),