Commit a2d30a54df968c01fff4a412ac23f55832f45fe6

Authored by Trond Myklebust
1 parent 326ce0a6da

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>

Showing 1 changed file with 5 additions and 10 deletions Side-by-side Diff

... ... @@ -177,9 +177,6 @@
177 177  
178 178 dprintk("lockd: destroy host %s\n", host->h_name);
179 179  
180   - BUG_ON(!list_empty(&host->h_lockowners));
181   - BUG_ON(atomic_read(&host->h_count));
182   -
183 180 hlist_del_init(&host->h_hash);
184 181  
185 182 nsm_unmonitor(host);
186 183  
... ... @@ -289,13 +286,12 @@
289 286  
290 287 dprintk("lockd: release client host %s\n", host->h_name);
291 288  
292   - BUG_ON(atomic_read(&host->h_count) < 0);
293   - BUG_ON(host->h_server);
  289 + WARN_ON_ONCE(host->h_server);
294 290  
295 291 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));
299 295  
300 296 mutex_lock(&nlm_host_mutex);
301 297 nlm_destroy_host_locked(host);
... ... @@ -412,8 +408,7 @@
412 408  
413 409 dprintk("lockd: release server host %s\n", host->h_name);
414 410  
415   - BUG_ON(atomic_read(&host->h_count) < 0);
416   - BUG_ON(!host->h_server);
  411 + WARN_ON_ONCE(!host->h_server);
417 412 atomic_dec(&host->h_count);
418 413 }
419 414