From patchwork Fri Mar 10 21:37:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 9618029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 70E81604D9 for ; Fri, 10 Mar 2017 21:37:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DE0527C0B for ; Fri, 10 Mar 2017 21:37:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 405E528776; Fri, 10 Mar 2017 21:37:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A650E27C0B for ; Fri, 10 Mar 2017 21:37:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932595AbdCJVhp (ORCPT ); Fri, 10 Mar 2017 16:37:45 -0500 Received: from mx141.netapp.com ([216.240.21.12]:46452 "EHLO mx141.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933493AbdCJVho (ORCPT ); Fri, 10 Mar 2017 16:37:44 -0500 X-IronPort-AV: E=Sophos;i="5.36,143,1486454400"; d="scan'208";a="188624654" Received: from vmwexchts04-prd.hq.netapp.com ([10.122.105.32]) by mx141-out.netapp.com with ESMTP; 10 Mar 2017 13:28:02 -0800 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) with Microsoft SMTP Server id 15.0.1210.3; Fri, 10 Mar 2017 13:37:14 -0800 Received: from localhost.localdomain ([10.63.238.195]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id v2ALbFAX021767; Fri, 10 Mar 2017 13:37:16 -0800 (PST) From: Olga Kornievskaia To: , CC: Subject: [PATCH 1/1] PNFS dont retry some error when MDS=DS Date: Fri, 10 Mar 2017 16:37:15 -0500 Message-ID: <20170310213715.38258-1-kolga@netapp.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: References: MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If we sent an operation to the "DS" and got an error, the code resends to "MDS" but when they are the same, it gets the same error and goes into the infinite loop. Example was COMMIT getting EACCES. Signed-off-by: Olga Kornievskaia --- fs/nfs/filelayout/filelayout.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 44347f4..772be38 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -207,6 +207,8 @@ static int filelayout_async_handle_error(struct rpc_task *task, /* fall through */ default: reset: + if (mds_client->cl_rpcclient == clp->cl_rpcclient) + return task->tk_status; dprintk("%s Retry through MDS. Error %d\n", __func__, task->tk_status); return -NFS4ERR_RESET_TO_MDS; @@ -384,9 +386,10 @@ static int filelayout_commit_done_cb(struct rpc_task *task, return -EAGAIN; } - pnfs_set_layoutcommit(data->inode, data->lseg, data->lwb); + if (!err) + pnfs_set_layoutcommit(data->inode, data->lseg, data->lwb); - return 0; + return err; } static void filelayout_write_prepare(struct rpc_task *task, void *data)