diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2013-09-04 22:47:56 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2013-09-04 22:47:56 +0000 |
commit | 99fb6f77e5b8c132aeb7ed08996b210789c5e3aa (patch) | |
tree | e4a2abd396fb2664c59cb18d5be92305aa0f7506 | |
parent | ad7328341af15585f1dee4fbb63f288d2b2917e2 (diff) | |
download | FreeBSD-src-99fb6f77e5b8c132aeb7ed08996b210789c5e3aa.zip FreeBSD-src-99fb6f77e5b8c132aeb7ed08996b210789c5e3aa.tar.gz |
Crashes have been observed for NFSv4.1 mounts when the system
is being shut down which were caused by the nfscbd_pool being
destroyed before the backchannel is disabled. This patch is
believed to fix the problem, by simply avoiding ever destroying
the nfscbd_pool. Since the NFS client module cannot be unloaded,
this should not cause a memory leak.
MFC after: 2 weeks
-rw-r--r-- | sys/fs/nfsclient/nfs_clkrpc.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/fs/nfsclient/nfs_clkrpc.c b/sys/fs/nfsclient/nfs_clkrpc.c index 8b0b234..502fec5 100644 --- a/sys/fs/nfsclient/nfs_clkrpc.c +++ b/sys/fs/nfsclient/nfs_clkrpc.c @@ -278,17 +278,15 @@ nfsrvd_cbinit(int terminating) while (nfs_numnfscbd > 0) msleep(&nfs_numnfscbd, NFSDLOCKMUTEXPTR, PZERO, "nfscbdt", 0); - NFSD_UNLOCK(); - svcpool_destroy(nfscbd_pool); - nfscbd_pool = NULL; - } else - NFSD_UNLOCK(); - - nfscbd_pool = svcpool_create("nfscbd", NULL); - nfscbd_pool->sp_rcache = NULL; - nfscbd_pool->sp_assign = NULL; - nfscbd_pool->sp_done = NULL; + } - NFSD_LOCK(); + if (nfscbd_pool == NULL) { + NFSD_UNLOCK(); + nfscbd_pool = svcpool_create("nfscbd", NULL); + nfscbd_pool->sp_rcache = NULL; + nfscbd_pool->sp_assign = NULL; + nfscbd_pool->sp_done = NULL; + NFSD_LOCK(); + } } |