Commit 2433c417 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-2.6.28' of git://linux-nfs.org/~bfields/linux

* 'for-2.6.28' of git://linux-nfs.org/~bfields/linux:
  NLM: client-side nlm_lookup_host() should avoid matching on srcaddr
  nfsd: use of unitialized list head on error exit in nfs4recover.c
  Add a reference to sunrpc in svc_addsock
  nfsd: clean up grace period on early exit
parents cd92a17e a8d82d9b
...@@ -167,7 +167,8 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni) ...@@ -167,7 +167,8 @@ static struct nlm_host *nlm_lookup_host(struct nlm_lookup_host_info *ni)
continue; continue;
if (host->h_server != ni->server) if (host->h_server != ni->server)
continue; continue;
if (!nlm_cmp_addr(nlm_srcaddr(host), ni->src_sap)) if (ni->server &&
!nlm_cmp_addr(nlm_srcaddr(host), ni->src_sap))
continue; continue;
/* Move to head of hash chain. */ /* Move to head of hash chain. */
......
...@@ -181,6 +181,7 @@ lockd(void *vrqstp) ...@@ -181,6 +181,7 @@ lockd(void *vrqstp)
} }
flush_signals(current); flush_signals(current);
cancel_delayed_work_sync(&grace_period_end); cancel_delayed_work_sync(&grace_period_end);
locks_end_grace(&lockd_manager);
if (nlmsvc_ops) if (nlmsvc_ops)
nlmsvc_invalidate_all(); nlmsvc_invalidate_all();
nlm_shutdown_hosts(); nlm_shutdown_hosts();
......
...@@ -225,12 +225,12 @@ nfsd4_list_rec_dir(struct dentry *dir, recdir_func *f) ...@@ -225,12 +225,12 @@ nfsd4_list_rec_dir(struct dentry *dir, recdir_func *f)
return 0; return 0;
nfs4_save_user(&uid, &gid); nfs4_save_user(&uid, &gid);
INIT_LIST_HEAD(dentries);
filp = dentry_open(dget(dir), mntget(rec_dir.mnt), O_RDONLY); filp = dentry_open(dget(dir), mntget(rec_dir.mnt), O_RDONLY);
status = PTR_ERR(filp); status = PTR_ERR(filp);
if (IS_ERR(filp)) if (IS_ERR(filp))
goto out; goto out;
INIT_LIST_HEAD(dentries);
status = vfs_readdir(filp, nfsd4_build_dentrylist, &dla); status = vfs_readdir(filp, nfsd4_build_dentrylist, &dla);
fput(filp); fput(filp);
while (!list_empty(dentries)) { while (!list_empty(dentries)) {
......
...@@ -3261,6 +3261,7 @@ nfs4_state_shutdown(void) ...@@ -3261,6 +3261,7 @@ nfs4_state_shutdown(void)
{ {
cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work); cancel_rearming_delayed_workqueue(laundry_wq, &laundromat_work);
destroy_workqueue(laundry_wq); destroy_workqueue(laundry_wq);
locks_end_grace(&nfsd4_manager);
nfs4_lock_state(); nfs4_lock_state();
nfs4_release_reclaim(); nfs4_release_reclaim();
__nfs4_state_shutdown(); __nfs4_state_shutdown();
......
...@@ -1183,7 +1183,11 @@ int svc_addsock(struct svc_serv *serv, ...@@ -1183,7 +1183,11 @@ int svc_addsock(struct svc_serv *serv,
else if (so->state > SS_UNCONNECTED) else if (so->state > SS_UNCONNECTED)
err = -EISCONN; err = -EISCONN;
else { else {
svsk = svc_setup_socket(serv, so, &err, SVC_SOCK_DEFAULTS); if (!try_module_get(THIS_MODULE))
err = -ENOENT;
else
svsk = svc_setup_socket(serv, so, &err,
SVC_SOCK_DEFAULTS);
if (svsk) { if (svsk) {
struct sockaddr_storage addr; struct sockaddr_storage addr;
struct sockaddr *sin = (struct sockaddr *)&addr; struct sockaddr *sin = (struct sockaddr *)&addr;
...@@ -1196,7 +1200,8 @@ int svc_addsock(struct svc_serv *serv, ...@@ -1196,7 +1200,8 @@ int svc_addsock(struct svc_serv *serv,
spin_unlock_bh(&serv->sv_lock); spin_unlock_bh(&serv->sv_lock);
svc_xprt_received(&svsk->sk_xprt); svc_xprt_received(&svsk->sk_xprt);
err = 0; err = 0;
} } else
module_put(THIS_MODULE);
} }
if (err) { if (err) {
sockfd_put(so); sockfd_put(so);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment