From patchwork Thu Jun 26 19:13:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4430951 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 28AB19F2C8 for ; Thu, 26 Jun 2014 19:15:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BF7B202AE for ; Thu, 26 Jun 2014 19:15:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B38F2028D for ; Thu, 26 Jun 2014 19:15:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751881AbaFZTPn (ORCPT ); Thu, 26 Jun 2014 15:15:43 -0400 Received: from mail-qg0-f54.google.com ([209.85.192.54]:48669 "EHLO mail-qg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbaFZTPh (ORCPT ); Thu, 26 Jun 2014 15:15:37 -0400 Received: by mail-qg0-f54.google.com with SMTP id q107so3489135qgd.27 for ; Thu, 26 Jun 2014 12:15:37 -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=wGFSJRtP7rtqQBXH7Mp+oLfFYwOy9sQ6E14JvLJNT60=; b=Av9RYPkDi/SpWYfMtPSN1KtXDOr1xGuJ0+K6x6A149pPdls1ll89e9IIW+zMiqT2dA pIBGH65LQzw5+9/CYh95ZtcP57E0QXqrANfbnqqZlic/wDX8IhxSbQGjskuW40bQr9hI 4d1jh9llZvcXlNa+i4rEeDMgBBZaR4LjX4un5PNHPux1qmPu2O/m3K3h/1mzlvdsjew0 S2QIFieKFFdVUwLYD6nsA/tqyG3idgMOIvE044VaJ4aQTmlqpgWtE47BODoMGMbLQOu1 oEWfbJjcH/qE1NgUNgMmcqQ0hA/4xM4zU67sMPEsgmSUHMKLzD1hTBvh1lo2ossqAQ57 tDtg== X-Gm-Message-State: ALoCoQn4JftHhHD00pjKDA7R3peeR0v5nJ8PixaDc1GGUH4wEJck2WG84JdKz5CBTP4oXgLVsJ5Q X-Received: by 10.140.30.195 with SMTP id d61mr6318569qgd.12.1403810137386; Thu, 26 Jun 2014 12:15:37 -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.15.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jun 2014 12:15:36 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, Trond Myklebust Subject: [PATCH v2 082/117] nfsd: Don't require client_lock in free_client Date: Thu, 26 Jun 2014 15:13:02 -0400 Message-Id: <1403810017-16062-83-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 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 889854591557..461e6d5c6af1 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1362,9 +1362,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); @@ -1514,9 +1511,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, @@ -1575,7 +1569,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); @@ -1603,10 +1596,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 @@ -1809,7 +1799,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) @@ -1817,9 +1806,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; } clp->cl_time = get_seconds();