cleans up some code in lockd/host.c, fixes an error printk and makes it a
fatal BUG if nlmsvc_free_host_resources fails.
Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
                if (host->h_server != server)
                        continue;
 
-               {
-                       if (hp != nlm_hosts + hash) {
-                               *hp = host->h_next;
-                               host->h_next = nlm_hosts[hash];
-                               nlm_hosts[hash] = host;
-                       }
-                       nlm_get_host(host);
-                       mutex_unlock(&nlm_host_mutex);
-                       return host;
+               if (hp != nlm_hosts + hash) {
+                       *hp = host->h_next;
+                       host->h_next = nlm_hosts[hash];
+                       nlm_hosts[hash] = host;
                }
+               nlm_get_host(host);
+               goto out;
        }
 
        /* Sadly, the host isn't in our hash table yet. See if
 
         * the file.
         */
        if ((nfserr = nlmsvc_ops->fopen(rqstp, f, &file->f_file)) != 0) {
-               dprintk("lockd: open failed (nfserr %d)\n", ntohl(nfserr));
+               dprintk("lockd: open failed (error %d)\n", nfserr);
                goto out_free;
        }
 
 {
        dprintk("lockd: nlmsvc_free_host_resources\n");
 
-       if (nlm_traverse_files(host, NLM_ACT_UNLOCK))
+       if (nlm_traverse_files(host, NLM_ACT_UNLOCK)) {
                printk(KERN_WARNING
-                       "lockd: couldn't remove all locks held by %s",
+                       "lockd: couldn't remove all locks held by %s\n",
                        host->h_name);
+               BUG();
+       }
 }
 
 /*