Commit 93dd048d authored by Linus Torvalds's avatar Linus Torvalds

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

Pull two nfsd bugfixes from J. Bruce Fields.

* 'for-3.5' of git://linux-nfs.org/~bfields/linux:
  nfsd4: BUG_ON(!is_spin_locked()) no good on UP kernels
  NFS: hard-code init_net for NFS callback transports
parents 069915b9 bc2df47a
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/kthread.h> #include <linux/kthread.h>
#include <linux/sunrpc/svcauth_gss.h> #include <linux/sunrpc/svcauth_gss.h>
#include <linux/sunrpc/bc_xprt.h> #include <linux/sunrpc/bc_xprt.h>
#include <linux/nsproxy.h>
#include <net/inet_sock.h> #include <net/inet_sock.h>
...@@ -107,7 +106,7 @@ nfs4_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt) ...@@ -107,7 +106,7 @@ nfs4_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt)
{ {
int ret; int ret;
ret = svc_create_xprt(serv, "tcp", xprt->xprt_net, PF_INET, ret = svc_create_xprt(serv, "tcp", &init_net, PF_INET,
nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS);
if (ret <= 0) if (ret <= 0)
goto out_err; goto out_err;
...@@ -115,7 +114,7 @@ nfs4_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt) ...@@ -115,7 +114,7 @@ nfs4_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt)
dprintk("NFS: Callback listener port = %u (af %u)\n", dprintk("NFS: Callback listener port = %u (af %u)\n",
nfs_callback_tcpport, PF_INET); nfs_callback_tcpport, PF_INET);
ret = svc_create_xprt(serv, "tcp", xprt->xprt_net, PF_INET6, ret = svc_create_xprt(serv, "tcp", &init_net, PF_INET6,
nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS);
if (ret > 0) { if (ret > 0) {
nfs_callback_tcpport6 = ret; nfs_callback_tcpport6 = ret;
...@@ -184,7 +183,7 @@ nfs41_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt) ...@@ -184,7 +183,7 @@ nfs41_callback_up(struct svc_serv *serv, struct rpc_xprt *xprt)
* fore channel connection. * fore channel connection.
* Returns the input port (0) and sets the svc_serv bc_xprt on success * Returns the input port (0) and sets the svc_serv bc_xprt on success
*/ */
ret = svc_create_xprt(serv, "tcp-bc", xprt->xprt_net, PF_INET, 0, ret = svc_create_xprt(serv, "tcp-bc", &init_net, PF_INET, 0,
SVC_SOCK_ANONYMOUS); SVC_SOCK_ANONYMOUS);
if (ret < 0) { if (ret < 0) {
rqstp = ERR_PTR(ret); rqstp = ERR_PTR(ret);
...@@ -254,7 +253,7 @@ int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt) ...@@ -254,7 +253,7 @@ int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt)
char svc_name[12]; char svc_name[12];
int ret = 0; int ret = 0;
int minorversion_setup; int minorversion_setup;
struct net *net = current->nsproxy->net_ns; struct net *net = &init_net;
mutex_lock(&nfs_callback_mutex); mutex_lock(&nfs_callback_mutex);
if (cb_info->users++ || cb_info->task != NULL) { if (cb_info->users++ || cb_info->task != NULL) {
...@@ -330,7 +329,7 @@ void nfs_callback_down(int minorversion) ...@@ -330,7 +329,7 @@ void nfs_callback_down(int minorversion)
cb_info->users--; cb_info->users--;
if (cb_info->users == 0 && cb_info->task != NULL) { if (cb_info->users == 0 && cb_info->task != NULL) {
kthread_stop(cb_info->task); kthread_stop(cb_info->task);
svc_shutdown_net(cb_info->serv, current->nsproxy->net_ns); svc_shutdown_net(cb_info->serv, &init_net);
svc_exit_thread(cb_info->rqst); svc_exit_thread(cb_info->rqst);
cb_info->serv = NULL; cb_info->serv = NULL;
cb_info->rqst = NULL; cb_info->rqst = NULL;
......
...@@ -900,7 +900,7 @@ static void free_session(struct kref *kref) ...@@ -900,7 +900,7 @@ static void free_session(struct kref *kref)
struct nfsd4_session *ses; struct nfsd4_session *ses;
int mem; int mem;
BUG_ON(!spin_is_locked(&client_lock)); lockdep_assert_held(&client_lock);
ses = container_of(kref, struct nfsd4_session, se_ref); ses = container_of(kref, struct nfsd4_session, se_ref);
nfsd4_del_conns(ses); nfsd4_del_conns(ses);
spin_lock(&nfsd_drc_lock); spin_lock(&nfsd_drc_lock);
...@@ -1080,7 +1080,7 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name) ...@@ -1080,7 +1080,7 @@ static struct nfs4_client *alloc_client(struct xdr_netobj name)
static inline void static inline void
free_client(struct nfs4_client *clp) free_client(struct nfs4_client *clp)
{ {
BUG_ON(!spin_is_locked(&client_lock)); lockdep_assert_held(&client_lock);
while (!list_empty(&clp->cl_sessions)) { while (!list_empty(&clp->cl_sessions)) {
struct nfsd4_session *ses; struct nfsd4_session *ses;
ses = list_entry(clp->cl_sessions.next, struct nfsd4_session, ses = list_entry(clp->cl_sessions.next, struct nfsd4_session,
......
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