Commit Graph

153 Commits

Author SHA1 Message Date
christos 44768c61d0 put nuidhash_max in a file that is shared between server and client code. 2009-12-31 20:01:33 +00:00
christos 3506b644ed handle the nuidhash_max lossage differently 2009-12-31 19:38:16 +00:00
rmind 40cf6f3659 Remove uarea swap-out functionality:
- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
2009-10-21 21:11:57 +00:00
pooka b7f6f78fc9 Remove stale comment about super user. no functional change 2009-09-14 14:37:52 +00:00
christos e234b387dc The compatibility call to re-export from sys_mount() calls
mountd_set_exports_list, with the mnt_updating mutex held. Account for that
to avoid a locking against myself panic.
2009-07-07 14:09:05 +00:00
ad 7839123ed3 Remove pointless error check. 2009-05-23 14:44:56 +00:00
bouyer 615c2e4e8d PR kern/41154: possible races in NFS server code
Fix some of the races (but probably not all of them) in the NFS server code.
nfssvc_nfsd(): change a splsoftclock()/spx() to mutex_enter/exit(&nfsd_lock)
 (I guess it was forgotten when the nfsd code was made SMP safe)
m_freem(nd_nam) in nfsrv_slpderef() instead of nfsrv_zapsock() to
 avoid possible use after free in nfssvc_nfsd()
Fix nfsrv_slpderef() to not release  nfsd_lock before testing SLP_VALID
 and reaquiring it just after. This could cause a use after free
 of the slp if one thread is in nfsrv_slpderef() and the other one grabs
 slp from nfssvc_sockpending and zap it.
2009-04-10 19:04:14 +00:00
cegger b8817e4aed ansify function definitions 2009-03-15 17:14:40 +00:00
dsl 454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
dsl 02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
pooka bd6148602f g/c unused malloc types 2008-11-28 06:47:08 +00:00
ad 92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
ad df8183316d Remove COMPAT ifdefs that might as well be comments (i.e., they cost us
almost nothing).
2008-11-14 13:33:55 +00:00
christos ff1eb234c1 do the proper ifdef dance for non-inet families 2008-10-09 14:38:21 +00:00
pooka b334ad7b43 Don't free nd_mrep in case of no reply. It is (at least in one
case) freed already within the rpc handler.

XXX: this line and another was originally committed with "don't
leak mbufs", but given that currently it can double-free an mbuf
and essentially crash the system, I'll opt for the leak.  Needless
to say, this needs revisiting, but that requires a large scale
campaign due to the sticky nature of nfsm love.
2008-09-28 00:10:18 +00:00
plunky fd7356a917 Convert socket options code to use a sockopt structure
instead of laying everything into an mbuf.

approved by core
2008-08-06 15:01:23 +00:00
ad a00bd89dab Replace references to getsock/getvnode. 2008-06-24 11:18:14 +00:00
ad d4da0343a9 Make it compile. 2008-05-20 00:18:31 +00:00
yamt 89ee456bc7 as softint network processing is now safe to block,
make some mutexes adaptive.
2008-04-28 15:06:51 +00:00
ad 15e29e981b Merge the socket locking patch:
- Socket layer becomes MP safe.
- Unix protocols become MP safe.
- Allows protocol processing interrupts to safely block on locks.
- Fixes a number of race conditions.

With much feedback from matt@ and plunky@.
2008-04-24 11:38:36 +00:00
rmind 2aaf481e64 G/C l->l_locks.
OK by <ad>.
2008-03-23 00:46:25 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
elad cd05a6ee9b Introduce a new kauth action, KAUTH_NETWORK_NFS, and two requests,
KAUTH_REQ_NETWORK_NFS_EXPORT and KAUTH_REQ_NETWORK_NFS_SVC, and use them
to replace two KAUTH_GENERIC_ISSUSER calls in the NFS code.

Also replace two more with KAUTH_SYSTEM_MKNOD, where appropriate.

Documetnation and examples updated. More to come.
2008-02-28 17:07:49 +00:00
yamt 677860cb8a use kmem_alloc instead of malloc. 2008-01-02 19:26:45 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
dsl 7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
yamt 1ed3981c19 merge non-intrusive nfs changes from vmlocking. 2007-12-04 17:42:30 +00:00
yamt 99e9015b80 nfssvc_nfsd: remove a wrong assertion. 2007-11-22 13:30:39 +00:00
ad 451aacda90 Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
2007-10-08 15:12:05 +00:00
yamt c379ad6567 - instead of scanning an array of iods, maintain a list of idle iods.
- make nfs_getset_niothreads MP friendly.
2007-08-10 15:12:56 +00:00
yamt 8e473ee7cb push kernel_lock a little. 2007-08-08 12:27:56 +00:00
yamt 5bde4f20f7 nfsrv_slpderef: add an assertion. 2007-08-02 12:46:03 +00:00
yamt 4af13cf23b nfssvc_nfsd: fix a wrong assertion. PR/36710 from Tobias Nygren. 2007-08-02 12:44:18 +00:00
yamt 6bc5a5a70f nfsrv_zapsock: update SLP_DOREC for consistency. 2007-08-02 12:42:17 +00:00
yamt 76eb9e074c nfssvc_nfsd: don't leave sockets with SLP_DISCONN. 2007-08-02 12:40:36 +00:00
yamt 97c7bbe6b8 - fix decreasing of vfs.nfs.iothreads after the recent partial merge
of vmlocking.
- don't make nfsiod exit with requests left.
- make NFSSVC_BIOD a dummy so that nfsiod can be simplified.
2007-07-20 15:36:41 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
yamt f0baa9219b - nfsrv_slpderef: fix a locking botch.
(should fix "slp->ns_sref == 0" assertion failures in nfsrv_init)
- add some related assertions.
2007-06-22 14:39:59 +00:00
yamt 0eaaf7405e nfssvc_iod: fix nm_bufqiods accounting on exit. 2007-06-19 13:13:37 +00:00
yamt ac63eb98da - nfssvc_nfsd: clear nfsd_slp when exiting.
(fix an assertion failure in rev.1.112.)

- nfsrv_init: add assertions.
2007-06-12 09:30:49 +00:00
yamt 63abe2b629 nfssvc_nfsd: check SPCF_SHOULDYIELD and yield cpu. 2007-06-01 14:43:17 +00:00
yamt ab5f84630b nfssvc_nfsd: add assertions. 2007-06-01 14:10:02 +00:00
yamt 05aaff39ff use mutex and condvar. 2007-06-01 11:56:03 +00:00
yamt 6e3d653f39 fix a lock leak in rev.1.109. pointed by Mindaugas R. 2007-04-30 10:30:51 +00:00
yamt aca6764004 use mutex and condver. 2007-04-29 10:30:18 +00:00
yamt 337d052ee1 hold proclist_mutex when calling psignal(). 2007-04-19 11:05:14 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
thorpej b3667ada6d TRUE -> true, FALSE -> false 2007-02-22 06:05:00 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
yamt 2224a4350f plug a mbuf leak. 2007-01-17 12:40:36 +00:00