From patchwork Thu Jun 19 14:50:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 4384241 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 CFC87BEECB for ; Thu, 19 Jun 2014 14:52:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEE8E20394 for ; Thu, 19 Jun 2014 14:52:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BE422038F for ; Thu, 19 Jun 2014 14:52:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932327AbaFSOwj (ORCPT ); Thu, 19 Jun 2014 10:52:39 -0400 Received: from mail-qc0-f182.google.com ([209.85.216.182]:62866 "EHLO mail-qc0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932295AbaFSOwi (ORCPT ); Thu, 19 Jun 2014 10:52:38 -0400 Received: by mail-qc0-f182.google.com with SMTP id m20so2288012qcx.27 for ; Thu, 19 Jun 2014 07:52: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=RTRiPiaj8Bub5oCPSKYZF1lfXlp6CWE5/4GwesodGH4=; b=JIohQ5za7z0ewT4orM/fERliu7Ik/h2v7/gq3cxS4lqrwkFVi0Ii8GFz/4nW79Yb6d gt+I5sMHmqBwGtlYPTLURBWdFaFGvb37DRZoJbR+WoYSH7Rcqe+Y7KEMjbp6Khs74rcD ANdbjJ7C4/ykxzVc7R5fwYgDbhxCjtuhhOPWa2kRdhv8nXxvXZSwA5yccqlR3lK4U5Gq bZ2Ub91ATB0lFM3mFqHpYfNMHcEaAE5XYW9KYaBccHzCjoMJucUe/xDSefDpsCAod2wv 7XOz/tNxWoBnm9dUBIRwFAcUvgKfubKAVdr2O2Ls8UO7QGeA/fuxjwXCF/bAdlgQs8lR J/Pg== X-Gm-Message-State: ALoCoQkS3xdO94VUuTpyTJWNJl4B+2bssxUaGF5ZekBmwh3eXt0b8/WAgi1qfoWVbk0PGbxjOGtR X-Received: by 10.224.160.142 with SMTP id n14mr7863448qax.32.1403189557552; Thu, 19 Jun 2014 07:52:37 -0700 (PDT) Received: from tlielax.poochiereds.net (cpe-107-015-124-230.nc.res.rr.com. [107.15.124.230]) by mx.google.com with ESMTPSA id r60sm3364044qgd.26.2014.06.19.07.52.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jun 2014 07:52:36 -0700 (PDT) From: Jeff Layton To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 069/104] NFSd: Don't require client_lock in free_client Date: Thu, 19 Jun 2014 10:50:15 -0400 Message-Id: <1403189450-18729-70-git-send-email-jlayton@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1403189450-18729-1-git-send-email-jlayton@primarydata.com> References: <1403189450-18729-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 7982f44aae83..2b3897f313b8 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1225,9 +1225,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); @@ -1377,9 +1374,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, @@ -1438,7 +1432,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); @@ -1466,10 +1459,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 @@ -1683,7 +1673,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) @@ -1691,9 +1680,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; } nfsd4_init_callback(&clp->cl_cb_null);