From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (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 5C2E335F5F8; Mon, 27 Apr 2026 03:38:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777261110; cv=none; b=aS1xE70X30czKoKcek2Vxk5gIRLXwvcxZp3PR6T21fd7r6NOt01cCUS8nRLYN3AU1KM/vxAe6823QYCJg0jy8pwxIqZ0habhzFX21Gf270Iokhd8Gme1PEe92H7d3HhFDi2gD8Eo/mLwubdv/3f91cwEtGqwro09ICacHI0QH2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777261110; c=relaxed/simple; bh=OZQWUCnhioPXbHh6CEr0ZrXkezJBRAJa3irRrT0VBn8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EO+hQNC0C3UfUkV9TSzPkSk68ePC0RADfOtZdwyi7NsgNiN1HJG6swvZr1ca+QGltgiiU+77zASxi7CNyJejip2GrbLtEmYXsj69MgaKIO1F7mYIhkhtkTmxTYetzzx+221CoFIpoeY9slc4QjTqFHbYdO2aHv96I3qv5ISPhEA= 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=hijXe/p5; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=eWDh03XU; arc=none smtp.client-ip=103.168.172.156 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="hijXe/p5"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="eWDh03XU" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 9205D14000D4; Sun, 26 Apr 2026 23:38:28 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sun, 26 Apr 2026 23:38:28 -0400 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=fm2; t=1777261108; x=1777347508; bh=d0uUDizqtFn5TUR93S5pcu2hPzZI0J+S0qM13hNSWw4=; b= hijXe/p59lm5VAyWu4/5fOUPxLG5POT3G2UwtwwdHk2CTFvOrQathIVCy8jXGjt1 S8zp7cLunv7fYOGqWQ6DKXfpFB65hdktuyCJnUTIlMTyiMWktO28uxZk+GUWqDBo m7l2jBdSL4Ll7YT0lJuMZTt0rm3juh2KvEX+16N1jRp4zx0QX+leMW/VF+LSlhOs wYUwx6TLjPFS/5zm3WjZCuLRyMCqJD0Vu58q4mjLZrxmaj2YvuZKngnhHgRnRZfX SqAIN+qRzSZCD/dT0TchjQRGeP+n8hl+fwFj1ZXzH3Z/k7P5dYqT9DDkDsbNg9wX U2kEe9XauFjWOd2fZ9trfw== 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=fm2; t=1777261108; x=1777347508; bh=d 0uUDizqtFn5TUR93S5pcu2hPzZI0J+S0qM13hNSWw4=; b=eWDh03XUzL3d9HgpS OdMc6goLtXJjkBRhdI1Kc8ahZeQuS6lYVjzgyIUuROdYpSxccSFusTSOihV/1Trr 6Lyg3G/9snsRaL4KotmkQeb37mefyGuORUbnUZGJvFMm30knu5h8d4+bF9Vdi8md MPpeH3devEjtFeUkOd9cV/RagSLyjNXWPO1PgZCsnqV0SbhsP/eod9bRY+OcRcYC bvBZcwsIq/pWiOdo05KaX+C4mgN0aBARnf8n3lcB8lYuYFV2YULesddovpKFvuAR K4jjIW1CMkLuY+MuKDJLMyYsTjyRmkNT2e2VMGZKNsRIN0BU7FEaPvBRdyFh4DWa ulb8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdejjeeivdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufffkffojghfrhgggfestdekredtredttdenucfhrhhomheppfgvihhluehr ohifnhcuoehnvghilhgssehofihnmhgrihhlrdhnvghtqeenucggtffrrghtthgvrhhnpe evveekffduueevhfeigefhgfdukedtleekjeeitdejudfgueekvdekffdvfedvudenucev lhhushhtvghrufhiiigvpeefnecurfgrrhgrmhepmhgrihhlfhhrohhmpehnvghilhgsse hofihnmhgrihhlrdhnvghtpdhnsggprhgtphhtthhopedujedpmhhouggvpehsmhhtphho uhhtpdhrtghpthhtohepvhhirhhoseiivghnihhvrdhlihhnuhigrdhorhhgrdhukhdprh gtphhtthhopehlihhnuhigqdhunhhiohhnfhhssehvghgvrhdrkhgvrhhnvghlrdhorhhg pdhrtghpthhtoheplhhinhhugidqnhhfshesvhhgvghrrdhkvghrnhgvlhdrohhrghdprh gtphhtthhopehlihhnuhigqdhfshguvghvvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg pdhrtghpthhtoheplhhinhhugidqvghfihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprh gtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdprhgtphht thhopehmihhklhhoshesshiivghrvgguihdrhhhupdhrtghpthhtohepjhgrtghksehsuh hsvgdrtgiipdhrtghpthhtohepjhhksehoiihlrggsshdrohhrgh X-ME-Proxy: Feedback-ID: i9d664b8f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Apr 2026 23:38:23 -0400 (EDT) From: NeilBrown To: Linus Torvalds , Alexander Viro , Christian Brauner , Jan Kara , Jeff Layton , Trond Myklebust , Anna Schumaker , Miklos Szeredi , Amir Goldstein , Jeremy Kerr , Ard Biesheuvel , Christoph Hellwig Cc: linux-efi@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel Subject: [PATCH v2 19/19] nfs: use d_duplicate() Date: Mon, 27 Apr 2026 13:29:52 +1000 Message-ID: <20260427033527.773006-20-neilb@ownmail.net> X-Mailer: git-send-email 2.50.0.107.gf914562f5916.dirty In-Reply-To: <20260427033527.773006-1-neilb@ownmail.net> References: <20260427033527.773006-1-neilb@ownmail.net> Reply-To: NeilBrown Precedence: bulk X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: NeilBrown As preparation for d_alloc_parallel() being allowed without the directory locked, use d_duplicate() to duplicate a dentry for silly rename. Signed-off-by: NeilBrown --- fs/nfs/dir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index ee4b9b1a484f..dd48dea8bc40 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2778,11 +2778,9 @@ int nfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, spin_unlock(&new_dentry->d_lock); /* copy the target dentry's name */ - dentry = d_alloc(new_dentry->d_parent, - &new_dentry->d_name); + dentry = d_duplicate(new_dentry); if (!dentry) goto out; - /* silly-rename the existing target ... */ err = nfs_sillyrename(new_dir, new_dentry); if (err) @@ -2847,8 +2845,10 @@ int nfs_rename(struct mnt_idmap *idmap, struct inode *old_dir, nfs_dentry_handle_enoent(old_dentry); /* new dentry created? */ - if (dentry) + if (dentry) { + d_lookup_done(dentry); dput(dentry); + } return error; } EXPORT_SYMBOL_GPL(nfs_rename); -- 2.50.0.107.gf914562f5916.dirty