From patchwork Tue Sep 11 20:23:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 10596265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 76626112B for ; Tue, 11 Sep 2018 20:23:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61E9A29A2B for ; Tue, 11 Sep 2018 20:23:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55F9529E2B; Tue, 11 Sep 2018 20:23:53 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 BA17329A2B for ; Tue, 11 Sep 2018 20:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726786AbeILBYs (ORCPT ); Tue, 11 Sep 2018 21:24:48 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:38585 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbeILBYs (ORCPT ); Tue, 11 Sep 2018 21:24:48 -0400 Received: by mail-qt0-f196.google.com with SMTP id x7-v6so29691452qtk.5 for ; Tue, 11 Sep 2018 13:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id; bh=ovc+9kXgh36nSA1UkdgT7YSHkgj/CU1U2wObjVo22tY=; b=UodsBKJq03+7v1e4YteBI/FgQ3mCF4XDZ67Ha2bIgZPBrWP4ad8StkN3nARLcKqLBE hDUZiPhr9jOx9awnQUHqPIECqxDZ3rDRIfA8j8yPXyDhhlzeb4NPNZWCA/fvZ80ijb/Z SoewDB9rihIEWSIopzZSW69EvT9NmLFebfPKjh/00dEKt3BNM6Qqc4+vTk1enWuxv1cL UtRbVWPVKL96qq5xyiZSldBdcIomQZOTb5DSQEZ3kWvtj1+ngtRTqbE0Y/DAM6HdQiUV bgr3dK8ugXL/UmzEcTjmr1CWJ42cyQDczdj22U5iEhwCoMbGUZ4KxydUCbf9LXck+KXu vJxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id; bh=ovc+9kXgh36nSA1UkdgT7YSHkgj/CU1U2wObjVo22tY=; b=QePT5+PLL1hX66crX5IqWnANQCgyrTArIABOTs8ftGd49ar8NbJe1vDc1jvewxD1Yg g5Kyhd18r1ImwaComLeD25nxZ2nDy3H3UuRqL3cQeAaUTfS0bU8y+kn2kMFDhSllwkNW UcKKkpwKf8W1eGem8i0lLUYDiFl3wmlnpuoVyfy63QAokuattB1SJFJkqbZ1uLmD052w 1MOuwEbxWtKlMQ4DJBGKOJy4QphbmhtT+D8BNxp/OOJFsU6xOfu+yMnL6aC86akwV6fb 81m6+FTSBqsrgf+5oc89/R/M3Z6j1P0QCDXh+h8IRS4ZN1UHVO6aGqwzINWoYCuDZo31 P4Xg== X-Gm-Message-State: APzg51DSJV1FJy2nIvk+OxNxod8TD5nKcn4U4sSodQH2f6mr5ynRAOYW zkoX+fEh86y/Ed9vLMaVyuxZQphtj4M= X-Google-Smtp-Source: ANB0VdaLtdszdccJ6Di6POX0SPIkEGl7yiCcf0pJJBaX2M/Wciw12thXn1u/w/WSibij4/YjcdibTA== X-Received: by 2002:a0c:9a0f:: with SMTP id p15-v6mr19030850qvd.126.1536697430497; Tue, 11 Sep 2018 13:23:50 -0700 (PDT) Received: from gouda.nowheycreamery.com.local (c-68-40-188-1.hsd1.mi.comcast.net. [68.40.188.1]) by smtp.gmail.com with ESMTPSA id u129-v6sm11015517qkd.45.2018.09.11.13.23.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 13:23:49 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Subject: [PATCH 1/3] NFS: Split out the body of nfs4_reclaim_open_state() Date: Tue, 11 Sep 2018 16:23:46 -0400 Message-Id: <20180911202348.23160-1-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.18.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 From: Anna Schumaker Moving all of this into a new function removes the need for cramped indentation, making the code overall easier to look at. I also take this chance to switch copy recovery over to using nfs4_stateid_match_other() Signed-off-by: Anna Schumaker --- fs/nfs/nfs4state.c | 83 ++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 3df0eb52da1c..aa46a3216d60 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1547,10 +1547,51 @@ static int nfs4_reclaim_locks(struct nfs4_state *state, const struct nfs4_state_ return status; } +static int __nfs4_reclaim_open_state(struct nfs4_state_owner *sp, struct nfs4_state *state, + const struct nfs4_state_recovery_ops *ops) +{ + struct nfs4_lock_state *lock; + int status; + + status = ops->recover_open(sp, state); + if (status < 0) + return status; + + status = nfs4_reclaim_locks(state, ops); + if (status < 0) + return status; + + if (!test_bit(NFS_DELEGATED_STATE, &state->flags)) { + spin_lock(&state->state_lock); + list_for_each_entry(lock, &state->lock_states, ls_locks) { + if (!test_bit(NFS_LOCK_INITIALIZED, &lock->ls_flags)) + pr_warn_ratelimited("NFS: %s: Lock reclaim failed!\n", __func__); + } + spin_unlock(&state->state_lock); + } + +#ifdef CONFIG_NFS_V4_2 + if (test_bit(NFS_CLNT_DST_SSC_COPY_STATE, &state->flags)) { + struct nfs4_copy_state *copy; + spin_lock(&sp->so_server->nfs_client->cl_lock); + list_for_each_entry(copy, &sp->so_server->ss_copies, copies) { + if (nfs4_stateid_match_other(&state->stateid, ©->parent_state->stateid)) + continue; + copy->flags = 1; + complete(©->completion); + break; + } + spin_unlock(&sp->so_server->nfs_client->cl_lock); + } +#endif /* CONFIG_NFS_V4_2 */ + + clear_bit(NFS_STATE_RECLAIM_NOGRACE, &state->flags); + return status; +} + static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs4_state_recovery_ops *ops) { struct nfs4_state *state; - struct nfs4_lock_state *lock; int status = 0; /* Note: we rely on the sp->so_states list being ordered @@ -1573,43 +1614,13 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs continue; atomic_inc(&state->count); spin_unlock(&sp->so_lock); - status = ops->recover_open(sp, state); + status = __nfs4_reclaim_open_state(sp, state, ops); if (status >= 0) { - status = nfs4_reclaim_locks(state, ops); - if (status >= 0) { - if (!test_bit(NFS_DELEGATED_STATE, &state->flags)) { - spin_lock(&state->state_lock); - list_for_each_entry(lock, &state->lock_states, ls_locks) { - if (!test_bit(NFS_LOCK_INITIALIZED, &lock->ls_flags)) - pr_warn_ratelimited("NFS: " - "%s: Lock reclaim " - "failed!\n", __func__); - } - spin_unlock(&state->state_lock); - } - clear_bit(NFS_STATE_RECLAIM_NOGRACE, - &state->flags); -#ifdef CONFIG_NFS_V4_2 - if (test_bit(NFS_CLNT_DST_SSC_COPY_STATE, &state->flags)) { - struct nfs4_copy_state *copy; - - spin_lock(&sp->so_server->nfs_client->cl_lock); - list_for_each_entry(copy, &sp->so_server->ss_copies, copies) { - if (memcmp(&state->stateid.other, ©->parent_state->stateid.other, NFS4_STATEID_SIZE)) - continue; - copy->flags = 1; - complete(©->completion); - printk("AGLO: server rebooted waking up the copy\n"); - break; - } - spin_unlock(&sp->so_server->nfs_client->cl_lock); - } -#endif /* CONFIG_NFS_V4_2 */ - nfs4_put_open_state(state); - spin_lock(&sp->so_lock); - goto restart; - } + nfs4_put_open_state(state); + spin_lock(&sp->so_lock); + goto restart; } + switch (status) { default: printk(KERN_ERR "NFS: %s: unhandled error %d\n", From patchwork Tue Sep 11 20:23:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 10596267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 974D6112B for ; Tue, 11 Sep 2018 20:23:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8360D29A2B for ; Tue, 11 Sep 2018 20:23:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7785A29E2B; Tue, 11 Sep 2018 20:23:54 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 1B2F329A2B for ; Tue, 11 Sep 2018 20:23:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726795AbeILBYt (ORCPT ); Tue, 11 Sep 2018 21:24:49 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:36562 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbeILBYt (ORCPT ); Tue, 11 Sep 2018 21:24:49 -0400 Received: by mail-qt0-f193.google.com with SMTP id t5-v6so29734982qtn.3 for ; Tue, 11 Sep 2018 13:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=h+jTRt/zyMpNHS1ZDPV5AqXfP5AjD+qruT9vMsVPd7M=; b=UFDkjz7gZBauFm4/cj1RHaIAJYfHld7ektxBqet0tWMvEw5m+/o4zCEFTTOJe43pT+ eKXR1mLKuLq7FXhGVPGeGpP/my0p7fxcIw7XkIhvTQXNjJdxUQm7oKdBF4PQSQf/B69a 0PKdWAqK0qjjoHHImT58kY6fUpvDToPpJJhhiOsy4a929jkPE6yWJGMMeBdKIIl//+sC O5+9px3OhASg+9OVNFMfAxNnLMELSns1ks9E/Ybp1BmE2nMmbGIqpAWdyQuKjFRLfMQ2 PrfyEwQHjcGfaI/jhlv4NZwKLWt+4gDiU7V1lNpp/Z/OwEd/coXdmEq0W7SB1YMn7v/P IUHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=h+jTRt/zyMpNHS1ZDPV5AqXfP5AjD+qruT9vMsVPd7M=; b=j2piBNeIiF63eAXj2nEok6H9CpQGBF66HIlrD8Tys+/pih3zME383YCDx3XFw2UGXC +x6VLhZpEghKChS+5jPG7Nkz25gMwqEK/MPbR7HYjofT7L2mm/kAtG23bMlls8c7qnKa ttdXpRyaKiZZcq09dMxE4M+039B4YBsCEWs1mWlF9z7LUAUXKHqGWqbYgxTxvoBzXR0l jcG2wzcANyEiwbrL4SK5yDoHa9qkc5fuKqvj4yvv/cNXLtkgHIvT3zsV3Wr/h3frTNCc 4lhIDBWlySGrVojUS3teBPT1dVy8kE8Qtj9aIZnjiaLROUxvkI5JZdmJh9j2jneE1hFM THBw== X-Gm-Message-State: APzg51A4BWjcWUFZWcZpSvhV6NMrWKtwE8XgndkB+N/o9yQqB1JbNAj1 YEpUDcC4AR5TBlR77K7tc/EHwzczWeU= X-Google-Smtp-Source: ANB0VdZl/TjKs/LnLVbTb+VJR5t+yKpv/3NdZJ0z6R0kVBm7sxayeO4aM8lbNuVWGb5PnyOeH11j7Q== X-Received: by 2002:a0c:abca:: with SMTP id k10-v6mr19492128qvb.140.1536697431931; Tue, 11 Sep 2018 13:23:51 -0700 (PDT) Received: from gouda.nowheycreamery.com.local (c-68-40-188-1.hsd1.mi.comcast.net. [68.40.188.1]) by smtp.gmail.com with ESMTPSA id u129-v6sm11015517qkd.45.2018.09.11.13.23.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 13:23:50 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Subject: [PATCH 2/3] NFS: Reduce indentation of the switch statement in nfs4_reclaim_open_state() Date: Tue, 11 Sep 2018 16:23:47 -0400 Message-Id: <20180911202348.23160-2-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180911202348.23160-1-Anna.Schumaker@Netapp.com> References: <20180911202348.23160-1-Anna.Schumaker@Netapp.com> 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 From: Anna Schumaker Most places in the kernel tend to line up cases with the switch to reduce indentation, so move this over to match that style. Additionally, I handle the (status >= 0) case in the switch so that we only "goto restart" from a single place after error handling. Signed-off-by: Anna Schumaker --- fs/nfs/nfs4state.c | 70 ++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index aa46a3216d60..8a399dc17e19 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1615,46 +1615,42 @@ static int nfs4_reclaim_open_state(struct nfs4_state_owner *sp, const struct nfs atomic_inc(&state->count); spin_unlock(&sp->so_lock); status = __nfs4_reclaim_open_state(sp, state, ops); - if (status >= 0) { - nfs4_put_open_state(state); - spin_lock(&sp->so_lock); - goto restart; - } switch (status) { - default: - printk(KERN_ERR "NFS: %s: unhandled error %d\n", - __func__, status); - /* Fall through */ - case -ENOENT: - case -ENOMEM: - case -EACCES: - case -EROFS: - case -EIO: - case -ESTALE: - /* Open state on this file cannot be recovered */ - nfs4_state_mark_recovery_failed(state, status); - break; - case -EAGAIN: - ssleep(1); - /* Fall through */ - case -NFS4ERR_ADMIN_REVOKED: - case -NFS4ERR_STALE_STATEID: - case -NFS4ERR_OLD_STATEID: - case -NFS4ERR_BAD_STATEID: - case -NFS4ERR_RECLAIM_BAD: - case -NFS4ERR_RECLAIM_CONFLICT: - nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state); + default: + if (status >= 0) break; - case -NFS4ERR_EXPIRED: - case -NFS4ERR_NO_GRACE: - nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state); - case -NFS4ERR_STALE_CLIENTID: - case -NFS4ERR_BADSESSION: - case -NFS4ERR_BADSLOT: - case -NFS4ERR_BAD_HIGH_SLOT: - case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION: - goto out_err; + printk(KERN_ERR "NFS: %s: unhandled error %d\n", __func__, status); + /* Fall through */ + case -ENOENT: + case -ENOMEM: + case -EACCES: + case -EROFS: + case -EIO: + case -ESTALE: + /* Open state on this file cannot be recovered */ + nfs4_state_mark_recovery_failed(state, status); + break; + case -EAGAIN: + ssleep(1); + /* Fall through */ + case -NFS4ERR_ADMIN_REVOKED: + case -NFS4ERR_STALE_STATEID: + case -NFS4ERR_OLD_STATEID: + case -NFS4ERR_BAD_STATEID: + case -NFS4ERR_RECLAIM_BAD: + case -NFS4ERR_RECLAIM_CONFLICT: + nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state); + break; + case -NFS4ERR_EXPIRED: + case -NFS4ERR_NO_GRACE: + nfs4_state_mark_reclaim_nograce(sp->so_server->nfs_client, state); + case -NFS4ERR_STALE_CLIENTID: + case -NFS4ERR_BADSESSION: + case -NFS4ERR_BADSLOT: + case -NFS4ERR_BAD_HIGH_SLOT: + case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION: + goto out_err; } nfs4_put_open_state(state); spin_lock(&sp->so_lock); From patchwork Tue Sep 11 20:23:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anna Schumaker X-Patchwork-Id: 10596269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4CB914E5 for ; Tue, 11 Sep 2018 20:23:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0F9329A2B for ; Tue, 11 Sep 2018 20:23:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 952FA29E2B; Tue, 11 Sep 2018 20:23:55 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 3DE3F29A2B for ; Tue, 11 Sep 2018 20:23:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726800AbeILBYv (ORCPT ); Tue, 11 Sep 2018 21:24:51 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:33402 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbeILBYv (ORCPT ); Tue, 11 Sep 2018 21:24:51 -0400 Received: by mail-qk1-f195.google.com with SMTP id z78-v6so17657278qka.0 for ; Tue, 11 Sep 2018 13:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=BbutqalbrSUslZ4SCgz6ul+fmJEYXURg00NFXbyqR2E=; b=VoX+UTbhiiMet7lp3SQz5KSEQn6GOFCZcfAR4AQRPLHBncKe5xmPSvBbv8r9xvz2r0 7SnP+m0Gkc3gCID/ZKB6NvDjivaUyUlxHfgM+clpm46jwO5T9Ex2/qjMA4Fj2rjdxGzH vPJE4YbQAEYMgF5UH62yzqAqd+FV5ZbAXB3K95kUcPs+9siz5WEdhwDpCD6XL6ck/Fvi VUEnvt9USHrBDc6SD4KKNYpG+/d+4j+p8wCDwY9roaj11aogpO+/R+kLOdtfrLycaRfe OY2zTbbOXErtiintMC49vIr1u8qFIxh7+EgUuct6lsPLGlGqhYk8CRHfTVKf+lCWSdtQ joKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=BbutqalbrSUslZ4SCgz6ul+fmJEYXURg00NFXbyqR2E=; b=EmtgaLS8KHph/SlocYasVqQFDu/MSMx21ykoGwAbp/mk6fH6M/P2ceGtL/mLFOxhdO 9tvaklvgMl1TDVjUlIqZYGhzJ25mgNMAh0Vpv5+BOQA7U2lTKKAW0A5I1Sl+iS8BF2K2 WvyCVeO0CAb2pyQWXLOMWMtviwQZX6ZsAko3NTGibZM+GQWR0R49vWtdesfn8FvuD+6x 9PVHzc4VswOz/S1nBzjCV83C2C+4uTiyHZTq//IMHVmbDawy8nVRbLUNBgXwnMWgH8g3 WxkuSJUlk7wTfvcPTbWplrF4WANYKnwQUvv46Lzlo9GhpyRKCXoERpw3EQB4QiNieHzX +75g== X-Gm-Message-State: APzg51Aro29LceOcos8aVwxkEAUVNZTP/b8G9xq4bNji7bN0RRG1dXf+ DcnMdo/Svnmkv2vkQ6ToedD9l13o15c= X-Google-Smtp-Source: ANB0VdbA5UAd+22wV84M0SWOPPvw1GBiCX1UPm/Ma6sKTQu50R2FZ60XJredkQcz+zU8aDrDRvuFAg== X-Received: by 2002:a37:83c6:: with SMTP id f189-v6mr20635463qkd.47.1536697433186; Tue, 11 Sep 2018 13:23:53 -0700 (PDT) Received: from gouda.nowheycreamery.com.local (c-68-40-188-1.hsd1.mi.comcast.net. [68.40.188.1]) by smtp.gmail.com with ESMTPSA id u129-v6sm11015517qkd.45.2018.09.11.13.23.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 13:23:52 -0700 (PDT) From: schumaker.anna@gmail.com X-Google-Original-From: Anna.Schumaker@Netapp.com To: Trond.Myklebust@hammerspace.com, linux-nfs@vger.kernel.org Subject: [PATCH 3/3] NFS: Reduce indentation of nfs4_recovery_handle_error() Date: Tue, 11 Sep 2018 16:23:48 -0400 Message-Id: <20180911202348.23160-3-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180911202348.23160-1-Anna.Schumaker@Netapp.com> References: <20180911202348.23160-1-Anna.Schumaker@Netapp.com> 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 From: Anna Schumaker This is to match kernel coding style for switch statements. Signed-off-by: Anna Schumaker --- fs/nfs/nfs4state.c | 64 +++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 8a399dc17e19..816f526bbcb3 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -1800,38 +1800,38 @@ static void nfs4_state_start_reclaim_nograce(struct nfs_client *clp) static int nfs4_recovery_handle_error(struct nfs_client *clp, int error) { switch (error) { - case 0: - break; - case -NFS4ERR_CB_PATH_DOWN: - nfs40_handle_cb_pathdown(clp); - break; - case -NFS4ERR_NO_GRACE: - nfs4_state_end_reclaim_reboot(clp); - break; - case -NFS4ERR_STALE_CLIENTID: - set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); - nfs4_state_start_reclaim_reboot(clp); - break; - case -NFS4ERR_EXPIRED: - set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); - nfs4_state_start_reclaim_nograce(clp); - break; - case -NFS4ERR_BADSESSION: - case -NFS4ERR_BADSLOT: - case -NFS4ERR_BAD_HIGH_SLOT: - case -NFS4ERR_DEADSESSION: - case -NFS4ERR_SEQ_FALSE_RETRY: - case -NFS4ERR_SEQ_MISORDERED: - set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); - /* Zero session reset errors */ - break; - case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION: - set_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); - break; - default: - dprintk("%s: failed to handle error %d for server %s\n", - __func__, error, clp->cl_hostname); - return error; + case 0: + break; + case -NFS4ERR_CB_PATH_DOWN: + nfs40_handle_cb_pathdown(clp); + break; + case -NFS4ERR_NO_GRACE: + nfs4_state_end_reclaim_reboot(clp); + break; + case -NFS4ERR_STALE_CLIENTID: + set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); + nfs4_state_start_reclaim_reboot(clp); + break; + case -NFS4ERR_EXPIRED: + set_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state); + nfs4_state_start_reclaim_nograce(clp); + break; + case -NFS4ERR_BADSESSION: + case -NFS4ERR_BADSLOT: + case -NFS4ERR_BAD_HIGH_SLOT: + case -NFS4ERR_DEADSESSION: + case -NFS4ERR_SEQ_FALSE_RETRY: + case -NFS4ERR_SEQ_MISORDERED: + set_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state); + /* Zero session reset errors */ + break; + case -NFS4ERR_CONN_NOT_BOUND_TO_SESSION: + set_bit(NFS4CLNT_BIND_CONN_TO_SESSION, &clp->cl_state); + break; + default: + dprintk("%s: failed to handle error %d for server %s\n", + __func__, error, clp->cl_hostname); + return error; } dprintk("%s: handled error %d for server %s\n", __func__, error, clp->cl_hostname);