Received: by 2002:a17:90a:b81:0:0:0:0 with SMTP id 1csp995167pjr; Fri, 30 Aug 2019 10:58:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOPp0iOJOkxHlKIzCJg7o6U8iu3OXK+K38ROIvYpnno0hlS8v/CmVK12O4+PsM829uzSfy X-Received: by 2002:a65:68cd:: with SMTP id k13mr13903121pgt.411.1567187926483; Fri, 30 Aug 2019 10:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567187926; cv=none; d=google.com; s=arc-20160816; b=Jv9ko9cAUOoDjEDsQN07lRaBGev1fuO98B9OVupWhVNSVMg5+rVrsfVJBkB3O17uSG gSXAWVMwFCY2Jv6NRLPD+DUId5ULyv0yBT3VtkK8wU+nFwf37gCMPOUCi4MyJcgsExvP xw4C2XYEv/a6SCyHjM4SzEvYmmCoxSYHOKrhw06X2pMO7rPP6i5tHe51qW5hfKRKvMCU mdz8YYaCfaiZJK6MhkLUB2p+qwXqZm+HX1RQ1P/9aWY3cQrp3qsE9LnaiVTJb+LeqVuz DpmE76crjd7Qzzqf4vih/EDbsUiKubXu69EEPY83MPcJPp7tjScPzFBqOY1RsUL2NRyU MCvQ== 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; bh=CRRFGDXVOv7qY9+84jhx5DeO42oZbPDNFejyfe+yRmY=; b=ixLg+SkAaJ/V/YdUZocVkPVsKvSO9h6L8ww/i8YlsVIYRujts/oBEzMUFgtKIYVsK3 YHN3C1AeOtRWj1//b9rU8o7CYiSNK3K2sdVB9+2aK6aFETA4OrnkU4Fghif2bPA1XNH7 7rYgeZ3ze5ACL6LAQ18EQxIhV8Lyq67FH+7Ms6qzr8BDCorFr11X3bdvjYOIhTm4opub 2ODrxA6vf2bF20FI1l2wY9Vm3rdPXxQKU54HHiXoo/kq1x0aQP3mIJUuLbW8TYBuOjFo h/IOQetkwubkhz2paEQj1Zvme4sYgePYG8bStnaeY7CBG9qqqFrPFPZAXyn7lZof/FlG Tn0A== 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 x10si6550999pfa.170.2019.08.30.10.58.21; Fri, 30 Aug 2019 10:58:46 -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 S1727891AbfH3R4J (ORCPT + 99 others); Fri, 30 Aug 2019 13:56:09 -0400 Received: from fieldses.org ([173.255.197.46]:51154 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727304AbfH3R4J (ORCPT ); Fri, 30 Aug 2019 13:56:09 -0400 Received: by fieldses.org (Postfix, from userid 2815) id BA6E3BD8; Fri, 30 Aug 2019 13:56:08 -0400 (EDT) Date: Fri, 30 Aug 2019 13:56:08 -0400 To: Olga Kornievskaia Cc: "J. Bruce Fields" , linux-nfs Subject: Re: [PATCH v5 5/9] NFSD add COPY_NOTIFY operation Message-ID: <20190830175608.GA5053@fieldses.org> References: <20190808201848.36640-1-olga.kornievskaia@gmail.com> <20190808201848.36640-6-olga.kornievskaia@gmail.com> <20190812200019.GB29812@parsley.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) 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 Thu, Aug 29, 2019 at 03:23:43PM -0400, Olga Kornievskaia wrote: > I'm stuck again. The idea that Trond gave me is to instead of storing > the pointer to the stateid, (copy) store the stateid_t structure > itself and then use it to look it up the appropriate nfs4_stid. > > The problem with that is when nfsd4_lookup_stateid() is called it > takes is a compound state (cstate) which has a client pointer and > during the lookup it's verified that the client looking up the stateid > is the same that generate the stateid which is not the case with copy > offload. > > I tried also saving a cl_clientid and using that to lookup the > nfs4_client that's needed for the stateid lookup but I'm not sure > that's possible. lookup_clientid() calls find_client_in_id_table() and > always passes "false" for sessions args. Original client has minor > version 2 and then the check if (clp->minor_versions != sessions) > fails. I don't understand what this logic is suppose to check. > > Should I be writing special version of the lookup_clientid that > ignores that check (when called in the path of the copy_notify > verification)? Or any other ideas of how to get passed this would be > appreciated it. Yeah, I think you may want to do the clientid lookup by hand under cl_lock, and take the cl_ref? Or turn things around and ensure that copy stateid's are destroyed before clients are. --b.