From patchwork Wed Jan 11 18:54:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 9511037 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 99FD360710 for ; Wed, 11 Jan 2017 18:55:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E5D62866E for ; Wed, 11 Jan 2017 18:55:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8345028675; Wed, 11 Jan 2017 18:55:16 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, 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 1620C2866E for ; Wed, 11 Jan 2017 18:55:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753994AbdAKSzN (ORCPT ); Wed, 11 Jan 2017 13:55:13 -0500 Received: from mx141.netapp.com ([216.240.21.12]:55666 "EHLO mx141.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751480AbdAKSzK (ORCPT ); Wed, 11 Jan 2017 13:55:10 -0500 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="175756381" Received: from hioexcmbx01-prd.hq.netapp.com ([10.122.105.34]) by mx141-out.netapp.com with ESMTP; 11 Jan 2017 10:50:29 -0800 Received: from VMWEXCCAS06-PRD.hq.netapp.com (10.122.105.22) by hioexcmbx01-prd.hq.netapp.com (10.122.105.34) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 11 Jan 2017 10:55:09 -0800 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS06-PRD.hq.netapp.com (10.122.105.22) with Microsoft SMTP Server (TLS) id 15.0.1210.3 via Frontend Transport; Wed, 11 Jan 2017 10:55:09 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netapp.onmicrosoft.com; s=selector1-netapp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4PAcp4gx6tYDswh6VA5wxMrd29GiBM3BiPUFiqtOWhU=; b=Q2nsjUYieb8j7+401NjTFTyvwmcHLZH2Ssr5J7h/t+s2/i6gnJdU+OxMH4cwrfRocu4QfKApasFz7CisPUaPHJ0/sI2IxpxGMqTgbLXtrORXohT3IuIq/pvNXu/a3ixxUqDV4tRV33PiNVTxOQqDEMDUDvjfT/3raJ/X4l9kTWA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Anna.Schumaker@netapp.com; Received: from gouda.nowheycreamery.com.nowheycreamery.com (99.9.112.69) by CY1PR0601MB1642.namprd06.prod.outlook.com (10.163.232.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.829.7; Wed, 11 Jan 2017 18:55:07 +0000 From: To: Subject: [PATCH 06/11] NFS: Move slot-already-allocated check into nfs_setup_sequence() Date: Wed, 11 Jan 2017 13:54:49 -0500 Message-ID: <20170111185454.9315-7-Anna.Schumaker@Netapp.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170111185454.9315-1-Anna.Schumaker@Netapp.com> References: <20170111185454.9315-1-Anna.Schumaker@Netapp.com> MIME-Version: 1.0 X-Originating-IP: [99.9.112.69] X-ClientProxiedBy: CY1PR0201CA0001.namprd02.prod.outlook.com (10.163.30.139) To CY1PR0601MB1642.namprd06.prod.outlook.com (10.163.232.16) X-MS-Office365-Filtering-Correlation-Id: 68114eaa-0217-4b03-e0e4-08d43a535cec X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0601MB1642; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 3:tAMR/W6rcZEERfnUfaLq9MOlJ/8ivA69H4msvIDJhdm1V/yCfHmKh/qWdB8T7+3svpFtpFg9bYnX8UtJ49/a5r7LhNtQvu2KeJluFktG943smpJcpYP/WRv08oPd6sMek8nzIBA3wx1krosvt/U180PUYCXI9RDTWDSTgvmLNrQ9Ze6DQUXo3qqJbEZgKQKptGxJ603c6Se33muaaQtXgkHCDDAYLoQMYji87jCmjnMtzQtsi4h3hIIzUuSpviSVf1D4/Mg1XYpJZd0x80FGCQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 25:V9hdqnusyfmr9RtSxV948+c2+x6V8WENtIShi84s6MhfPUoDXopux2jtxp0tVvvSmJ9q87ZxbGDEsFfJAx3EzyMhxlFM5QxK/CySmZeUgRYKQ1F+FNtYvGTweCv3lpQ4WmJhLLguPvihMJgS404lIy+Xw4uHWwIxeggxSDGkOS4YG/5YfY6hE5hLNQAMo0AsN/WXY1a67tuXwGlhUhElWHNonrupW70eHn+eEYpBNtPGImFlFHBoe8mMSThLMt3pNf6xpROBwe3vFrXeI5E/Y0Sxv9Wsgn4f50yehUskzG8iyqWV2uG3v5nIr2N3fJgA0HC51GBM9/O8d1maPZawzApYwsFI/PHqusn/AyOySJOpM58hAs81/CFxWZu7cy1alEq3geT3yuXtQOjU2SANjslWg4WE0XCJJDM1ohy+ACSHlwR30SMlRgBQ9zjK0+ctjGgFU/HkF6tOlQTPe5PgLKJP2WsB8DN3cyhg7YWT+p3lZnRpcXlTup8Iklif3V0BMLhuOLIT8/XrN+uwSAsEcABqsGqVhnQ3T8wzcZ2fCaN5a8UoNt8+h1cWYLOoaNZwmH02vx0WSKh8OxiQINQeyWG+rOVdA0qXJHUXkxeCXSpGp7qTOljXc2rFLV67SCG+5YEGwsjzBypsXFEraBLgufauErdtByBADuVwpAQ3njpQ8n6pQdl0yBH/zI6g6PKdmEez9VkEMcGvAzR/dywGpapNsg90u4B7kR1KO3nNYB27vGFvzmTXKmrXryvrf+NYVXdOZhFvXHPnRnNmWX38og== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 31:WE+T4IjrgUg70qjtaihjfHhAUpptYUCsYc6pGNtGHwbnxgxpvemIUx3TNj1swVeaB8muUa1F7492ihH9j7qSy21Fhs4H+JIHComeJgI/TaGf6Oc2QmM+CEHTNUH5jiiCJTpgLu0docCEv37GwgmdFDGIfmgdPzNQg/hAVmRgosC4Au/MblvphhaLeuvDA2eFJa0hdzm943+po+wvuRveCUpToSa3u8qx71dImKCJGP1MgpWCLjpxjfsnI1s8z/6yziXCQ6cFUpRFUGG5f3bLWAvwYaeiKxF0Cgzm8Bhd8gk=; 20:FIuderSrI6cyJ7lqVBV/mmCBQrKOv1JpEXMjKgW3uu1PVPX5pED7jMMI0IIsBB/4wfxS14swwn6WRe6FspQ+24kNiKp4VU44Cbkxw3StN43eAWwT/Q6LebOrUWnN8yUdTkMLJ1jXH7I+gDldizxaI+VdJ485C055ThB715KcPyugb8A95dLCnNbacbTTaEOK/AF9SQcMCCHGLNjt3O6fGCvOWpA5Kf7Aa8iEd+yu1D6T+/AFOO9UlKcgaKA/QNQtlvP+1JHZrAOZIaH9BleUDI7PLEqwWlp48HK1nfK6mA9uvY/vSnXPvrXmo+VZDPE82FbTj2VlI1gvLHYas3JTBl27Md5UEGaxXPJptCa3/uaTdebZ4eIzWfo9za8+UV2YLJzb4tDBFjE1tIaXf0eyYthBUEXWY+JXBVvjn6FlwNWkOB9q8/Tg//guVJQV3F8XYH4NJw4ityivQkLKiL4aG1fshnNy8Md4PddbQYp7rDYzyoXKt5JBK3Y3H8jIILZV X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148); SRVR:CY1PR0601MB1642; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0601MB1642; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 4:m2SwAdJJI3p/vO1JaR4T/2y2WYf2+EmFfmnCBXz7wK5a+LqMQTPEq2u8g3samO3axegc3U9eoYQOyyABRP5LnBVlh+LqhZVN6o3FhMXU1XkQV1yAPzh0sgu1W4NTB3yWiicHhG67OScTaM5gbA2hfOjLX1xn/Glm6r0UFkVU9Gvem+YGpod9O0inCj9wY+JTHKH4FnWqN1aCjgq7yovt/cLAQYD158lohT+8qRpSSyqa9yykH8ugtxN33juNM7LdFleWmyYE5HUIr3/++tJxF845QV8RTU7NBZSVS6ybs2YQbgvWzAjFTRdKJqDBGjIzixg/KEwul1O3iL2iPu/wLYRAMxSvwTKPmOThBbXTxJejY8kkAPurM4Le8stay6UQPtd5wb3qKBShwIhMydtWLDr1idxYd5QlbIlrE3haW1Py6G9nG4kYRdUDp2A907LgcWR8jfJeqFQfVY+WlQxaWDA351X5i9QFUDTzNaYyYqTYYBHO5FCFQ+K0xxwaprdN/T5RGId1Ap9K587X/jPcJBZ2pUj5U69vTsEjH5xV7a0dzWS4HWaU854CbG9X3ACXLwWE7uY2l7TXDHO7Ds39bw== X-Forefront-PRVS: 01842C458A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(199003)(189002)(50986999)(2950100002)(6666003)(6916009)(101416001)(92566002)(38730400001)(7736002)(76176999)(25786008)(305945005)(86362001)(2351001)(5660300001)(110136003)(6506006)(42186005)(5003940100001)(106356001)(105586002)(86152003)(2906002)(2876002)(6486002)(575784001)(66066001)(1076002)(3846002)(6116002)(189998001)(47776003)(8676002)(107886002)(50466002)(48376002)(230783001)(97736004)(36756003)(450100001)(81166006)(81156014)(6512007)(50226002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0601MB1642; H:gouda.nowheycreamery.com.nowheycreamery.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: netapp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0601MB1642; 23:sIEYE38OPOqzHLuJPLzWzr7dZUf34tSk7vAqa0V?= =?us-ascii?Q?Nkwf8AIT86sX4z2QCETJ5lytZ+2ht+bFByeev09BDKJ7sOBRbcLOfakVi9La?= =?us-ascii?Q?xvnO8CIDCXG5HhhNe4VgRFdJ+v7wHCcR+mTVQ9cAcc4IkIvsZRlwHEF+PQwT?= =?us-ascii?Q?fa39XiTOECc2Wa4cKHZ5OUbYhYxtEsPu7QDW8PCzdcg4gqY5MXcQ40acbLDE?= =?us-ascii?Q?rxUq+gniDtzbS7yl/5mMW1djwbbO0cpUTtE5t2+cR0xyBkiaDFE8dP1prEv0?= =?us-ascii?Q?+GWt8QeVHAWwRgc9aXyVEOY7kwyazugQhK0nXFRS4F/NwXK9kAZM9qL3PgDw?= =?us-ascii?Q?/dGo27wg0/nIShoivnDhUtiLg6WVup/W/jdJimsMtROr1zT/nvWpXJADabYj?= =?us-ascii?Q?LZDNTCX5/hw5/ilBklSQrB0ll+gOqbWxbHz6o4IP/aCquCtTGFhRqD3VDm7I?= =?us-ascii?Q?epHkHWaYYGtRT6nyPJOg9tcw8gF41Hvzddc5vAQF+AhAsNUm5SAfhguvud8N?= =?us-ascii?Q?NFZfL29a5uJGf39Pl2pq+NEab7AJYKW/q9kAt6grR00ZQAELzK+6PauOSjHF?= =?us-ascii?Q?8MMtpq/Fqu9qkIuSiw/0P22wR8SRuZ01NnQ+waEcw6MQ0GZIhenG8IlaZ1Xo?= =?us-ascii?Q?CH6aSUH0LJXrADXPAe/1YWBA/bmWOJIrvBI5iNY6r/d9rAZ2H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BArqm8o83M+QPoNatRu8MOXVFoU4rtPo0zUZK343pb2dlkJ0=; 5:JRf9bdi+dHhmzUSLY/NHmum5+QSqFPORgWpPyG2k03pk/PVJrkTD/r8n+jRinpomquX0FULIiiVTrCF3HaAGUh14NmESiSyixmLIS/N6kZatM4D4s4pwZw4VaNrm5ZNj4lIOSdBpZIFqmjKZdACK4A==; 24:s5mAmP9WKxbaFOm/o1/cHMqjJnzniSydlUxrO4vxqZw43z136K7XmjXPWeR08x6OPUoQb0T2yfi204RSpkyvc3DD9L3ypESP4PncQecUPBU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 7:ZAVF13oivLudL3c76MwzKlfFCblIEltsnsnN7i7RAyBPJP+WJTSqA95ULtV4fcj2UewHBVk5DuXfVzMTgR0pPSBmQoLs1QQNzJ0Lb/ZwiBqGM/ARDVgx1OlPg1H+7b66Bfj0iXnmAkdVzYpgqmif/eVbBzYUZWOZOKZnzaioY9c2+MYSmLkZ4hexzAnStFTWQ3QG0vJGn4VCMpHpnJb7Yu09cgvELisk8yUXff2MDNQjAacYqaE2cMUcojuf1PdZhvNreqLMCOXUZjX4GcoLWiKv2nOWjLCQ6596TUqLDeAMILKyzEQy9mvCxyMYH2k2RxU9uoxFxkA24weAneRVm5oxo/zv0BOSc61lb95uLrVQV9m5caNh7SHWDL7O1/zpZOGqqegdsfpG3YMXsiTMJXwz01REpW/EJI0W3fNI5NzlR+L421gQgTep5w5ulnRVplBmi6BXWD+cAgkclJAF9w== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2017 18:55:07.9575 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0601MB1642 X-OriginatorOrg: 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 puts the check in a single place, rather than needing to implement it twice for v4.0 and v4.1. Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 132d73435b8f..856d0df8d653 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -630,10 +630,6 @@ static int nfs40_setup_sequence(struct nfs4_slot_table *tbl, { struct nfs4_slot *slot; - /* slot already allocated? */ - if (res->sr_slot != NULL) - goto out_start; - spin_lock(&tbl->slot_tbl_lock); if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged) goto out_sleep; @@ -650,7 +646,6 @@ static int nfs40_setup_sequence(struct nfs4_slot_table *tbl, args->sa_slot = slot; res->sr_slot = slot; -out_start: rpc_call_start(task); return 0; @@ -891,10 +886,6 @@ static int nfs41_setup_sequence(struct nfs4_session *session, struct nfs4_slot_table *tbl; dprintk("--> %s\n", __func__); - /* slot already allocated? */ - if (res->sr_slot != NULL) - goto out_success; - tbl = &session->fc_slot_table; task->tk_timeout = 0; @@ -932,7 +923,6 @@ static int nfs41_setup_sequence(struct nfs4_session *session, */ res->sr_status = 1; trace_nfs4_setup_sequence(session, args); -out_success: rpc_call_start(task); return 0; out_sleep: @@ -997,12 +987,21 @@ int nfs4_setup_sequence(const struct nfs_client *client, { #if defined(CONFIG_NFS_V4_1) struct nfs4_session *session = nfs4_get_session(client); +#endif /* CONFIG_NFS_V4_1 */ + /* slot already allocated? */ + if (res->sr_slot != NULL) + goto out_start; + +#if defined(CONFIG_NFS_V4_1) if (session) return nfs41_setup_sequence(session, args, res, task); #endif /* CONFIG_NFS_V4_1 */ return nfs40_setup_sequence(client->cl_slot_tbl, args, res, task); +out_start: + rpc_call_start(task); + return 0; } EXPORT_SYMBOL_GPL(nfs4_setup_sequence);