diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:41 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-20 13:44:41 -0500 |
commit | 4c060b531006e0711db32a132d6ac7661594b280 (patch) | |
tree | 899f281dfec3da7e29ede2e76019b3861116714f /fs/lockd/host.c | |
parent | 26bcbf965f857c710adafd16cf424f043006b5dd (diff) |
lockd: Fix Oopses due to list manipulation errors.
The patch "stop abusing file_lock_list introduces a couple of bugs since
the locks may be copied and need to be removed from the lists when they are
destroyed.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r-- | fs/lockd/host.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index f456f8ed9acd..112ebf8b8dfe 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -245,8 +245,12 @@ void nlm_release_host(struct nlm_host *host) | |||
245 | { | 245 | { |
246 | if (host != NULL) { | 246 | if (host != NULL) { |
247 | dprintk("lockd: release host %s\n", host->h_name); | 247 | dprintk("lockd: release host %s\n", host->h_name); |
248 | atomic_dec(&host->h_count); | ||
249 | BUG_ON(atomic_read(&host->h_count) < 0); | 248 | BUG_ON(atomic_read(&host->h_count) < 0); |
249 | if (atomic_dec_and_test(&host->h_count)) { | ||
250 | BUG_ON(!list_empty(&host->h_lockowners)); | ||
251 | BUG_ON(!list_empty(&host->h_granted)); | ||
252 | BUG_ON(!list_empty(&host->h_reclaim)); | ||
253 | } | ||
250 | } | 254 | } |
251 | } | 255 | } |
252 | 256 | ||
@@ -334,7 +338,6 @@ nlm_gc_hosts(void) | |||
334 | rpc_destroy_client(host->h_rpcclnt); | 338 | rpc_destroy_client(host->h_rpcclnt); |
335 | } | 339 | } |
336 | } | 340 | } |
337 | BUG_ON(!list_empty(&host->h_lockowners)); | ||
338 | kfree(host); | 341 | kfree(host); |
339 | nrhosts--; | 342 | nrhosts--; |
340 | } | 343 | } |