From patchwork Wed Jul 30 12:27: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: 4647921 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 077949F32F for ; Wed, 30 Jul 2014 12:27:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F17A8200E9 for ; Wed, 30 Jul 2014 12:27:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1278E20158 for ; Wed, 30 Jul 2014 12:27:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753407AbaG3M1v (ORCPT ); Wed, 30 Jul 2014 08:27:51 -0400 Received: from mail-qg0-f45.google.com ([209.85.192.45]:59610 "EHLO mail-qg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754640AbaG3M1t (ORCPT ); Wed, 30 Jul 2014 08:27:49 -0400 Received: by mail-qg0-f45.google.com with SMTP id f51so1271243qge.4 for ; Wed, 30 Jul 2014 05:27:48 -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=QIILgZZhsuZHKXMmRTWewgTIPFpAaVSyJNdL1489V34=; b=TVB8TrN+tqZaMDjjjcdXO/z7YBfCQmjlOUY1r/9c5ptPejg3f7A9NpMBuh2cvh1z7R EQtp3NZ5wsiqwgyLeLxE3uwkgMnfs1ewIDt4xbt6U3DpGTQt6P/OksCaYQfWIGRZPtwj vcPtdyl3E5yM5G0Law096x8otIsJ5e/uc4kIjpK2/6TxHe2lQUxSFizgq/IkJ5+sgHqY xG/31BsqPN01OWJTLy75GNukyj7rWOhv4asuLaAxYT6AFhNE6ISCVwe1VuKRXUStij5H dmHBHN4XPrC4yKACaCh+13gJ8AEi+lM9yWqnL3HhWyu/UE6hsMS0TN4PgWGW7h1cHD0I xW1A== X-Gm-Message-State: ALoCoQlTI6EWaWf+76ZT/ZEJKTL4VL9uOd+NCOo5lfrjXM4xORSKtOdw8Wt3GX0ibIS3JEzclJbP X-Received: by 10.224.122.83 with SMTP id k19mr6314070qar.78.1406723268612; Wed, 30 Jul 2014 05:27:48 -0700 (PDT) Received: from tlielax.poochiereds.net ([2001:470:8:d63:3a60:77ff:fe93:a95d]) by mx.google.com with ESMTPSA id t23sm2384767qge.13.2014.07.30.05.27.47 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Jul 2014 05:27:47 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, hch@infradead.org, Trond Myklebust Subject: [PATCH 03/37] nfsd: Don't require client_lock in free_client Date: Wed, 30 Jul 2014 08:27:04 -0400 Message-Id: <1406723258-8512-4-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1406723258-8512-1-git-send-email-jlayton@primarydata.com> References: <1406723258-8512-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=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The struct nfs_client is supposed to be invisible and unreferenced before it gets here. Signed-off-by: Trond Myklebust --- fs/nfsd/nfs4state.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index a374592e7dcf..256e9032f49c 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1416,9 +1416,6 @@ static void __free_session(struct nfsd4_session *ses) static void free_session(struct nfsd4_session *ses) { - struct nfsd_net *nn = net_generic(ses->se_client->net, nfsd_net_id); - - lockdep_assert_held(&nn->client_lock); nfsd4_del_conns(ses); nfsd4_put_drc_mem(&ses->se_fchannel); __free_session(ses); @@ -1568,9 +1565,6 @@ err_no_name: static void free_client(struct nfs4_client *clp) { - struct nfsd_net __maybe_unused *nn = net_generic(clp->net, nfsd_net_id); - - lockdep_assert_held(&nn->client_lock); while (!list_empty(&clp->cl_sessions)) { struct nfsd4_session *ses; ses = list_entry(clp->cl_sessions.next, struct nfsd4_session, @@ -1627,7 +1621,6 @@ __destroy_client(struct nfs4_client *clp) struct nfs4_openowner *oo; struct nfs4_delegation *dp; struct list_head reaplist; - struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); INIT_LIST_HEAD(&reaplist); spin_lock(&state_lock); @@ -1655,10 +1648,7 @@ __destroy_client(struct nfs4_client *clp) nfsd4_shutdown_callback(clp); if (clp->cl_cb_conn.cb_xprt) svc_xprt_put(clp->cl_cb_conn.cb_xprt); - spin_lock(&nn->client_lock); - WARN_ON_ONCE(atomic_read(&clp->cl_refcount)); free_client(clp); - spin_unlock(&nn->client_lock); } static void @@ -1862,7 +1852,6 @@ static struct nfs4_client *create_client(struct xdr_netobj name, struct sockaddr *sa = svc_addr(rqstp); int ret; struct net *net = SVC_NET(rqstp); - struct nfsd_net *nn = net_generic(net, nfsd_net_id); clp = alloc_client(name); if (clp == NULL) @@ -1870,9 +1859,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, ret = copy_cred(&clp->cl_cred, &rqstp->rq_cred); if (ret) { - spin_lock(&nn->client_lock); free_client(clp); - spin_unlock(&nn->client_lock); return NULL; } INIT_WORK(&clp->cl_cb_null.cb_work, nfsd4_run_cb_null);