mirror of
https://github.com/opnsense/src.git
synced 2026-07-05 15:26:58 -04:00
Don't let the NFS server module be unloaded as long as there are
nfsd processes running Reviewed By: iedowse PR: 16299
This commit is contained in:
parent
1630ff08a3
commit
ae00154c4b
3 changed files with 6 additions and 3 deletions
|
|
@ -134,6 +134,7 @@ extern struct nfsrvstats nfsrvstats;
|
|||
extern int nfsrv_ticks;
|
||||
extern int nfsrvw_procrastinate;
|
||||
extern int nfsrvw_procrastinate_v3;
|
||||
extern int nfsrv_numnfsd;
|
||||
|
||||
/* Various values converted to XDR form. */
|
||||
extern u_int32_t nfsrv_nfs_false, nfsrv_nfs_true, nfsrv_nfs_xdrneg1,
|
||||
|
|
|
|||
|
|
@ -551,6 +551,8 @@ nfsrv_modevent(module_t mod, int type, void *data)
|
|||
break;
|
||||
|
||||
case MOD_UNLOAD:
|
||||
if (nfsrv_numnfsd != 0)
|
||||
return EBUSY;
|
||||
|
||||
callout_stop(&nfsrv_callout);
|
||||
sysent[SYS_nfssvc].sy_narg = nfs_prev_nfssvc_sy_narg;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ MALLOC_DEFINE(M_NFSD, "NFS daemon", "Nfs server daemon structure");
|
|||
SYSCTL_DECL(_vfs_nfsrv);
|
||||
|
||||
int nfsd_waiting = 0;
|
||||
static int nfs_numnfsd = 0;
|
||||
int nfsrv_numnfsd = 0;
|
||||
static int notstarted = 1;
|
||||
|
||||
static int nfs_privport = 0;
|
||||
|
|
@ -304,7 +304,7 @@ nfssvc_nfsd(struct thread *td)
|
|||
s = splnet();
|
||||
nfsd->nfsd_td = td;
|
||||
TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain);
|
||||
nfs_numnfsd++;
|
||||
nfsrv_numnfsd++;
|
||||
|
||||
/*
|
||||
* Loop getting rpc requests until SIGKILL.
|
||||
|
|
@ -533,7 +533,7 @@ done:
|
|||
TAILQ_REMOVE(&nfsd_head, nfsd, nfsd_chain);
|
||||
splx(s);
|
||||
free((caddr_t)nfsd, M_NFSD);
|
||||
if (--nfs_numnfsd == 0)
|
||||
if (--nfsrv_numnfsd == 0)
|
||||
nfsrv_init(TRUE); /* Reinitialize everything */
|
||||
return (error);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue