Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1967848pxa; Sat, 29 Aug 2020 09:20:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyd2GEF1BTkRpCZnKAzNFSZ8tDfqGzORmSAbSKpzmqAFwMUttrX2x4uytrbF/DR2124HS1m X-Received: by 2002:a17:906:3a81:: with SMTP id y1mr4026173ejd.464.1598718037265; Sat, 29 Aug 2020 09:20:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598718037; cv=none; d=google.com; s=arc-20160816; b=H2k3bmn7tm2O4V3rRyJ70ITiHktv5xxtM0bNQKq2IPqN3DpMATZVH6lnHHbU9DUrgs uuftpVpQQ3hDmeQqU8zDGqbAxgIWiJAvSanvET7Ax/xTMcAUsDdu6PcpEXtLzqtzwz3L PrJZNI7bIXNCCJ99iG4ucO1a/kqYuSmEEZq4AlcIjhho5wzAogrXkFjUsZWZ79oikBbO Xbhmx2KAnuZgJ3abyzPoPtOHYPe7hSnUaV4sg+Y2XRfZMv61erEER5w18dOR3du8N9Zu KJQsZ8LbCW8gaMHzJQp39KZDQOvEDIui/mF0Wq03+FNGaYcYgPn+HG3pCPH6dL/McitW i7Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:dkim-signature:dkim-filter; bh=FhjKFb1Dta38cvLlcRJDNRQdAbwdCHq2DqpCz6gI56s=; b=PpMCN1isY1o1HY7SgHgYRN5u1lsF99WdQ2TT9aLEi6ZwgIFKsFQe/zIXHp9LgzhCCy 3aF4aTksH09rUaWzPGM4MhnQ9rliLgtAygMYzhmiNu+DbUzzkK7VmVBZKGbUUYzGdvmY HCZ/qaoVEaqdc4wKg6oJt4ruSBaZ8PaMBjCA5y1gaMtL5fJWVfLh4ioEgqeNiBG/L9CU P8/lWCS6tSB1xet47U9mAy2xLBYecMdOA+3VmDxd9g7G9X2O7y3pH1gRe70cnyYN4VDi bacwRTkwKPIG0y4eeq9D05X+2nix50rhg0yW3KxLJdWfSYiXcUfWBj97ibP9vVZjKj6t TYIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=r22BS8rQ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si1720347edt.444.2020.08.29.09.20.03; Sat, 29 Aug 2020 09:20:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@fieldses.org header.s=default header.b=r22BS8rQ; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728350AbgH2QRU (ORCPT + 99 others); Sat, 29 Aug 2020 12:17:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728310AbgH2QRU (ORCPT ); Sat, 29 Aug 2020 12:17:20 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05E1EC061236 for ; Sat, 29 Aug 2020 09:17:19 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id 9BB622012; Sat, 29 Aug 2020 12:17:18 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 9BB622012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1598717838; bh=FhjKFb1Dta38cvLlcRJDNRQdAbwdCHq2DqpCz6gI56s=; h=Date:To:Cc:Subject:References:In-Reply-To:From:From; b=r22BS8rQoiLIQy0Hex09yxu2ptkAu/fNXkHb28AwjIcL+3qH9vwH+gKspXhxkS5Ix ylyHfRGkm2Ejf96oMukhls9CNFoxHWhaH5i+l+sFLINTTUNLdKkISwURIlwgLUZsHS dL6IsWWrd0AuM6zS+yyYACFw9pO8JxkLEdlf6+po= Date: Sat, 29 Aug 2020 12:17:18 -0400 To: Trond Myklebust Cc: "anna.schumaker@netapp.com" , "chuck.lever@oracle.com" , "linux-nfs@vger.kernel.org" Subject: Re: [PATCH v1] NFS: Zero-stateid SETATTR should first return delegation Message-ID: <20200829161718.GC20499@fieldses.org> References: <159864470513.1031951.14868951913532221090.stgit@manet.1015granger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Fri, Aug 28, 2020 at 09:13:07PM +0000, Trond Myklebust wrote: > On Fri, 2020-08-28 at 15:58 -0400, Chuck Lever wrote: > > If a write delegation isn't available, the Linux NFS client uses > > a zero-stateid when performing a SETATTR. > > > > If that client happens to hold a read delegation, the server will > > recall it immediately, resulting in a short delay while the > > CB_RECALL operation is done. Optimize out this delay by having the > > client return any delegation it may hold on a file before issuing a > > SETATTR(zero-stateid) on that file. > > > > Signed-off-by: Chuck Lever > > --- > > fs/nfs/nfs4proc.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c > > index dbd01548335b..53a56250cf4b 100644 > > --- a/fs/nfs/nfs4proc.c > > +++ b/fs/nfs/nfs4proc.c > > @@ -3314,6 +3314,7 @@ static int _nfs4_do_setattr(struct inode > > *inode, > > goto zero_stateid; > > } else { > > zero_stateid: > > + nfs4_inode_return_delegation(inode); > > nfs4_stateid_copy(&arg->stateid, &zero_stateid); > > } > > if (delegation_cred) > > > > This should not be needed for NFSv4.1 or greater. Only NFSv4.0 is > incapable of identifying the caller and recognising that it is the > holder of the delegation. And the server should be getting this right now in the >=4.1 case, so let me know if you see otherwise. --b.