From patchwork Wed Jan 11 18:54:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schumaker, Anna" X-Patchwork-Id: 9511045 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 C5FFF60710 for ; Wed, 11 Jan 2017 18:55:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA1752866E for ; Wed, 11 Jan 2017 18:55:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF24428676; Wed, 11 Jan 2017 18:55:20 +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 4A3EC2866E for ; Wed, 11 Jan 2017 18:55:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752882AbdAKSzS (ORCPT ); Wed, 11 Jan 2017 13:55:18 -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 S1753264AbdAKSzM (ORCPT ); Wed, 11 Jan 2017 13:55:12 -0500 X-IronPort-AV: E=Sophos;i="5.33,346,1477983600"; d="scan'208";a="175756392" Received: from vmwexchts04-prd.hq.netapp.com ([10.122.105.32]) by mx141-out.netapp.com with ESMTP; 11 Jan 2017 10:50:32 -0800 Received: from VMWEXCCAS05-PRD.hq.netapp.com (10.122.105.21) by VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 11 Jan 2017 10:55:11 -0800 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (10.120.60.153) by VMWEXCCAS05-PRD.hq.netapp.com (10.122.105.21) with Microsoft SMTP Server (TLS) id 15.0.1210.3 via Frontend Transport; Wed, 11 Jan 2017 10:55:11 -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=ces9TMEAzKl8ec/dFfOe/LEQ2LdsGGPn2RUYKyIAaE4=; b=div08MG5jsom3POucGKLkPTR3VhDg5i//A69fh9duwJ2K853bVIbMcYpFFOEJ8Oq1LYuP007WpFUxTQFffO6YkSF/4aCXO9zf5QPTBT4zykIMEluEYWj9jYlv3v8wqcWM0J3GtDZDBYFDUIbidXxY6AYMito76+0LDm6IeJcq4s= 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:10 +0000 From: To: Subject: [PATCH 09/11] NFS: Check if the slot table is draining from nfs4_setup_sequence() Date: Wed, 11 Jan 2017 13:54:52 -0500 Message-ID: <20170111185454.9315-10-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: 869f3297-11d6-423b-a1fd-08d43a535e6e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0601MB1642; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 3:AKGP5rD05DLfpBMYFIHOzLZfl9U8HS1dtNxdyykcZGfVq6ywKmgUq37W9zeEvM/ObnE5iC1ZKQpXqNLu75hooYevRyTVnEBE1sL+zaBqmmLCd2ePbZGfDDWvveu//o0WH75k1WZrdzlaKxbWhFUkEJ5jIhpCkuz6ci8z0npLpmEqma3hYdducmKkfO1DW14L+8+92kvMILvBH3eRZpjM5kO/Ed14SOQNjN0YBGKQuX8TPpUhua+34UgEelq1gGvBE21mix5CjYfMVkAinA2z9g== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 25:FT8ft+dmPoT0tf5PAve2MLqbUBUMcFeXEaEBSblIcrgSkkEIS20xxPamMoONtBYYqrE7Db2rJUizW4joq/ra2ZizZjHsMFhTN2SO7EO5hmeU7jBpDbRtIHw6/Xnxlv/0qExkaR5yeYed3Z68sXGgWZjZOCrcI61fHGJYg28AUxAfIjmjF9jjUAGpZmbn4HoYyJDUD0flqCxonwc2VLBR14/Vh+ANkjYy6dAmtukFpGG+F6n3zRZgb3tTWzBA9ByFQS6todrE7xGVvGBORCPoeftAr+MApLhpSZkv9SjPpK3I4J69jMrdZwdUYFcC/zIyeDDg94UJxhOc2Xs1ysyoG3QNMpJ3SGcbKlj2OkdlH8FeW1kJasi8Zm7wzipjiO5f0JcxsjqUS48SiY4cvf9e4rsCBWyy5/ExKZLgv5HGDC9E1Qz1NeUDhymjueNTEJtzDKj4vSGDTVYqgpRBtOneRAJ1FjKm4Xuq8Ab80D7CkeoRDLFi1MQcuyV7bdZqEjXAOsezGYn7H7zIUnxY8U4FuoPXILPNc/h29Jbxgb/kyTyNr9/W3RLm1816R+9KbU2JKx9mVmR1HsxTuw0DuLBPPRKHm3ZsMFD3nTynSeydiDEGighqUcwPnCas2TM4g77vb6qPZR+LuEItyaKY1Jt0+vQNdEFWpzAqbke5wfCncUcLD+hk8YPx1sgFf2VF//rPNxFEmvoRV0qovNK3YDbnb9XfB/0LRktB5iAvoJpsmGudfTU20hT7m3OC7ja5ZBUsWgmLCDIYeAk2njuFZSFNNg== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 31:0SEY20f//Vu36xEvIUyHUwMbUim9DSUW1yAR7bC7e2fcTsXobI0OeshiCxkeGec5QtjrKiDPxaHakjYojfW3+p7FkVsd/HMgpiZlJ7mw9Iuuw5xxroGXVV9h2hiTDpRCglnEhNxiWasVr+R6pxhrJLwUM1OVKXgU36b0quJMfBdVYw55OSxzoNdV5JlcpKGefXUk5aQqV8LG9Xu5g954eKiQJmvMG+tjjkD7vbQTfn6MUKxE2xfV+qlnGUiyt9ON2NrWmsaPJqVvCQkwdsviTg==; 20:HfKkVlyP/m7dpe+caux53hPSgmvVfPYI0yKyK4zod5d13bs8VySnBeEvxXBxNtX9TpW/Qw1nxnO+z1Tvls581p3kB5lRJXHi9umlCgx0gsE/L+3xrwO0RjiyGz7cnFDnBZcjlOluuLwhfwOHaleUlzzcR/3IXB6myLjS3UhQv1oSskq9peq0RivM7R8csf0lyi+hTpVh73DW0FlF3GXeW5ALkf5c1iL6O7kamr0zvw5DNF4ffl2GijVi78MjpCWE9hP6W6CNELQ14jLy90MhG9g5ER5cqwXU8k48pj/BGoFcTgVZ2jQUkFtTLALMfOYPu3r6z1QYUG+wpHeVOi3hMPNSDNLYimgOe9yW7AKZStEWWv5mef5ywib2XxEdbhkdJkmNbEpOIoDCOQEi2dl/ZhbxMp/TsRdDInxjJaGoh6mblxPnw3+t2jlGy1clOJXqARUfvktS4qPtdbZLhVTIBqATnsiftpwqSsqiHAGIooT4DJZYNJM+JpmKmHk59eBV 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:ssh+U+LXAp9Yddr8sXNdh37+GwUgAbldwqTW1gZgg6PkhjbqcYvD0ePKdygRUwEBsROXWGWJQRjQRNQpMUr2iruLXYRcGGJ9bW/L7OMHhkrE9Kgoi48UI8RJ1cmSv3xETJWtvQClm6IkhZtDlTvrfMd82/PBN5CO27SeG3ZB4oELbWLJ70K/+dbaejIT4Logf3FMb43TTJGvLEtsUbkS5Gn2fPHz5GsEkjJP0P5AZg2OZaHJ8T+wdVsxwy3uuFSR6ThuQYZ1DLmDWStBKniUbpALZD1aYa04vA/L2+UOnytsoENVk3NiSi0b45wuCR7d1Ne66C0KKjWlKTiD1ZEMtx+t5AbduQPYs7P5tufZTEhQiRGHCQBmfKSOOwEMSBu1OO6kyf8OjeRxhvYC31+JiAffahFIBdXFuXS1sDmnpxUuLnegrqr7qKqcj2G5hbmxR0eNidpb1EKmLtgVRTeNR4M6cTvj5YkPNAO/ejffklm+dbkV+QQ1ZW2HE/5nx6xObeeVX6feqb+m4OBSpgESGIIaota1fTCvnsPARCZJ8XRgXB4iGyoUy1irUcei4oEPdyUhDkkcDTwWKxqYxyXJJQ== 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)(66066001)(1076002)(3846002)(6116002)(189998001)(47776003)(8676002)(107886002)(50466002)(48376002)(97736004)(36756003)(450100001)(81166006)(81156014)(6512007)(50226002)(68736007)(15760500002); 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:CFrUhF83fIyCMUPbOz1QMTL3QTHhwrMY7lbqLwd?= =?us-ascii?Q?jx/vRUi9ihhU0xcub8uJiaje8My9lKeJLRFD5cHhhFRoAwxegVCQKY35LCvU?= =?us-ascii?Q?F39fbJSjHkOc0LkP/HK1yW4mqs1S9yMj+8Vq+Atdn276ECKVlLEq8B7NobIu?= =?us-ascii?Q?gR0oubKL+7WQv+SIM2UZLnPciD4gh9ozl/FvbrlcwNn7BMJ7eUamWODTZrXm?= =?us-ascii?Q?pgsjXttETltwTH+JYKnS2CdvWTBwRXTLPvaRcpMeNC2aNCUbwkcCuuMpUU3L?= =?us-ascii?Q?GMLxj2y7fB+lKj6XZ3+7vVix8Tz9M3lhGru7UKg+V2q+tAwsva4pPuxDB1u/?= =?us-ascii?Q?3PFuNbOC8+yXqsBfd+ibeFVcYA+65k8yYlwFGIvFYvXq+SEbxYpGyyJQkrfd?= =?us-ascii?Q?TohvFMjNLrqCu6ZGMxtk9i+5LFGQvcT6in65JP5r8HRSkdT9k2GBGBbdQZz0?= =?us-ascii?Q?sYkIJhmZ8B5XTRX2OTY4l5rewPgBa92LIbyh/OLYVVQQWSeC+E87tTmnXjuT?= =?us-ascii?Q?dJH/Q2xqvGJFHM5+4FLJZwxYF9sBT1Ne2bbXSlOH0GS2bwRsQWt583X6G3DW?= =?us-ascii?Q?MEWNOPjNsYBO14CG52Uryt4lYuc/yrjZ6fcbDBcW0ZzjjMZ4ps/woAN0NW6q?= =?us-ascii?Q?hVdvM2EuQn/kSYpDJFDLn/m26f9DF0KqaKR2pTbMMtZiQe4MxK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TDDfs0VlkBtSvGFXAkx2YWI=; 5:Jatonrd7Sc3uskOBCF1m8Qfxal6+h6uPn9DYP+vhroZV65u2fntOEXNvSCN2Q7vMwK1AwztFrstH3WrPuyXbYzMIe4ew2n9R09X+GW0V31bzol6Euc1pKzRtmMBKGsbyvZ/8IuhNHTxwnoVYFXLk4A==; 24:tXRGvtm4TOsmuYVXzqJ0Jej+sZ6BgDfj8VmEDsJ7bTVYEU6UC/Zeof3wbas978MOic6bt5PS7TNa6I9osLNkDhjylMVlDvzk/+6vROBGCAw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0601MB1642; 7:aZwNQdFqAwkIjI4GZj1Jao9VZTmLOcsB48tsNarDKpX2fiaO/T9uBKOur5GZ+rlqalH9YikjgrHJFPYBk27KHCB4UbRqtaNlmAlmR3xYsNw2mn3HOwglkqkX6BHgbmY+XLYl5wxfcYQMLEVSKKTf2hSIGOQgv+ahxe/pUmQGLYXf1h5I70ZcPeyBrcX5LJCPjsuu6GvxA7dtGvakcg/35SWDPimWGlR650sT2pUvp3iz8upfl5iBpvVAeA9V3MQ5jBWo2pB2KvtyF2QImlWbvpIZ/TEBPsiclXjkU0kOpLDKHkwaGIfy6psJIJ0kJJn3yx5l2YaTSy4xd1JS8od+BV3vmihTBiHDYEcVO+dVkgFkOO67XFIz73k9o91mCNNGri07vSAlg56EYkncr+no7aX5dQM331hWyKvhpPK7tngK1soqKDRaRnr4ScUpKINF9mM+jbqajuONKPquHHYC6Q== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2017 18:55:10.4926 (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 Signed-off-by: Anna Schumaker --- fs/nfs/nfs4proc.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 56e8c9e04f4a..aaa87f4eacf2 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -630,9 +630,6 @@ static int nfs40_setup_sequence(struct nfs4_slot_table *tbl, { struct nfs4_slot *slot; - if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged) - return -EAGAIN; - slot = nfs4_alloc_slot(tbl); if (IS_ERR(slot)) { if (slot == ERR_PTR(-ENOMEM)) @@ -875,15 +872,6 @@ static int nfs41_setup_sequence(struct nfs4_session *session, dprintk("--> %s\n", __func__); tbl = &session->fc_slot_table; - task->tk_timeout = 0; - - if (test_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state) && - !args->sa_privileged) { - /* The state manager will wait until the slot table is empty */ - dprintk("%s session is draining\n", __func__); - return -EAGAIN; - } - slot = nfs4_alloc_slot(tbl); if (IS_ERR(slot)) { /* If out of memory, try again in 1/4 second */ @@ -961,15 +949,22 @@ int nfs4_setup_sequence(const struct nfs_client *client, struct rpc_task *task) { struct nfs4_session *session = nfs4_get_session(client); - struct nfs4_slot_table *tbl = session ? &session->fc_slot_table : - client->cl_slot_tbl; + struct nfs4_slot_table *tbl = client->cl_slot_tbl; int ret; /* slot already allocated? */ if (res->sr_slot != NULL) goto out_start; + if (session) { + tbl = &session->fc_slot_table; + task->tk_timeout = 0; + } + spin_lock(&tbl->slot_tbl_lock); + /* The state manager will wait until the slot table is empty */ + if (nfs4_slot_tbl_draining(tbl) && !args->sa_privileged) + goto out_sleep; #if defined(CONFIG_NFS_V4_1) if (session)