From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D440C3A59B for ; Fri, 30 Aug 2019 17:56:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2A72E20659 for ; Fri, 30 Aug 2019 17:56:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727891AbfH3R4J (ORCPT ); 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.