Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5264751yba; Tue, 30 Apr 2019 11:46:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOK4qYaA6lg3/fZFJc+RS2CK8xGf4X576WiWfQxuxIu7JOOvegv94IugyGwtvzSkiHsedE X-Received: by 2002:a63:9a52:: with SMTP id e18mr22804510pgo.335.1556649992680; Tue, 30 Apr 2019 11:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556649992; cv=none; d=google.com; s=arc-20160816; b=NHg5wnrUTQeiGLXdrfgCHgOwfN3bxu92xnHXLli62yEWsK1WW4bCK4q5IaxrJgFswQ ktAmwurxR7tEGsdplKYAASV5SRK0lLo9W91rMR34LLyCLWdWyaRubjxDMHsWLn/J5WMI 9gSfRu0ZVqgBI3oIqBZ0CeqLXo7RUhjjsp7zcSdwNPUnPTMtT67ibhgGwkCsL89J4mEA CHNAaF9U52y+LS3lq/aJNMuQdRAvtn5qjZo3utpBfne4u74dwvEqQ2Enj3Pu8Ekh2Ho+ fIzEFEcm9NsdQOFGQZaj5UBV24ew/TBoBf7Y6Of4FPOe3zc9PwRj6MFWGrfdMXyt6x+D jMrw== 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=9dzgxtFtk5tSERJUZwlK2D8P+qdrPEgf690kAqcfrcY=; b=ujfKFQsLYrsyzyFkn9i9ApMYDv7POIiu/2M6YXFYaOtW0CSAAgJ96BCUwnQPuY8DiJ Gmud5oX/GvOqEjgpFNxAaawCTsExt9dL+LOFIuBqOIhUokarjSJre3ihUYneaJBXPPj+ LwbtwaxWSH6W6RiphMnagDrUviiB7bgtvGsyfkhzsbmETu9CqmamJJZTLzdkw5F9+c/e SVikBLR6yYXR57WBvYrkYnOlShKryZWx8IWr5ExtyJxGciS6SQdsCR4/go6ucr64q0VU +oCrYmvJHpn+v0/YWwY1rBkMmUtzVpiDA+4zw6n90904leQFGWv3BzLGFzrGYHg9YESg kw3Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j127si41166406pfb.25.2019.04.30.11.46.18; Tue, 30 Apr 2019 11:46:32 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726115AbfD3SqQ (ORCPT + 99 others); Tue, 30 Apr 2019 14:46:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33964 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726056AbfD3SqQ (ORCPT ); Tue, 30 Apr 2019 14:46:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D77E308330B; Tue, 30 Apr 2019 18:46:15 +0000 (UTC) Received: from coeurl.usersys.redhat.com (ovpn-122-85.rdu2.redhat.com [10.10.122.85]) by smtp.corp.redhat.com (Postfix) with ESMTP id 56E2E183A9; Tue, 30 Apr 2019 18:46:15 +0000 (UTC) Received: by coeurl.usersys.redhat.com (Postfix, from userid 1000) id B096321BE8; Tue, 30 Apr 2019 14:46:14 -0400 (EDT) Date: Tue, 30 Apr 2019 14:46:14 -0400 From: Scott Mayhew To: Trond Myklebust Cc: "bfields@fieldses.org" , "linux-nfs@vger.kernel.org" , "jlayton@kernel.org" Subject: Re: [PATCH] nfsd: CB_RECALL can race with FREE_STATEID Message-ID: <20190430184614.GF15226@coeurl.usersys.redhat.com> References: <20190418132400.24161-1-smayhew@redhat.com> <20190418151312.GB29274@fieldses.org> <20190418205024.GB15226@coeurl.usersys.redhat.com> <15806b00f7ba569a109549eb551bb116d981226d.camel@hammerspace.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15806b00f7ba569a109549eb551bb116d981226d.camel@hammerspace.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 30 Apr 2019 18:46:15 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, 18 Apr 2019, Trond Myklebust wrote: > On Thu, 2019-04-18 at 16:50 -0400, Scott Mayhew wrote: > > On Thu, 18 Apr 2019, J. Bruce Fields wrote: > > > > > On Thu, Apr 18, 2019 at 09:24:00AM -0400, Scott Mayhew wrote: > > > > While trying to track down some issues involving large numbers of > > > > delegations being recalled/revoked, I caught the server setting > > > > SEQ4_STATUS_CB_PATH_DOWN while the client was actively responding > > > > to > > > > CB_RECALLs. It turns out that the client had already done a > > > > TEST_STATEID and FREE_STATEID for a delegation being recalled by > > > > the > > > > time it received the CB_RECALL. > > > > > > That's interesting, thanks! > > > > > > This exception seems awfully narrow, though. > > > > > > If we get back any NFS-level error at all, then I think the > > > callback > > > channel is working (am I wrong?) > > > > Correct, if the client replies with either NFS4ERR_DELAY or > > NFS4ERR_BAD_STATEID, the server will retry 1 time (see dl_retries). > > After that, we fall thru and nfsd4_cb_recall_done() returns -1 which > > causes the SEQ4_STATUS_CB_PATH_DOWN flag to be set. > > There is no handling of NFS4ERR_DELAY in nfsd4_cb_recall_done(). > > As far as I can see, therefore, if the client returns NFS4ERR_DELAY > (which it usually does if it is already in the process of returning the > delegation) then the recall will fail immediately. You're right, I had NFS4ERR_DELAY on the brain because I was seeing those periodically in conjunction with the BIND_CONN_TO_SESSION calls that were occurring while handling the bogus CB_PATH_DOWN flags from the server. -Scott > > > > and telling the client to set up a new > > > one is probably not going to help. The best we can do is probably > > > just > > > give up > > > > That's what the patch is essentially doing. Or are you saying don't > > even bother with the checks but still return 1 so we don't set the > > SEQ4_STATUS_CB_PATH_DOWN flag? > > > > > and let the client deal with the ensuing > > > RECALLABLE_STATE_REVOKED flag. > > > > The client's already dealing with the RECALLABLE_STATE_REVOKED flag, > > that's why it sent a TEST_STATEID and FREE_STATEID before it got this > > particular CB_RECALL. The idea behind the patch is to not give the > > state manager on the client additional work by setting CB_PATH_DOWN > > when > > the callback channel is clearly working... > > > > Either way, the Linux client will ignore any further sequence flags > until it is done with the recovery of the RECALLABLE_STATE_REVOKED > flag. The reason is that the flags are edge triggered (i.e. they don't > clear until the state changes), and so we need to be able to perform a > full recovery before we can check them again. > > -- > Trond Myklebust > Linux NFS client maintainer, Hammerspace > trond.myklebust@hammerspace.com > >