From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.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 D92882AD00; Thu, 10 Sep 2026 00:29:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.156 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789000199; cv=none; b=pAUG66myCEhrmSc2NiBQpfHZqjAWbCQwCLpVxU9//cViuzitJtJFBYTwIMTXgRiyNmQcFg9D1XU4ONe6ntpyahhGIF0GWsdf77qkElHoaynXxbmXIX9CAO302rmiAMjy2Z4lfasEiEHYi5j2jrAOUhSfISUCAAPM3YgYVT3bhww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789000199; c=relaxed/simple; bh=wuxeMKnYN3RnSZ46XBbO0/SV7rqJKWQ5KA5JbCF8KjM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DeVkA6Ee6R7Dp6TwspWYQ2K742/dSP1L3ugqtkioXalHifiR9nAo79jZnL2ke+Kpuf1vTEF03GK2GdB0rVZggN6Io+BXvySjIjNeAYBw/kTzUxrfaV/2q/AuGecBz0oXEwxnzRxG4Iv6CyAiCE9jsgSwmm9HepyP6ruf9C8y7gY= 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=YSeaN4tm; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=gp5pmDii; arc=none smtp.client-ip=202.12.124.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="YSeaN4tm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="gp5pmDii" Received: from phl-compute-03.internal (phl-compute-03.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 0B1E67A00DF; Wed, 9 Sep 2026 20:29:57 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Wed, 09 Sep 2026 20:29:57 -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=fm1; t=1789000196; x=1789086596; bh=skfRaEYRr9ReYf+krhPtkr1pz+ybtTzKpNmMOROloTo=; b= YSeaN4tm83cO1jt+o6ong9om0WGdgYZH60UAcWij785xgA/Y3JM9+Wn/h0jw6id3 q+ZqFaaL7TyzKI/ozZLGIGQOuYkaO9YHI8u6/OxhojcwMwpwD9cEaw3PmnqkQ6bZ 7fOKOqMGWt1aDJwztfsytuMKyV/l3dlpu5eOJ9WeHEgICFUtpVM6ewbXTZB660VO Nz2AIvGlI4vOBcxJF/4wS1agH0ffkaAZKzrr5MUI0gef4s6tKXltkQXvnyWx34aP M1Zxw2ASvUgQxrZOb38OerOMdpLd88yX/jGUnG3hJHeu5mMLHLVTNyMZBDem8KqW 6xvsSsM9KfJodw3n76TmsQ== 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=fm1; t=1789000196; x=1789086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25brrOd3/gLO/kEedD8IPoiAjzLNh94tq6FEokvR25/KkGCnQ X-ME-Proxy: Feedback-ID: i9d664b8f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 9 Sep 2026 20:29:54 -0400 (EDT) From: NeilBrown To: Alexander Viro , Christian Brauner , Chuck Lever , Jeff Layton Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH 2/7] vfs: O_NONBLOCK|O_CREAT open shouldn't wait for directory delegation Date: Thu, 10 Sep 2026 10:20:48 +1000 Message-ID: <20260910002934.192979-3-neilb@ownmail.net> X-Mailer: git-send-email 2.50.0.107.gf914562f5916.dirty In-Reply-To: <20260910002934.192979-1-neilb@ownmail.net> References: <20260910002934.192979-1-neilb@ownmail.net> Reply-To: NeilBrown Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: NeilBrown An open() of a regular file can block if there is an active lease on that file, but this can be prevented by opening with O_NONBLOCK. An open(O_CREAT) of a non-existent file can block if there is an active delegation on the parent directory but this CANNOT be prevented with O_NONBLOCK. If nfsd is to use common VFS code for open/create it needs to be able to prevent this blocking. It is conceivable that a user-space application might need this too. So extend O_NONBLOCK protection to not block on a directory delegation when creating a file. Fixes: 134796f43a5e ("vfs: break parent dir delegations in open(..., O_CREAT) codepath") Signed-off-by: NeilBrown --- fs/namei.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/namei.c b/fs/namei.c index c9ac703110f8..c4be59213352 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -4554,7 +4554,12 @@ static struct dentry *lookup_open(struct nameidata *nd, struct file *file, goto out_dput; } - error = try_break_deleg(dir_inode, LEASE_BREAK_DIR_CREATE, &delegated_inode); + if (op->open_flag & O_NONBLOCK) + error = try_break_deleg(dir_inode, LEASE_BREAK_DIR_CREATE, + NULL); + else + error = try_break_deleg(dir_inode, LEASE_BREAK_DIR_CREATE, + &delegated_inode); if (error) goto out_dput; -- 2.50.0.107.gf914562f5916.dirty