From patchwork Thu Sep 22 17:39:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9346009 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 B839060B16 for ; Thu, 22 Sep 2016 17:39:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B22092AC01 for ; Thu, 22 Sep 2016 17:39:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A6ECC2AC06; Thu, 22 Sep 2016 17:39:51 +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 4CAFC2AC04 for ; Thu, 22 Sep 2016 17:39:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965745AbcIVRjt (ORCPT ); Thu, 22 Sep 2016 13:39:49 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:35858 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754520AbcIVRjo (ORCPT ); Thu, 22 Sep 2016 13:39:44 -0400 Received: by mail-io0-f195.google.com with SMTP id z135so5611154ioe.3 for ; Thu, 22 Sep 2016 10:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JwEDNKtDqZizsD1AGaiOeptcRk2oFRyEkjfH5fNoqcA=; b=0d1swLpsOcCzfx0VmeIXBStlseKjqrhhfl7XOLDM1Wu/n+gtzGQUiKYjOujFDUANdG 7wg2AolEXvop7ZlWsXklnyZ1k5sxOLt1PFTjKHwhULj6sqPHapQwFBt9BTS9yfUw237t NyjZeNBSgCcTAEk8gn4sGpPHtVCkJrP4nfB8/ja+rNLN4R5jof3CIbdf0MirsyX+/xfb kbb0ZFMBVf16xL5rQtz5K7FQ1x/2kXjHZuYnD2zm7wjEkEolpjpARptOe5jRW3ghhT2A 6mvmmoFlx7MQNECnUWhOiXzawe3rm51PGYTjQxSn7kqGU98kk9GsQr7SrwvdLR+GD2cM KfJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=JwEDNKtDqZizsD1AGaiOeptcRk2oFRyEkjfH5fNoqcA=; b=aaeGUH5O8TwaJKxzwqEXnlEExv5+buz463S0sO7ghIBTdw2Oq7/94Rum2UmDmgAzb4 TVXlp20si+UfBCbd/zQcPeWngUGFwD8KWj+236Rw0SUCROSpWhjWzckb0yFzaYK1JEhY axf+rUGYO2H5+VM+H2/B8pwyzm8O/sp3U/tlJCR1VdZu9Lqf0l9cVnR7MnaPoCa37B8D r3OM0LgB8MFWY9k9Iag0I+Jcs6UtNuRPx3958MJdyaXo7LYATuwT8+sUU6KfK8mAqs9Y GIaI8SNwyE7tZGGpKrfUl/59BXp1xZ4gWBrOjOqkjl5jrnArKpkaaGyXI/EqTjn8xQwj Pmbg== X-Gm-Message-State: AE9vXwOjp2zbUXlNvBpnDQxCP7EGDxS5/kGgiZ/dDLHFoSet5A0EM5qx1FU1OENKL80kHw== X-Received: by 10.107.3.69 with SMTP id 66mr4574138iod.52.1474565983724; Thu, 22 Sep 2016 10:39:43 -0700 (PDT) Received: from leira.trondhjem.org.localdomain (50-108-86-94.adr01.mskg.mi.frontiernet.net. [50.108.86.94]) by smtp.gmail.com with ESMTPSA id e66sm1194267itd.22.2016.09.22.10.39.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Sep 2016 10:39:43 -0700 (PDT) From: Trond Myklebust To: anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org, Oleg Drokin Subject: [PATCH v7 11/31] NFSv4.1: Don't recheck delegations that have already been checked Date: Thu, 22 Sep 2016 13:39:01 -0400 Message-Id: <1474565961-21303-12-git-send-email-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474565961-21303-11-git-send-email-trond.myklebust@primarydata.com> References: <1474565961-21303-1-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-2-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-3-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-4-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-5-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-6-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-7-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-8-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-9-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-10-git-send-email-trond.myklebust@primarydata.com> <1474565961-21303-11-git-send-email-trond.myklebust@primarydata.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 Ensure we don't spam the server with test_stateid() calls for delegations that have already been checked. Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 3552f3a4ceb0..97a614370604 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2459,6 +2459,11 @@ static void nfs41_check_delegation_stateid(struct nfs4_state *state) return; } + if (!test_and_clear_bit(NFS_DELEGATION_TEST_EXPIRED, &delegation->flags)) { + rcu_read_unlock(); + return; + } + cred = get_rpccred(delegation->cred); rcu_read_unlock(); status = nfs41_test_and_free_expired_stateid(server, &stateid, cred);