On Thu, Aug 01, 2019 at 02:06:46PM -0400, Olga Kornievskaia wrote: > On Thu, Aug 1, 2019 at 11:41 AM Olga Kornievskaia > <olga.kornievskaia@xxxxxxxxx> wrote: > > > > On Thu, Aug 1, 2019 at 11:13 AM J. Bruce Fields <bfields@xxxxxxxxxxxx> 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 <bfields@xxxxxxxxxx> 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.