From patchwork Mon Oct 15 21:31:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 1596761 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0ED99DFB34 for ; Mon, 15 Oct 2012 21:33:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755267Ab2JOVdA (ORCPT ); Mon, 15 Oct 2012 17:33:00 -0400 Received: from mx2.netapp.com ([216.240.18.37]:39243 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755255Ab2JOVc7 (ORCPT ); Mon, 15 Oct 2012 17:32:59 -0400 X-IronPort-AV: E=Sophos;i="4.80,590,1344236400"; d="scan'208";a="701003073" Received: from smtp1.corp.netapp.com ([10.57.156.124]) by mx2-out.netapp.com with ESMTP; 15 Oct 2012 14:32:59 -0700 Received: from lade.trondhjem.org.com ([10.63.228.120]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id q9FLVTto007211; Mon, 15 Oct 2012 14:32:55 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 12/13] lockd: Remove BUG_ON()s in fs/lockd/host.c Date: Mon, 15 Oct 2012 17:31:06 -0400 Message-Id: <1350336667-18770-14-git-send-email-Trond.Myklebust@netapp.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1350336667-18770-13-git-send-email-Trond.Myklebust@netapp.com> References: <1350336667-18770-1-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-2-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-3-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-4-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-5-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-6-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-7-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-8-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-9-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-10-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-11-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-12-git-send-email-Trond.Myklebust@netapp.com> <1350336667-18770-13-git-send-email-Trond.Myklebust@netapp.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org - Convert the non-trivial ones into WARN_ON_ONCE(). - Remove the trivial refcounting BUGs Signed-off-by: Trond Myklebust --- fs/lockd/host.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/fs/lockd/host.c b/fs/lockd/host.c index f9b22e5..0e17090 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c @@ -177,9 +177,6 @@ static void nlm_destroy_host_locked(struct nlm_host *host) dprintk("lockd: destroy host %s\n", host->h_name); - BUG_ON(!list_empty(&host->h_lockowners)); - BUG_ON(atomic_read(&host->h_count)); - hlist_del_init(&host->h_hash); nsm_unmonitor(host); @@ -289,13 +286,12 @@ void nlmclnt_release_host(struct nlm_host *host) dprintk("lockd: release client host %s\n", host->h_name); - BUG_ON(atomic_read(&host->h_count) < 0); - BUG_ON(host->h_server); + WARN_ON_ONCE(host->h_server); if (atomic_dec_and_test(&host->h_count)) { - BUG_ON(!list_empty(&host->h_lockowners)); - BUG_ON(!list_empty(&host->h_granted)); - BUG_ON(!list_empty(&host->h_reclaim)); + WARN_ON_ONCE(!list_empty(&host->h_lockowners)); + WARN_ON_ONCE(!list_empty(&host->h_granted)); + WARN_ON_ONCE(!list_empty(&host->h_reclaim)); mutex_lock(&nlm_host_mutex); nlm_destroy_host_locked(host); @@ -412,8 +408,7 @@ void nlmsvc_release_host(struct nlm_host *host) dprintk("lockd: release server host %s\n", host->h_name); - BUG_ON(atomic_read(&host->h_count) < 0); - BUG_ON(!host->h_server); + WARN_ON_ONCE(!host->h_server); atomic_dec(&host->h_count); }