Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7664368ybi; Thu, 1 Aug 2019 11:43:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpYlJ2NTccU+zvI5oGaIpNCPowK/mrrTT1K73/uFyIucFIITqvZ/ErhBPw7hLz5G22D/fA X-Received: by 2002:a17:902:e30d:: with SMTP id cg13mr127198851plb.173.1564684982496; Thu, 01 Aug 2019 11:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564684982; cv=none; d=google.com; s=arc-20160816; b=qBO/2b8B78CavGNYwV6/1GRuL5zDIyIjcdwxsTuphaK5z6YbqppB3uIn+5sMyJczoo /O3GxFv3GNFuj7vQ0O4lwG3QeTSYgYMhsb+2rfFYGh0E5/lDtYVpFSNKGU8wyZnTJfeB Or21EyDhVwuNZqjw8aMAS60/aBlHZiaCtO973LDA+RWxBwF41wAuOg2c/Ngx1bTxkhji F/RbHerS3WRQWl5YVxRAa42n0kxC/00ePqAQa4pSbKbs/Dhr9XoLIEoDg2FDxIL66Ba9 /DbOhXN/UoeS8ckirMtS0DkwF3/SeIv/2OALyfYeRhYhQqshkPqQzJO1ey+cADX62pW2 9ciA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Z09ibNtGJxzxkfnYDGT2hpKIQhLUZZUfeQSirsYOic0=; b=mOeeC7zWzsB2uqNo+BqOZA6Qysu0Z/J1ZV20qMGBx4+4KYRnfFCVbcy40/yxGN5IB3 Z5Qjt/C+AUdSBCeigdEAwQ8R3pxiBX/Tw4TJEpxsMCWMlfa16TVQThtIqCbLY4PaSM7v Y/NKv016ufXRg9mfJ7wyglcX5OsigWzimA54I0Acj4S6DR36oXyNeykzUuWGkMd0Xn7l k225LH8zX1Qx61HAZelSbdDBiJ5b/JvqX6wituIhc77iEBuSEtDX4W+dBQyStFuFjn84 EOh92jMupGa7rCe0IPOnESN++ZqeBuocjykYFKl/12Z+fFtsMxVT7GRvB7S4WoirtLBI 3qpQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f34si4849140pgb.527.2019.08.01.11.42.47; Thu, 01 Aug 2019 11:43:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732904AbfHASL6 (ORCPT + 99 others); Thu, 1 Aug 2019 14:11:58 -0400 Received: from fieldses.org ([173.255.197.46]:44232 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732012AbfHASL6 (ORCPT ); Thu, 1 Aug 2019 14:11:58 -0400 Received: by fieldses.org (Postfix, from userid 2815) id 480BD7CB; Thu, 1 Aug 2019 14:11:58 -0400 (EDT) Date: Thu, 1 Aug 2019 14:11:58 -0400 From: "J. Bruce Fields" To: Olga Kornievskaia Cc: "J. Bruce Fields" , linux-nfs Subject: Re: [PATCH v4 5/8] NFSD check stateids against copy stateids Message-ID: <20190801181158.GC19461@fieldses.org> References: <20190719220116.GA24373@fieldses.org> <20190723205846.GB19559@fieldses.org> <20190731215118.GA13311@parsley.fieldses.org> <20190801151239.GC17654@fieldses.org> 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) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Aug 01, 2019 at 02:06:46PM -0400, Olga Kornievskaia wrote: > On Thu, Aug 1, 2019 at 11:41 AM Olga Kornievskaia > wrote: > > > > On Thu, Aug 1, 2019 at 11:13 AM J. Bruce Fields wrote: > > > > > > On Thu, Aug 01, 2019 at 10:12:11AM -0400, Olga Kornievskaia wrote: > > > > On Wed, Jul 31, 2019 at 5:51 PM J. Bruce Fields wrote: > > > > > > > > > > On Wed, Jul 31, 2019 at 05:10:01PM -0400, Olga Kornievskaia wrote: > > > > > > I'm having difficulty with this patch because there is no good way to > > > > > > know when the copy_notify stateid can be freed. What I can propose is > > > > > > to have the linux client send a FREE_STATEID with the copy_notify > > > > > > stateid and use that as the trigger to free the state. In that case, > > > > > > I'll keep a reference on the parent until the FREE_STATEID is > > > > > > received. > > > > > > > > > > > > This is not in the spec (though seems like a good idea to tell the > > > > > > source server it's ok to clean up) so other implementations might not > > > > > > choose this approach so we'll have problems with stateids sticking > > > > > > around. > > > > > > > > > > https://tools.ietf.org/html/rfc7862#page-71 > > > > > > > > > > "If the cnr_lease_time expires while the destination server is > > > > > still reading the source file, the destination server is allowed > > > > > to finish reading the file. If the cnr_lease_time expires > > > > > before the destination server uses READ or READ_PLUS to begin > > > > > the transfer, the source server can use NFS4ERR_PARTNER_NO_AUTH > > > > > to inform the destination server that the cnr_lease_time has > > > > > expired." > > > > > > > > > > The spec doesn't really define what "is allowed to finish reading the > > > > > file" means, but I think the source server should decide somehow whether > > > > > the target's done. And "hasn't sent a read in cnr_lease_time" seems > > > > > like a pretty good conservative definition that would be easy to > > > > > enforce. > > > > > > > > "hasn't send a read in cnr_lease_time" is already enforced. > > > > > > > > The problem is when the copy did start in normal time, it might take > > > > unknown time to complete. If we limit copies to all be done with in a > > > > cnr_lease_time or even some number of that, we'll get into problems > > > > when files are large enough or network is slow enough that it will > > > > make this method unusable. > > > > > > No, I'm just suggesting that if it's been more than cnr_lease_time since > > > the target server last sent a read using this stateid, then we could > > > free the stateid. > > > > That's reasonable. Let me do that. > > Now that I need a global list for the copy_notify stateids, do you > have a preference for either to keep it of the nfs4_client structure > or the nfsd_net structure? I store async copies under the nfs4_client > structure but the laundromat traverses things in nfsd_net structure. If copy_notify stateids are associated with a client, then they must already be reachable from the client somehow so they can be destroyed at the time the client is, right? I'm saying that without looking at the code.... --b.