Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1359549ybp; Wed, 9 Oct 2019 12:52:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqzJNuzTuJv7KLpk169G1umkrdl+KGXO2jRgo+M0cVw05JewlHVoVzNBhKSIsY9U+1BKNG6F X-Received: by 2002:a17:906:f254:: with SMTP id gy20mr4713076ejb.180.1570650721186; Wed, 09 Oct 2019 12:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570650721; cv=none; d=google.com; s=arc-20160816; b=n+vW16x1HOGq1Su6Ocn7v0NDrUo6APTKIT5MCHTX+OlDLXmjl8ij498d9weheQaMOG uzVQeeeRBYZvaAiwDfDj6Qtf81bzSsiVwPANV/kYrGWAQJ769tZT2laORwBJTExsFJKo 5Q+YD1kyxkmTxMP5ZdoHGR/QDRuhtfyZp3BGnLmLGJOVyYJZd0Y+7vAKY6dGY0fD6haZ KINDglYnLWlw+i1leb41MsOkYOmauK1105Bq6bcRyrogfXf7bcEZoS9hzmfeOo45nTcl LLlNlVQB9hJdbeq4LYUr68SftmVs4zDqNLmIdbTHrLIMk/gBvb3YHNLz9z9KET+yCfDl 1LEA== 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=Xbswt7Daz/j4uFkXEc4r1kMA4OfFbLEDMT6py6VJ5o4=; b=ljjdbpBekPy2mRVHMZbBwcDmACQi9kHUwGpDIN34TxjxiWb41ErXZhHoyedCam0if8 p/5gGnKFhXSwgBuw25lHW2FG/KSxGvYTns/RIctklkpmM3NW7nzcOCEiRtDyiLnbkmbe txnOGL+F/+mC8NDhK+jZZa3bgbAsx6mXGe/FhT0U7Gk3NCDoyeiU+26IMU8Wo5zOXFL9 owWj1jre4aNk4clhUEW2aQZPjYfxe4ChxNsRwH9Hy11AdMcp7Ir09DclODKzWb9wooPT rlkK0qe+MTE/hCd33+ohf+baoExsx4hhK4VvfpnW2EWTs5qeEC2WcbpHLR2tyLvUR8Zj VYfg== 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 re18si1841687ejb.96.2019.10.09.12.51.27; Wed, 09 Oct 2019 12:52:01 -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 S1730490AbfJITvW (ORCPT + 99 others); Wed, 9 Oct 2019 15:51:22 -0400 Received: from fieldses.org ([173.255.197.46]:48438 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728804AbfJITvW (ORCPT ); Wed, 9 Oct 2019 15:51:22 -0400 Received: by fieldses.org (Postfix, from userid 2815) id EBBE71C24; Wed, 9 Oct 2019 15:51:21 -0400 (EDT) Date: Wed, 9 Oct 2019 15:51:21 -0400 From: "J. Bruce Fields" To: Scott Mayhew Cc: chuck.lever@oracle.com, linux-nfs@vger.kernel.org Subject: Re: [PATCH] nfsd4: fix up replay_matches_cache() Message-ID: <20191009195121.GA23703@fieldses.org> References: <20191009191137.28007-1-smayhew@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191009191137.28007-1-smayhew@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Oct 09, 2019 at 03:11:37PM -0400, Scott Mayhew wrote: > When running an nfs stress test, I see quite a few cached replies that > don't match up with the actual request. The first comment in > replay_matches_cache() makes sense, but the code doesn't seem to > match... fix it. Thanks, I'll apply. But I'm curious whether you're seeing any practical impact from this? I don't think it should matter. --b. > > Fixes: 53da6a53e1d4 ("nfsd4: catch some false session retries") > Signed-off-by: Scott Mayhew > --- > fs/nfsd/nfs4state.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index c65aeaa812d4..08f6eb2b73f8 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -3548,12 +3548,17 @@ static bool replay_matches_cache(struct svc_rqst *rqstp, > (bool)seq->cachethis) > return false; > /* > - * If there's an error than the reply can have fewer ops than > - * the call. But if we cached a reply with *more* ops than the > - * call you're sending us now, then this new call is clearly not > - * really a replay of the old one: > + * If there's an error then the reply can have fewer ops than > + * the call. > */ > - if (slot->sl_opcnt < argp->opcnt) > + if (slot->sl_opcnt < argp->opcnt && !slot->sl_status) > + return false; > + /* > + * But if we cached a reply with *more* ops than the call you're > + * sending us now, then this new call is clearly not really a > + * replay of the old one: > + */ > + if (slot->sl_opcnt > argp->opcnt) > return false; > /* This is the only check explicitly called by spec: */ > if (!same_creds(&rqstp->rq_cred, &slot->sl_cred)) > -- > 2.17.2