From patchwork Fri Apr 18 18:44:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 4018081 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 A2375BFF02 for ; Fri, 18 Apr 2014 18:47:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9DEC203B5 for ; Fri, 18 Apr 2014 18:47:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1F60203AF for ; Fri, 18 Apr 2014 18:47:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754220AbaDRSra (ORCPT ); Fri, 18 Apr 2014 14:47:30 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:43528 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754305AbaDRSqf (ORCPT ); Fri, 18 Apr 2014 14:46:35 -0400 Received: by mail-ie0-f175.google.com with SMTP id to1so1877128ieb.20 for ; Fri, 18 Apr 2014 11:46:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nHsPrGTEi5D1mO3xFQmPa2kyH/FPD7mHiGtFGQv98Hw=; b=Kkygr6t6AA2VYYuO9BplX5GExn0HDuMzpHUByQwebUBrsPgQ2MZhKOqWdkMWJn9U6C KBShf8FuCba4P+cLT39NoII7WCfinaJwMghAFb3oQGpOGvXwCm9S+GP+W3BXGx42cG60 dJ3jOlct2DQeIIA/uRyPJluxwu/te3WoZs2vWLDOnQ1WoIVhmQ/JAkVIGeAfEUizC46j joMd0lG47OkCFSLbRXArfLuYKuXL8hp4MC0SX9TTfJbT2h2YjyGdaILRcG1JCaIEbbqt /MPa7wiRa497ntREpN54K4Q/eHjCgNR27+lm5AwFib/T7QFqV/DQ35y/C6NfiMkkRyrK 6wtQ== X-Gm-Message-State: ALoCoQkMWPvjhqXC5DXuPKWtrEUyXD4NUqBGNqIznneIh1xqTY3KEiMivvDltyC+6vfOiz9yfuog X-Received: by 10.50.253.194 with SMTP id ac2mr5761562igd.41.1397846795256; Fri, 18 Apr 2014 11:46:35 -0700 (PDT) Received: from leira.trondhjem.org.localdomain (50-124-5-70.drr02.mskg.mi.frontiernet.net. [50.124.5.70]) by mx.google.com with ESMTPSA id j9sm6018922igu.10.2014.04.18.11.46.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Apr 2014 11:46:34 -0700 (PDT) From: Trond Myklebust To: Bruce Fields Cc: linux-nfs@vger.kernel.org Subject: [PATCH 55/70] NFSd: Don't require client_lock in free_client Date: Fri, 18 Apr 2014 14:44:49 -0400 Message-Id: <1397846704-14567-56-git-send-email-trond.myklebust@primarydata.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1397846704-14567-55-git-send-email-trond.myklebust@primarydata.com> References: <1397846704-14567-1-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-2-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-3-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-4-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-5-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-6-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-7-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-8-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-9-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-10-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-11-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-12-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-13-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-14-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-15-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-16-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-17-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-18-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-19-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-20-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-21-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-22-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-23-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-24-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-25-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-26-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-27-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-28-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-29-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-30-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-31-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-32-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-33-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-34-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-35-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-36-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-37-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-38-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-39-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-40-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-41-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-42-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-43-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-44-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-45-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-46-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-47-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-48-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-49-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-50-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-51-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-52-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-53-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-54-git-send-email-trond.myklebust@primarydata.com> <1397846704-14567-55-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-Spam-Status: No, score=-7.5 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 The struct nfs_client is supposed to be invisible and unreferenced before it gets here. Signed-off-by: Trond Myklebust --- fs/nfsd/nfs4state.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 55a99ebaf6c9..b2406f20b529 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1252,9 +1252,6 @@ static struct nfs4_client *alloc_client(struct xdr_netobj 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, @@ -1312,7 +1309,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); @@ -1339,10 +1335,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 @@ -1569,7 +1562,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) @@ -1577,9 +1569,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);