Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp643948yba; Fri, 3 May 2019 08:11:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHDAA1CfQzcKSq2dY4OV1xATWkGAqqjdKzl4jvlXpoxeEj97N7toWmUP5GwGz8QhMZeGCj X-Received: by 2002:a63:f448:: with SMTP id p8mr11063162pgk.50.1556896302072; Fri, 03 May 2019 08:11:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556896302; cv=none; d=google.com; s=arc-20160816; b=hCFYlZDmYz83QvxVwbA56iqHc2CGTxMZY23QQgDp1k7Rnb0F4a6rz6P/zMHFTEu+ek 7NYNQmxz35CWDH0hv6ZJm0a6baF+eKaZM/z7nuYxyQsRxGYgw4IzU9lJRPNP8Du3UR49 1fjZy1ct08fx/y5gaylEo6eN7bUQizrI5wRyM90VQvAgaEC+VFxFedvdtOrQ9unB7QYC nWbTDdHLBxhVEvm9xx0y/QAqtgtuA7zDoYMbvea8mSMuFbXXjiGJGBCHd8bWrEeHAhGb rrAfsMWYR5vvJlnol9ts/Mdk9X8xG26RcZjYf7yMgHKzzl3Q0CxREQmMyLr1L0vkSAl9 z1Gw== 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=1CqpXQ9F+mMufbbmIL9BgtpKuKMITbwWswoe/XvRS/s=; b=cZ6DV9oWKj5DlD/W3kcHXLpWwWliK73z/mUm5YxI+FpI3ofAW1ng29rBhZiy16uuKU AGcxWqIp965WH+d0bc//NVjme7lSK8LVGfhb3843p7WfeOxtOsdS2Knly5ohj/9tmGLa bu1wcS84gFZMbjNuNzYv3QQgokri2o3AYZS0ML4n75MAicHgQUHgvmVPTAh1lJFjSCa8 dyfNmtUXQJR7WoOl6JavKsKzBic9XkGnMF2XLu1PM/pNz4ErfR6t+di6lbAXBZE/2GLC 9nsRtXm25mu37aOwXI7zCb9dMCdgu4v7v2EZBVujP7VGtK45cZbjKHlCfRQu9G+9hX7A TquQ== 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 b1si2586363pgb.51.2019.05.03.08.11.16; Fri, 03 May 2019 08:11:42 -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 S1728239AbfECPKW (ORCPT + 99 others); Fri, 3 May 2019 11:10:22 -0400 Received: from fieldses.org ([173.255.197.46]:54352 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbfECPKW (ORCPT ); Fri, 3 May 2019 11:10:22 -0400 Received: by fieldses.org (Postfix, from userid 2815) id E8E611CC9; Fri, 3 May 2019 11:10:21 -0400 (EDT) Date: Fri, 3 May 2019 11:10:21 -0400 From: "J. Bruce Fields" To: Scott Mayhew Cc: jlayton@kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH] nfsd: update callback done processing Message-ID: <20190503151021.GF12608@fieldses.org> References: <20190502173212.9530-1-smayhew@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190502173212.9530-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 Thanks, looks good! Added one more paragraph with what you'd originally seen (see below), and applied for 5.2. I haven't added a stable cc, since I didn't think you'd established that this in itself was causing a major problem--tell me if I'm wrong. --b. commit 1c73b9d24f80 Author: Scott Mayhew Date: Thu May 2 13:32:12 2019 -0400 nfsd: update callback done processing Instead of having the convention where individual nfsd4_callback_ops->done operations return -1 to indicate the callback path is down, move the check to nfsd4_cb_done. Only mark the callback path down on transport-level errors, not NFS-level errors. The existing logic causes the server to set SEQ4_STATUS_CB_PATH_DOWN just because the client returned an error to a CB_RECALL for a delegation that the client had already done a FREE_STATEID for. But clearly that error doesn't mean that there's anything wrong with the backchannel. Additionally, handle NFS4ERR_DELAY in nfsd4_cb_recall_done. The client returns NFS4ERR_DELAY if it is already in the process of returning the delegation. Signed-off-by: Scott Mayhew Signed-off-by: J. Bruce Fields diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 7caa3801ce72..b9cbd7189d74 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c @@ -1122,10 +1122,11 @@ static void nfsd4_cb_done(struct rpc_task *task, void *calldata) rpc_restart_call_prepare(task); return; case 1: - break; - case -1: - /* Network partition? */ - nfsd4_mark_cb_down(clp, task->tk_status); + switch (task->tk_status) { + case -EIO: + case -ETIMEDOUT: + nfsd4_mark_cb_down(clp, task->tk_status); + } break; default: BUG(); diff --git a/fs/nfsd/nfs4layouts.c b/fs/nfsd/nfs4layouts.c index 44517fb5c0de..a79e24b79095 100644 --- a/fs/nfsd/nfs4layouts.c +++ b/fs/nfsd/nfs4layouts.c @@ -693,7 +693,7 @@ nfsd4_cb_layout_done(struct nfsd4_callback *cb, struct rpc_task *task) ops->fence_client(ls); else nfsd4_cb_layout_fail(ls); - return -1; + return 1; case -NFS4ERR_NOMATCHING_LAYOUT: trace_nfsd_layout_recall_done(&ls->ls_stid.sc_stateid); task->tk_status = 0; diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 8078314981f5..dfe4b596c2e5 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3970,6 +3970,9 @@ static int nfsd4_cb_recall_done(struct nfsd4_callback *cb, switch (task->tk_status) { case 0: return 1; + case -NFS4ERR_DELAY: + rpc_delay(task, 2 * HZ); + return 0; case -EBADHANDLE: case -NFS4ERR_BAD_STATEID: /* @@ -3982,7 +3985,7 @@ static int nfsd4_cb_recall_done(struct nfsd4_callback *cb, } /*FALLTHRU*/ default: - return -1; + return 1; } }