Skip to content

Commit a2d30a5

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
lockd: Remove BUG_ON()s in fs/lockd/host.c
- Convert the non-trivial ones into WARN_ON_ONCE(). - Remove the trivial refcounting BUGs Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent 326ce0a commit a2d30a5

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

‎fs/lockd/host.c‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ static void nlm_destroy_host_locked(struct nlm_host *host)
177177

178178
dprintk("lockd: destroy host %s\n", host->h_name);
179179

180-
BUG_ON(!list_empty(&host->h_lockowners));
181-
BUG_ON(atomic_read(&host->h_count));
182-
183180
hlist_del_init(&host->h_hash);
184181

185182
nsm_unmonitor(host);
@@ -289,13 +286,12 @@ void nlmclnt_release_host(struct nlm_host *host)
289286

290287
dprintk("lockd: release client host %s\n", host->h_name);
291288

292-
BUG_ON(atomic_read(&host->h_count) < 0);
293-
BUG_ON(host->h_server);
289+
WARN_ON_ONCE(host->h_server);
294290

295291
if (atomic_dec_and_test(&host->h_count)) {
296-
BUG_ON(!list_empty(&host->h_lockowners));
297-
BUG_ON(!list_empty(&host->h_granted));
298-
BUG_ON(!list_empty(&host->h_reclaim));
292+
WARN_ON_ONCE(!list_empty(&host->h_lockowners));
293+
WARN_ON_ONCE(!list_empty(&host->h_granted));
294+
WARN_ON_ONCE(!list_empty(&host->h_reclaim));
299295

300296
mutex_lock(&nlm_host_mutex);
301297
nlm_destroy_host_locked(host);
@@ -412,8 +408,7 @@ void nlmsvc_release_host(struct nlm_host *host)
412408

413409
dprintk("lockd: release server host %s\n", host->h_name);
414410

415-
BUG_ON(atomic_read(&host->h_count) < 0);
416-
BUG_ON(!host->h_server);
411+
WARN_ON_ONCE(!host->h_server);
417412
atomic_dec(&host->h_count);
418413
}
419414

0 commit comments

Comments
 (0)