Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp562293lqb; Sat, 16 Mar 2024 17:21:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWFrKRnL7vGhGNp+haYf5IEeYSi9VTwzILHvfz6icfISIHX+VMWxY77YJyLy4QbeReQYeCw4X6DGsao1/641hYX50sJlMYRYIskEGDhyg== X-Google-Smtp-Source: AGHT+IF1LwVJMYgGACC5fEZCrUP0owxm6+3Yfv8I/AM7C0yhTCiPKOp6+ISH87wBMiE7o/ArRNfA X-Received: by 2002:a05:6808:150c:b0:3c3:5a72:ccaf with SMTP id u12-20020a056808150c00b003c35a72ccafmr10736003oiw.47.1710634820341; Sat, 16 Mar 2024 17:20:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710634820; cv=pass; d=google.com; s=arc-20160816; b=HeOjJVrC8tlT9VKJ5lqV5XrEkDHJq8idnZ+BMjF3OwvPWUwopkRiNTERkY9HeF+Wdo K+YvW0Hfx/Fim95D/KdZzhJa9gTDbDSmtXWwmyUFXwor8crv2JenLnt9hCv3WhdEC36z 3mZGOrv4VUx48W2gGCJL3MNUniYBR8LSTV6rLKGlG93fmX4P6e0Zam/ulwHBROEDT85r dnZHvoLdtV6s5Rp6ZGy8uftkVp8PoXRsV29reMQ74psAbGJa5mOwaw0muzT/JBr227yR 0tpFzkozKI6wUWJY/uAHomtZObioEdc0mlBERVgNLZyWKmKeNParovEf1d/IWhnOec13 hcfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=vNFR3lw8tC7KxXpl4rLTji3eLA1sO/3QyZ+IkaIx3oE=; fh=yKvN2B1aBsvo+2ye58zbuNVoaMBxMB5TV2lH01LHNZY=; b=ptbu0zEcV+m8oQi3H27w6doHnSnq1NPs/hnbPu3sVDxYqq8QyTNOHz+jb6rNcBgqu7 cNbmMK/2tiH8zjjDyTzo3TsVi0zfkYjXfy3axABniGfAWgFHIP6r1jV5K3M2E+G6fhxJ UZYfrd9N26zSerN9iC6H2VzUCmkRXtpYyhccCbnT0iwAcC+e3YkBt6hUQEgYPQnQU4E9 Frez/YL8agbPmfZVPsUeJR1xgTd6BfCtAdvn30184WP1MDaBOeDrZL3pDjflgj+pxmsF IVL0AhtMqY8+TWVJDOGgoECjCfdflEJaqvFz/rMcSCUNgWn7Y5KtKMRlejc0e88XN2iZ OjZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="q2/txhjx"; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-nfs+bounces-2357-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l17-20020a05622a051100b00430c97962cdsi333708qtx.303.2024.03.16.17.20.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Mar 2024 17:20:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-2357-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="q2/txhjx"; arc=pass (i=1 dkim=pass dkdomain=linux.org.uk dmarc=pass fromdomain=zeniv.linux.org.uk); spf=pass (google.com: domain of linux-nfs+bounces-2357-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-2357-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 073C51C2112E for ; Sun, 17 Mar 2024 00:20:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C4A6536B; Sun, 17 Mar 2024 00:20:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="q2/txhjx" X-Original-To: linux-nfs@vger.kernel.org Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (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 2BB15173; Sun, 17 Mar 2024 00:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.89.141.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710634814; cv=none; b=gajE9s6RMjowM37Si6OfU5VxMfS+WSNxflgJhxs1NLv9anGK7yFLQZMGFclcAFX2jM2HPumNwG2K9dbS8vPwK7NqUDtrj+oCQ6Xanq5OrUbFQhUKSyjCquLZNM3Qho2bGMVC0ZnbLGywd/TJZJCCo3i3gtfdd1fSNo91YCjWP3I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710634814; c=relaxed/simple; bh=RSWZD1v5bT2/4QWHR19SfGfX5WLV0cIFofyKHF8Sx70=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uDxnPKnIkG13SM6iDnp4eisFc1NKToAyWhCcgRLzfDul0WSvw728KWaa8TcYnMm2MvRiqgNw8BwVQ/dkeoYVp9Js0x7aQEp0KDccrGPYEPxK6FzIvl244FdeP1E8SCrrCtt8BDbTpWkY0BM/9C222fc40qiJ7rzh9nDjaUcSlsU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk; spf=none smtp.mailfrom=ftp.linux.org.uk; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b=q2/txhjx; arc=none smtp.client-ip=62.89.141.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=vNFR3lw8tC7KxXpl4rLTji3eLA1sO/3QyZ+IkaIx3oE=; b=q2/txhjxnqcuFklxGYkyLxcJvw LITqgzNsi0+rrWfMhl+X3vm3DYFjZx5Vg3SuZH4Dq8y4yQmaU7L06oNeuMijNTH51MqDtahdDyoij cxqoeYVtMmM0Xtp27vHfeM2c9LLMF5Ja2YleCR6dr+EyvNFcLbwvqorOAEYQB/JGt38rJs4J4+yOA Y3zNY0IhRV26pdZPZUglMWHY0kg5CZZj76j1dfcJoqEvAljiLxR+a60a4ln3Lv2nccnYtcblOKG6u J2HN+clbPRduyGz0JESVN0UrxwWCTijF7rMm3el9r+VLGq3jfaD/O7yxYub0k3fuv/zUBjzwU5GUx rYFZgf2g==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rleFa-00Ai2U-1m; Sun, 17 Mar 2024 00:19:42 +0000 Date: Sun, 17 Mar 2024 00:19:42 +0000 From: Al Viro To: Jeff Layton Cc: Christian Brauner , Jan Kara , Chuck Lever , Alexander Aring , Trond Myklebust , Anna Schumaker , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Greg Kroah-Hartman , "Rafael J. Wysocki" , David Howells , Tyler Hicks , Neil Brown , Olga Kornievskaia , Dai Ngo , Miklos Szeredi , Amir Goldstein , Namjae Jeon , Sergey Senozhatsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, netfs@lists.linux.dev, ecryptfs@vger.kernel.org, linux-unionfs@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH RFC 06/24] vfs: break parent dir delegations in open(..., O_CREAT) codepath Message-ID: <20240317001942.GJ538574@ZenIV> References: <20240315-dir-deleg-v1-0-a1d6209a3654@kernel.org> <20240315-dir-deleg-v1-6-a1d6209a3654@kernel.org> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240315-dir-deleg-v1-6-a1d6209a3654@kernel.org> Sender: Al Viro On Fri, Mar 15, 2024 at 12:52:57PM -0400, Jeff Layton wrote: > In order to add directory delegation support, we need to break > delegations on the parent whenever there is going to be a change in the > directory. > > Add a delegated_inode parameter to lookup_open and have it break the > delegation. Then, open_last_lookups can wait for the delegation break > and retry the call to lookup_open once it's done. > @@ -3490,6 +3490,11 @@ static struct dentry *lookup_open(struct nameidata *nd, struct file *file, Wait a sec - are you going to do anything to the atomic_open side of things? > /* Negative dentry, just create the file */ > if (!dentry->d_inode && (open_flag & O_CREAT)) { > + /* but break the directory lease first! */ > + error = try_break_deleg(dir_inode, delegated_inode); > + if (error) > + goto out_dput;