From patchwork Thu Jun 26 19:12:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4430361 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8C19ABEECB for ; Thu, 26 Jun 2014 19:14:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B0642024D for ; Thu, 26 Jun 2014 19:14:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CB500202FF for ; Thu, 26 Jun 2014 19:14:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751739AbaFZTOU (ORCPT ); Thu, 26 Jun 2014 15:14:20 -0400 Received: from mail-qa0-f44.google.com ([209.85.216.44]:51556 "EHLO mail-qa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbaFZTOT (ORCPT ); Thu, 26 Jun 2014 15:14:19 -0400 Received: by mail-qa0-f44.google.com with SMTP id hw13so3173483qab.17 for ; Thu, 26 Jun 2014 12:14:19 -0700 (PDT) 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=QARtVqSoP7pnRME5yCWgeZslVgXsQ0jXdxdYOrVREgw=; b=OpnrAex9zBVNjrDRaC87CYnvsnxGp9qnCN4LI/+v+/da0soHtQcArj31R+yTkIZl8M C47kmRHufd8y7sCKwcojTB8/D/z/tiohkVtjfgh6ybv6/cJ9bBoKhvGWpkkGjl0eYD5n HRtr/vDyeRGDupKHvzfmnrkkudHhgxF5c5GGWRY/F5ydZUZE0EUvzAnsXhhoiv4tZru/ +jLa7QJ1vXYhD5Ah9pyUOf3s9VOC0nGDpaG+TFCAsGzunoF7JkSR7zykEcs3bHi3MzQD ISKx3KJ6Zrp9yLNZNFrA2vJc9pZ6YWnYCp86uWgQ4RiXzoUlKdmGDKrfwZo2YpljZEB5 kZrQ== X-Gm-Message-State: ALoCoQmdHK7T6T1qHTv5Ero9/B6DOjZ4rnsQJYv7RNhAdGsvwkR7pxcMVQdhcGq+PvBh1ux+GbpR X-Received: by 10.140.29.139 with SMTP id b11mr23996067qgb.44.1403810059048; Thu, 26 Jun 2014 12:14:19 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id 88sm4763039qgh.5.2014.06.26.12.14.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jun 2014 12:14:18 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, Trond Myklebust Subject: [PATCH v2 024/117] nfsd: Always use lookup_clientid() in nfsd4_process_open1 Date: Thu, 26 Jun 2014 15:12:04 -0400 Message-Id: <1403810017-16062-25-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1403810017-16062-1-git-send-email-jlayton@primarydata.com> References: <1403810017-16062-1-git-send-email-jlayton@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Trond Myklebust In later patches, we'll be moving the stateowner table into the nfs4_client, and by doing this we ensure that we have a cached nfs4_client pointer. Signed-off-by: Trond Myklebust Reviewed-by: Christoph Hellwig --- fs/nfsd/nfs4state.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index ab45350fbd5a..6b9dbdc52b47 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -3032,19 +3032,19 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate, if (open->op_file == NULL) return nfserr_jukebox; + status = lookup_clientid(clientid, cstate, nn); + if (status) + return status; + clp = cstate->clp; + strhashval = ownerstr_hashval(clientid->cl_id, &open->op_owner); oo = find_openstateowner_str(strhashval, open, cstate->minorversion, nn); open->op_openowner = oo; if (!oo) { - status = lookup_clientid(clientid, cstate, nn); - if (status) - return status; - clp = cstate->clp; goto new_owner; } if (!(oo->oo_flags & NFS4_OO_CONFIRMED)) { /* Replace unconfirmed owners without checking for replay. */ - clp = oo->oo_owner.so_client; release_openowner(oo); open->op_openowner = NULL; goto new_owner; @@ -3052,7 +3052,6 @@ nfsd4_process_open1(struct nfsd4_compound_state *cstate, status = nfsd4_check_seqid(cstate, &oo->oo_owner, open->op_seqid); if (status) return status; - clp = oo->oo_owner.so_client; goto alloc_stateid; new_owner: oo = alloc_init_open_stateowner(strhashval, open, cstate);