Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7663581ybi; Thu, 1 Aug 2019 11:42:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqywy9EkRaITCS+SqQqIxpeepeSrFX7y9W5oRAglGFaL+IVT7CcaRbRhQCsJrOmj5vsHdkHs X-Received: by 2002:a17:902:2aea:: with SMTP id j97mr114580495plb.153.1564684928874; Thu, 01 Aug 2019 11:42:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564684928; cv=none; d=google.com; s=arc-20160816; b=kgi5IPXuKMdEP7tj1Im57ta8rc7HVClJGFf7U///1hA1moiv9WSW+mejmoa2mHzUvT PxX/ImcNlPLrTQT4Kl/ErvLynehPmdQf41mN7AsgrU9Vf4Lw1FaryjoFBqIkYBO16pFt uyZeuhtkZe0fvuEgZO7TVimJyyOOZUiUKGJXNAoogr//QBmS2TQWOOh5NyUYUHX8cq42 BbxSDMAPTn3m/BhOwrfaH4kBbrC7sd6hHv4dJX9j2ltcTfQWlbCPKgB/qeQBbbFzDM6V tP0VifRYpBbKw8sbQipxcBk0cAlTc5/Ujj7vKGD9C1+Xr+B2DlkaMHM11viwh1f/9R6d 3uFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FykGvrwXfH/zKtdPtX60heHaryJB88Qcq9bs7kPOsQI=; b=oTtTXAmJExCr6nKf5JwD/6xsl5ETEq/60KibHHtq3HQ4VdNxO8xSM2LH3gDLA2Mphw 5f7fg+f3UhbkJO5bsO4tKWJxRdf4MfmkFd9rj6LdM9SfIscliKFfB9sInTATabemWhKN VbJqPXqMJhMB3QHB/0pBt6BJcWy1WUWqL/Qx2C65+HV0RGOJlj2MWaPqdyfbWndUzs9N z3KKL3pzR8eAYmGAai43+GonJeHRIUfxjFAq09t7nIo/qO4rMvhp8M3BZk3KKLy5aS4A QQZyYLADxGVLKgTXhm7CEENeNiZgoWxB6zvvCi7CHMxYjdQeb4jNVc8ovd1cvkUkD7/f p7lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X8nbkXEe; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si37522821pgl.52.2019.08.01.11.41.45; Thu, 01 Aug 2019 11:42:08 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X8nbkXEe; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729985AbfHASG7 (ORCPT + 99 others); Thu, 1 Aug 2019 14:06:59 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:33293 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbfHASG7 (ORCPT ); Thu, 1 Aug 2019 14:06:59 -0400 Received: by mail-vs1-f68.google.com with SMTP id m8so49590580vsj.0 for ; Thu, 01 Aug 2019 11:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FykGvrwXfH/zKtdPtX60heHaryJB88Qcq9bs7kPOsQI=; b=X8nbkXEeOs2JSd1RzPv8W5mmXp8IveD4XMyyz9e4n8hAjupaalwDpJp1BrA2qIs0zJ G8aiTznOlU9eLWQe6mnAUBEuwjetd7QiBII8zppYtuocYd9bHIzy6NPNw+7JpV15etlF +hMcwK/yTVAZaS5OViyyX+YoeM82hn+5Y6Gvs9+KmJG9JOCPlyqjUMFtcLWwRs640bYu 2xoa2SPifYfOGtZ+n39u7K9BqYfKFiRAaBS3mSQOTJV1NgKb7s7D+oHG2llGufL75PFO fXFMv+Ikblx6LJlCIbQ6pG0l/OXNMrkMIKZ1Nwl+OjwZVeRGEDA4pynI83ekgJ0VZdoU 2A8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FykGvrwXfH/zKtdPtX60heHaryJB88Qcq9bs7kPOsQI=; b=jPJDTasfy1/JL3itXOLVcxkJFkiLo1SvVWiWAXcZph68/8r7vin+kGxzZ2dv9y6BZC Vz344TJAPHOlP8FJ9j22aU14bBkpB8Q5KcHo9lHxdxTKtqnXn3DlsWA7gW9eGnAcbKAi TziXUahq0TPL9tsBfUJeE2PvYXIYSAzIqcalFKoSdxCZzpfFgSHYbWUm47Ta4QMauuv1 ljiabxpiikYB+SgJ1RhQ0RS3+uR3DF5No4OWxCG+k/Ls3d+yIjZ1wmChqBut9cYlxIUP IDcLmP0I8K6JgUHnN+2yA2xy6a0Xyqn7PtVsxMaI/MXEZH8COFeTlyxSPGUBVn0dTsM3 yY5Q== X-Gm-Message-State: APjAAAUST6iK20luuTNmLhTgc3si3Ipy9K7pAFSq8nQhR/2AuX0fwZ8e ygrXKTcmnVSp6NMItWrii2Uc7B5sUy4DWePO8XwBuA== X-Received: by 2002:a67:8907:: with SMTP id l7mr83822668vsd.194.1564682817716; Thu, 01 Aug 2019 11:06:57 -0700 (PDT) MIME-Version: 1.0 References: <20190708192352.12614-1-olga.kornievskaia@gmail.com> <20190708192352.12614-6-olga.kornievskaia@gmail.com> <20190719220116.GA24373@fieldses.org> <20190723205846.GB19559@fieldses.org> <20190731215118.GA13311@parsley.fieldses.org> <20190801151239.GC17654@fieldses.org> In-Reply-To: From: Olga Kornievskaia Date: Thu, 1 Aug 2019 14:06:46 -0400 Message-ID: Subject: Re: [PATCH v4 5/8] NFSD check stateids against copy stateids To: "J. Bruce Fields" Cc: "J. Bruce Fields" , linux-nfs Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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. > > > > > Worst case, if the network goes down for a couple minutes and > > > > the target tries to pick up a copy where it left off, it'll get > > > > PARTNER_NO_AUTH. I assume that results in the same error being returned > > > > the client, at which point the client knows that the copy_notify stateid > > > > may have installed and can do what it chooses to recover (like send a > > > > new copy_notify). > > > > > > Yes the client recovers but the cost of setting up the source server > > > to destination is huge so any retries would kill the performance. > > > > In the rare case when the server goes an entire cnr_lease_time between > > reads, the performance hit of recovery won't be an issue. > > > > > > The FREE_STATEID might also be a good idea, but I guess we can't count > > > > on it. > > > > > > > > Maybe the spec could use some errata to clarify that FREE_STATEID is > > > > allowed on copy_notify stateids, that clients should send it when > > > > they're done, and that servers are allowed to expire copy_notify > > > > stateid's even after their first use. > > > > > > FREE_STATEID is for a stateid > > > > The discussion of FREE_STATEID in 4.1 says "The FREE_STATEID operation > > is used to free a stateid that no longer has any associated locks > > (including opens, byte-range locks, delegations, and layouts)." A > > clarification that it can be used for any stateid would be nice. (Is > > that true? Do we want it for COPY stateid's too?) > > We don't need it for the COPY stateids as there is a OFFLOAD_CANCEL if > the client wants to stop, otherwise, the destination server has no > problems with knowing when to free the copy stateid. > > > > > --b. > > > > > which a copy_notify (or copy) stateid is so I don't see anything that > > > really needs any extra stating. > > > > > > I think what's needed is specifying that for COPY_NOTIFY a client must > > > do a FREE_STATEID when its done with a stateid.