Commit Graph

1371 Commits

Author SHA1 Message Date
yamt b92b080272 remove unused r_timer member. 2010-01-19 13:29:40 +00:00
pooka c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
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
christos 41b6684af0 appease gcc. 2009-12-31 19:31:31 +00:00
christos 30da2a8fa7 nuidhash_max is needed by sys_nfssvc 2009-12-31 19:30:45 +00:00
pooka 3142d3ac31 Define namei flag INRENAME and set it if a lookup operation is part
of rename.  This helps with building better asserts for rename in
the DELETE lookup ... the RENAME lookup is quite obviously a part
of rename.
2009-12-23 01:09:24 +00:00
dyoung 8641587693 For readability's sake, write NULL instead of (type *)0. 2009-12-06 18:00:15 +00:00
cegger 9480c51b04 Add a flags argument to pmap_kenter_pa(9).
Patch showed on tech-kern@ http://mail-index.netbsd.org/tech-kern/2009/11/04/msg006434.html
No objections.
2009-11-07 07:27:40 +00:00
bouyer 5dabc83466 Handle EWOULDBLOCK the same way as EPIPE. It seems the TCP socket layer
can return EWOULDBLOCK on some occasion when the connection is broken.
2009-11-05 08:11:24 +00:00
snj 0d31d3264f Remove 3rd and 4th clauses. OK cl@ (copyright holder). 2009-10-23 02:32:33 +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 65aa3ef107 If send fails with EMSGSIZE for whatever reason, it's unlikely to
succeed no matter how hard we retry.  So just fail the request.
2009-10-16 23:36:05 +00:00
dholland 8d36057243 Move a big wodge of symlink-following code from nfsd to inside
lookup_for_nfsd(). This code is, or at least should be, the same as
the regular symlink-following code plus an extra flag nfsd needs.

The two lots of code can/will be merged in the future.
2009-09-27 17:23:53 +00:00
dholland fb458255a3 Rename lookup() to lookup_for_nfsd(), to make it clear just whose
private backdoor entry point this is.

Also, clone the lookup_for_nfsd() entry point as
lookup_for_nfsd_index(), for use by a different call site in nfsd that
does different unclean things with nameidata.
2009-09-27 17:19:07 +00:00
pooka b7f6f78fc9 Remove stale comment about super user. no functional change 2009-09-14 14:37:52 +00:00
tls 8352accb45 ...and one more missed in the earlier commit (sigh). Kernels should build
again now.
2009-09-03 21:06:21 +00:00
tls 41715850eb Missed this file in previous commit, accidentally checked in fix to local
repository copy!  Sorry about that, folks.
2009-09-03 20:59:12 +00:00
apb 72648fe99b Use pid_t, not short, for a pid.
Part of PR 41255 from Kurt Lidl.
2009-07-14 20:59:54 +00:00
roy 5f399f5c68 Use a function to add extra data to the vendor area so that data added
remains constant for both DISCOVER and REQUEST messages.
2009-07-10 12:16:31 +00:00
roy eb66460837 Protect against short IP addresses in the DHCP message. 2009-07-10 02:41:39 +00:00
roy 0aeddffdd4 When using DHCP, request the parameters that we need. Fixes PR kern/38830.
Thanks to Tim McIntosh.
2009-07-10 01:29:54 +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
elad 870920260d Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

Keep vaccess() for KPI compatibility and to keep element of least
surprise. A "diagnostic" message warning that vaccess() is deprecated will
be printed when it's used (obviously, only in DIAGNOSTIC kernels).

No objections on tech-kern@:

	http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html
2009-06-23 19:36:38 +00:00
ad fc7505ae27 Broken assertion. 2009-05-23 18:19:19 +00:00
ad a742b7d3d8 - Cosmetic change to previous.
- Add a comment.
2009-05-23 15:59:30 +00:00
ad d4b01cb0fb - Fix a race between umount()/mount() and nfssvc().
- Toss netexport state on nfsserver module unload.
2009-05-23 15:31:21 +00:00
ad abc14f1bc4 Fix a crash when unloading nfsserver module. 2009-05-23 14:45:18 +00:00
ad 7839123ed3 Remove pointless error check. 2009-05-23 14:44:56 +00:00
yamt be2d4d69b3 nfs_clearcommit: fix a race with vnode cleaning. 2009-05-14 15:42:22 +00:00
yamt 8276e4de1a nfs_lookup: vn_lock the vnode returned by cache_lookup_raw
before feeding it to VOP_GETATTR.  it's necessary because the vnode might
be being cleaned by getcleanvnode.

it's an instance of more general races between vnode reclaim and
unlocked VOPs.  however, this one happens somewhat often because it can be
triggered by getnewvnode rather than revoke.
2009-05-10 05:18:26 +00:00
yamt dd0402b09c restore lines, esp. a vrele() call, which i mistakenly removed
in the previous.  (rev.1.276)
2009-05-10 03:51:43 +00:00
cegger a531bda091 correct previous: use %zu for BOOTP_SIZE_(MIN,MAX).
Pointed out by David Holland
2009-05-06 05:34:12 +00:00
cegger 4bbacd3411 buildfix: use %d for BOOTP_SIZE_(MIN,MAX).
Makes i386 ALL kernel build again.
2009-05-05 12:48:31 +00:00
yamt 6f0983460b when freeing cn_pnbuf, make it NULL if DIAGNOSTIC. 2009-05-04 06:05:19 +00:00
yamt fc99505dcc nfs_lookup: handle the case where the vnode returned cache_lookup_raw is
being reclaimed by another thread.  after recent changes in cache_lookup_raw,
there's a race between cache_lookup_raw/vtryget and getcleanvnode/vclean.
PR/41028.
2009-05-04 05:59:35 +00:00
yamt 5f6d027dab nfs_lookup: add an assertion. 2009-05-04 05:50:17 +00:00
yamt ffdcb971f2 nfs_lookup: comments. no functional changes. 2009-05-04 05:49:00 +00:00
manu 20f56b3015 - Silence warning when running with debug enabled
- Remind the administrator about the required DHCP option when some are
  missing, instead of silently failing, you stupid computer!
2009-05-02 21:06:51 +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
bouyer 2f4b50f71c PR kern/41158: nfs_rename() locking against myself
nfsrv_rename() can exit without calling genfs_renamelock_exit() because
the nfsm_reply() can do return (0) on error.
Change nfsm_reply to use 'error = 0; goto nfsmout' instead.
Fix a few place so it's safe to goto nfsmout from nfsm_reply, or other
macros calling it.
As a side effect it could fix a missing vrele(dirp) in various place where
nfsm_reply could return(0).
2009-04-10 18:58:50 +00:00
cegger b8817e4aed ansify function definitions 2009-03-15 17:14:40 +00:00
dsl 82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +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
yamt 6f8f12ad37 nfs_lookup: fix a comment. 2009-03-13 15:01:29 +00:00
yamt d32e59ebfc nfs_bioread: don't truncate values in a debug printf. 2009-03-13 15:00:34 +00:00
nisimura e12e37e63e Update comments to reflect realities; the filenames were changed in 1997
and another one was added years ago.
2009-03-04 06:56:25 +00:00
ad 350a5f88e7 PR kern/40491 5.0: nfs timer can crash/break on smp
Hack around it by acquiring softnet_lock around the client-side timer loop.
2009-02-04 20:36:54 +00:00
yamt 812bb0d164 restore the pre socket locking patch signal behaviour.
this fixes a busy-loop in nfs_connect.
2009-01-21 06:59:29 +00:00
mrg f41b56aff5 Actually enforce the maximum timeout (60s by default) rather
than backing off to 256*SRTT.  This is why it sometimes could take
hours for a NFS mount to come back when the server returned.

contributed anonymously.
2009-01-18 09:45:05 +00:00
christos 461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
christos ed795a66a7 protect sillyrename with _KERNEL 2009-01-02 21:06:11 +00:00
ad 27bc6a2391 - Don't vput() a vnode that we do not hold locked.
- Eliminate one of the few remaining uses of LK_CANRECURSE.
2009-01-02 12:57:29 +00:00
cegger 9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
pooka 4b18ba9da3 nfsd_use_loan: int -> bool 2008-12-03 14:56:05 +00:00
pooka 0fa0158c37 Use kmem instead of malloc to avoid hassle with dynamically attaching
a malloc type.  Makes nfsserver-as-a-module work.

reported on current-users & tested by Geoff Wing
2008-11-28 07:23:22 +00:00
pooka bd6148602f g/c unused malloc types 2008-11-28 06:47:08 +00:00
pooka 83f531e6a8 Use struct nfs_fattr in struct flrep instead of uint32_t array
acrobatics to get rid of type punning warning.
2008-11-27 14:04:58 +00:00
pooka 1ba9363d08 Comment police. No functional or GENERIC size change. 2008-11-25 14:28:42 +00:00
pooka ad71247a89 When testing if a file system handles file handles (ha ha ha), be
content with just the vp-to-fh-size check.
(removes a very weird error path in the code)
2008-11-25 14:04:23 +00:00
mrg d7d9597105 avoid noisy nfs_timer/nfs_reply DEBUG output that occurs when the
NFS server goes away.  use ratelimit(9) and only print the console
error once every 10 seconds.  PR#31562.
2008-11-23 08:22:07 +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 2a274197af - allocate 8 pointers on the stack to avoid stack overflow in nfs.
- make that 8 a constant
- remove bogus panic
2008-10-31 20:42:41 +00:00
cegger 6b4fb5f4de make this build again without having
NFS_BOOT_BOOTSTATIC, NFS_BOOT_BOOTP, NFS_BOOT_DHCP or NFS_BOOT_BOOTPARAM
defined.

I uncovered this case when compiling rump.
2008-10-27 13:24:01 +00:00
cegger c479884027 change nfs boot behaviour to automatically try next boot method if boot information are incomplete to succeed.
That way, it is possible combine static and dhcp boot:
  For example, to boot diskless you can specify the nfs-server and the rootpath statically. All other information will be taken via dhcp.

Patch has been presented on port-xen, tech-kern and tech-net:
http://mail-index.netbsd.org/port-xen/2008/10/24/msg004488.html
http://mail-index.netbsd.org/tech-kern/2008/10/24/msg003255.html
http://mail-index.netbsd.org/tech-net/2008/10/24/msg000864.html

No comments, no objections.
2008-10-27 10:58:22 +00:00
cegger cac6895435 - ansify function definition
- de- __P
- u_int32_t -> uint32_t

No functional changes.
2008-10-24 17:17:12 +00:00
matt b55adffee3 Don't need nfs_vfs_reinit anymore since we don't resize tables anymore.
Move reinit code to init case.
2008-10-22 12:29:35 +00:00
matt a42078ef92 Change NFS to use a RB-tree for its FH->nfsnode lookups. 2008-10-22 11:36:06 +00:00
christos 02934a6249 Requested by yamt:
- In getpages don't allocate if we are not locked
- Use kmem_alloc instead of malloc and don't sleep

Also provide a 64 entry stack array so we don't have to allocate in the
common case.
2008-10-17 14:24:43 +00:00
dogcow cff6728f44 it appears the previous commit's sacrifice was "successful compilation with
NFS_V2_ONLY defined".
2008-10-17 06:40:21 +00:00
christos a7242b8e23 Another sacrifice to the stack protector gods. 2008-10-16 22:04:22 +00:00
christos 96d7a83037 don't use variable allocation on the stack. 2008-10-16 19:33:48 +00:00
pooka c66ebd3d57 For NFSV3CREATE_EXCLUSIVE verifier, just use arc4random() instead
of the first inet address on INET systems (which is likely to be
localhost).
2008-10-15 14:21:35 +00:00
christos ff1eb234c1 do the proper ifdef dance for non-inet families 2008-10-09 14:38:21 +00:00
pooka ae509fabab Use atomic op to get next xid. Initialize value with arc4random()
at nfs init time instead system time based trickery intermingled
with the runtime code.

le bouef: kills last simple_lock from nfs
2008-10-09 00:11:39 +00:00
pooka d9f75a894c nuke outdated comment 2008-10-07 01:20:37 +00:00
pooka f4da52c698 Since the nfs root vnode is eternally constant, fully initialize
it in mountfs instead of deferring part of the initialization to
VFS_ROOT().  Fixes theoretical future bugs for nfs roots.
2008-09-30 21:12:48 +00:00
pooka c7637a677e Initialize nfsnode pools and malloc type dynamically in the
constructor instead of depending on link sets.  Consequently, rename
nfs_nh{init,reinit,done} to nfs_node_{init,reinit,done}, respectively,
to better convey the function.
2008-09-30 14:29:39 +00:00
pooka 7f617ba79e Apply #ifdef modern art to make NFSSERVER-without-NFS possible. 2008-09-30 14:25:15 +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
uwe e58a3edb13 When doing pointer arithmetic to compute limit cast bootp to pointer
type of correct signedness.  Caught by lint.
2008-07-20 02:06:37 +00:00
christos 799fe367ce explicitly set birthtime to VNOVAL, since there is no such thing in nfsv{2,3} 2008-07-15 16:06:58 +00:00
ad a00bd89dab Replace references to getsock/getvnode. 2008-06-24 11:18:14 +00:00
ad 06c343ac94 vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both. 2008-06-04 12:41:40 +00:00
tron 97eb62abf7 Make sure that we flush the NFS directory cache in case of an NFS mount
using the translate cookie option during unmount. This fixes PR kern/38100.
Patch suggested by Michael van Elst during Hackathon 11.
2008-05-24 14:29:18 +00:00
dyoung b39c416892 Delete unnecessary cast to void *. 2008-05-22 00:57:09 +00:00
ad d4da0343a9 Make it compile. 2008-05-20 00:18:31 +00:00
rumble a1221b6d4a Convert file systems to dynamically attach with the new module interface.
Make VFS hooks dynamic while we're here and say farewell to VFS_ATTACH and
VFS_HOOKS_ATTACH linksets.

As a consequence, most of the file systems can now be loaded as new style
modules.

Quick sanity check by ad@.
2008-05-10 02:26:09 +00:00
rumble 552b98b94b Fix compilation with DEBUG_NFS_BOOT_DHCP and ssp. 2008-05-09 06:20:39 +00:00
ad 42d0626726 PR kern/38141 lookup/vfs_busy acquire rwlock recursively
Simplify the mount locking. Remove all the crud to deal with recursion on
the mount lock, and crud to deal with unmount as another weirdo lock.

Hopefully this will once and for all fix the deadlocks with this. With this
commit there are two locks on each mount:

- krwlock_t mnt_unmounting. This is used to prevent unmount across critical
  sections like getnewvnode(). It's only ever read locked with rw_tryenter(),
  and is only ever write locked in dounmount(). A write hold can't be taken
  on this lock if the current LWP could hold a vnode lock.

- kmutex_t mnt_updating. This is taken by threads updating the mount, for
  example when going r/o -> r/w, and is only present to serialize updates.
  In order to take this lock, a read hold must first be taken on
  mnt_unmounting, and the two need to be held across the operation.

One effect of this change: previously if an unmount failed, we would make a
half hearted attempt to back out of it gracefully, but that was unlikely to
work in a lot of cases. Now while an unmount that will be aborted is in
progress, new file operations within the mount will fail instead of being
delayed. That is unlikely to be a problem though, because if the admin
requests unmount of a file system then s(he) has made a decision to deny
access to the resource.
2008-05-06 18:43:44 +00:00
ad e071d39c84 - Convert hashinit() to use kmem_alloc(). The hash tables can be large
and it's better to not have them in kmem_map.
- Convert a couple of minor items along the way to kmem_alloc().
- Fix some memory leaks.
2008-05-05 17:11:16 +00:00
ad 928a6b2096 PR kern/38135 vfs_busy/vfs_trybusy confusion
The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.
2008-04-30 12:49:16 +00:00
ad e3610f1886 kern/38135 vfs_busy/vfs_trybusy confusion
The symptom was that sometimes file systems would occasionally not appear
in output from 'df' or 'mount' if the system was busy. Resolution:

- Make mount locks work somewhat like vm_map locks.
- vfs_trybusy() now only fails if the mount is gone, or if someone is
  unmounting the file system. Simple contention on mnt_lock doesn't
  cause it to fail.
- vfs_busy() will wait even if the file system is being unmounted.
2008-04-29 23:51:04 +00:00
ad baa3395f8f PR kern/38057 ffs makes assuptions about devvp file system
PR kern/33406 softdeps get stuck in endless loop

Introduce VFS_FSYNC() and call it when syncing a block device, if it
has a mounted file system.
2008-04-29 18:18:08 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +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 6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +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
yamt 7f11d683b1 - make nfs_receive and nfs_reply static.
- ansify.
2008-04-10 12:32:37 +00:00
cegger cc658c528f use aprint_*_dev and device_xname 2008-04-05 13:49:36 +00:00
yamt 9230a9b039 ansify. from Christoph Egger. 2008-03-29 13:48:00 +00:00
yamt 24840272de whitespace. 2008-03-28 14:29:57 +00:00
dholland d868f7242f Yet another rename workaround - this time check for . and .. early because
relookup() objects to being asked to handle them.
2008-03-28 05:02:08 +00:00
yamt 9a4b7dd279 merge yamt-lazymbuf branch. 2008-03-24 12:24:37 +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
yamt e769ba6b4a desupport link/unlink of directories. noted by Elad Efrat. 2008-03-08 08:03:46 +00:00
elad 4299c49e56 Nuke a KAUTH_GENERIC_ISSUSER, this time in favor of an euid == 0, as
the traditional NFS maproot functionality goes.

Put in a note explaining why and who, also mark for future greps.

Okay yamt@.
2008-03-05 11:49:18 +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
matt d3fcecbd4e Fix extern declaration to match actual declaration (add const). 2008-02-20 17:15:51 +00:00
yamt 5bc7b930ef reject files larger than nm_maxfilesize. 2008-02-13 09:51:37 +00:00
yamt ee4ca4551d nfs_mountroot: kmem_alloc+memset -> kmem_zalloc 2008-02-13 09:47:12 +00:00
yamt 137ed4c3f9 nfs_kqfilter: fix lock/unlock mismatch. PR/38003 from Geoff C. Wing. 2008-02-12 08:55:27 +00:00
ad 22c6a20ebd Lock v_knlist with the vnode interlock. PR kern/37881. 2008-02-05 14:19:52 +00:00
ad 25153c3ec9 PR kern/37706 (forced unmount of file systems is unsafe):
- Do reference counting for 'struct mount'. Each vnode associated with a
  mount takes a reference, and in turn the mount takes a reference to the
  vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
  locking inherited from 4.4BSD with a recursable rwlock.
2008-01-30 11:46:59 +00:00
ad 3490efcc63 Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.
2008-01-30 09:50:19 +00:00
dholland 717e1785a5 Fix some race conditions in rename.
Introduce a per-FS rename lock and new vfsops to manipulate it.
Get this lock while renaming. Also add another relookup() in do_sys_rename,
which is a hack to kludge around some of the worst deficiencies of
ufs_rename.
reviewed-by: pooka (and an earlier rev by ad)
posted on tech-kern with no objections.
2008-01-28 14:31:15 +00:00
yamt d8a5645f80 nfs_check_wccdata: unifdef wcc kludge messages. 2008-01-28 10:44:51 +00:00
ad 52451df464 - Make nfsnode hash MPSAFE.
- Replace use of lockmgr().
2008-01-26 15:30:07 +00:00
ad 1997a1e1f4 Remove VOP_LEASE. Discussed on tech-kern. 2008-01-25 14:32:11 +00:00
ad 703069c0e9 specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
  vnode can describe a block device. Instead, prohibit concurrent opens of
  block devices. As a bonus remove the unreliable code that prevents
  multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
  goes away, instead of abusing vnode::v_usecount to tell if the device is
  open.
2008-01-24 17:32:52 +00:00
joerg 3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
ad 1e584185b2 Correct test of v_usecount. 2008-01-17 10:27:43 +00:00
pooka d53e261066 valloc -> vnalloc, vfree -> vnfree
Avoids collision with userland valloc(3).

no functional change
ad ok
2008-01-03 01:26:28 +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
yamt 0c303876e6 nfsrv_create: fix a use-after-release. 2007-12-22 03:31:15 +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
dyoung a3f7b0e7a0 Constify. 2007-12-20 16:19:38 +00:00
yamt a5f2bdb11c nfs_create: try GUARDED if EXCLUSIVE is NOTSUPP. 2007-12-17 16:04:31 +00:00
pooka db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
pooka 4e38160d4d Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
2007-12-05 17:19:46 +00:00
yamt 1ed3981c19 merge non-intrusive nfs changes from vmlocking. 2007-12-04 17:42:30 +00:00
pooka 61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
yamt 99e9015b80 nfssvc_nfsd: remove a wrong assertion. 2007-11-22 13:30:39 +00:00
yamt 4170b65f86 nfs_lookup: fix indent. 2007-11-13 11:37:08 +00:00
ad d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
yamt 79606bd6fa make NFS_ATTRTIMEO a function. 2007-10-28 22:24:28 +00:00
yamt 46b951d6aa remove lwp argument from nfs_reconnect and always use &lwp0
because who triggers a reconnect doesn't really matter here.  PR/37145.
2007-10-21 08:23:19 +00:00
ad 7dad9f7391 Merge from vmlocking:
- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
2007-10-10 20:42:20 +00:00
ad 9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +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
rmind 27ad3d8619 nfs_mount: Plug a possible leaks.
Invented in 1.114 rev.
From CID: 4534
2007-09-06 01:11:44 +00:00
dyoung bb04fc71fb Use sockaddr_in_init() and ifreq_setaddr() to initialize a sockaddr_in
and an ifreq.ifr_addr, respectively.  Get rid of an extraneous
cast---down the elevator shaft!  Change 'ireq' to 'ifr', which is
what the kernel calls a temporary struct ifreq virtually everywhere
else.
2007-08-31 22:02:58 +00:00
dyoung 1751c5101f Constify: LLADDR() -> CLLADDR(). 2007-08-29 22:53:35 +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 9c0f7c2a93 nfs_inactive: turn a panic into a printf for now, as it isn't critical.
PR/36572 from Martin Husemann.
2007-08-06 11:55:08 +00:00
yamt 1f0f803e45 use kpause rather than lbolt. 2007-08-05 09:40:39 +00:00
yamt 5bde4f20f7 nfsrv_slpderef: add an assertion. 2007-08-02 12:46:03 +00:00
yamt d72bfdbeb2 nfsdsock_unlock: add an assertion. 2007-08-02 12:45:37 +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
pooka 8d1f899239 * nuke the nameidata parameter from VFS_MOUNT(). Nobody on tech-kern
knew what it was supposed to be used for and wrstuden gave a go-ahead
* while rototilling, convert file systems which went easily to
  use VFS_PROTOS() instead of manually prototyping the methods
2007-07-31 21:14:15 +00:00
ad a0d1fd8d0c It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 13:31:07 +00:00
yamt c90a0e2579 stop nfs tick when we have nothing to do. 2007-07-27 10:03:58 +00:00
yamt 662e7a9e40 use ubc_uiomove for read as well. 2007-07-27 10:00:42 +00:00
yamt 3822af7031 ubc_uiomove: add an "advice" argument rather than using UVM_ADV_RANDOM blindly. 2007-07-27 09:50:36 +00:00
pooka d9970c8066 Use eopnotsupp() instead of vfs_stdsuspendctl() and retire the latter. 2007-07-26 22:57:36 +00:00
pooka 9137aeda4b In sync, skip over vnodes based on if they are clean rather than
if they have pages.
2007-07-20 16:46:43 +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
dyoung 08e6f22226 Take steps to hide the radix_node implementation of the forwarding table
from the forwarding table's users:

        Introduce rt_walktree() for walking the routing table and
        applying a function to each rtentry.  Replace most
        rn_walktree() calls with it.

        Use rt_getkey()/rt_setkey() to get/set a route's destination.
        Keep a pointer to the sockaddr key in the rtentry, so that
        rtentry users do not have to grovel in the radix_node for
        the key.

        Add a RTM_GET method to rtrequest.  Use that instead of
        radix_node lookups in, e.g., carp(4).

Add sys/net/link_proto.c, which supplies sockaddr routines for
link-layer socket addresses (sockaddr_dl).

Cosmetic:

        Constify.  KNF.  Stop open-coding LIST_FOREACH, TAILQ_FOREACH,
        et cetera.  Use NULL instead of 0 for null pointers.  Use
        __arraycount().  Reduce gratuitous parenthesization.

        Stop using variadic arguments for rip6_output(), it is
        unnecessary.

        Remove the unnecessary rtentry member rt_genmask and the
        code to maintain it, since nothing actually used it.

        Make rt_maskedcopy() easier to read by using meaningful variable
        names.

        Extract a subroutine intern_netmask() for looking up a netmask in
        the masks table.

        Start converting backslash-ridden IPv6 macros in
        sys/netinet6/in6_var.h into inline subroutines that one
        can read without special eyeglasses.

One functional change: when the kernel serves an RTM_GET, RTM_LOCK,
or RTM_CHANGE request, it applies the netmask (if supplied) to a
destination before searching for it in the forwarding table.

I have changed sys/netinet/ip_carp.c, carp_setroute(), to remove
the unlawful radix_node knowledge.

Apart from the changes to carp(4), netiso, ATM, and strip(4), I
have run the changes on three nodes in my wireless routing testbed,
which involves IPv4 + IPv6 dynamic routing acrobatics, and it's
working beautifully so far.
2007-07-19 20:48:52 +00:00
pooka e24b0872a4 Make set_statvfs_info() take a parameter for the vfs name instead
of always retrieving it from mp->mnt_op->vfs_name

christos ok
2007-07-17 11:19:31 +00:00
yamt bc1bb99dc5 remove (void)0; nonsense. 2007-07-17 10:24:10 +00:00
yamt 9dc12587a5 fix a typo in a comment. 2007-07-17 10:23:33 +00:00
dsl 2721ab6c7b Change the VFS_MOUNT() interface so that the 'data' buffer passed to the
fs code is a kernel buffer, pass though the length of the buffer as well.
Since the length of the userspace buffer isn'it (yet) passed through the mount
system call, add a field to the vfsops structure containing the default length.
Split sys_mount() for calls from compat code.
Ride one of the recent kernel version changes - old fs LKMs will load, but
sys_mount() will reject any attempt to use them.
2007-07-12 19:35:32 +00:00
rmind 845fda992a nfs_asyncio: fix the locking in error case, problem was introduced
in 1.153 revision, where ltsleep() was replaced with condvar.

Problem found and fix provided by David A. Holland, PR/36610.
Actually, relock is not needed here, and mutex would be unlocked
only on nfs_sigintr() fail case.
2007-07-12 18:29:43 +00:00
ad e05e11c21a Fix build when not !NFSSERVER. 2007-07-09 21:29:09 +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
bouyer a92a400fbf Add a new BOOTSTATIC flag, NFS_BOOTSTATIC_NOSTATIC, which causes
nfs_bootstatic() to abort with EOPNOTSUPP. This allows a callback to
say that there is no bootstatic config, and the next NFS boot method should
be tried.
2007-07-08 21:08:09 +00:00
dsl 6319443e37 Updates for changes prototype of kauth_cred_set/getgroups(). 2007-06-30 15:27:02 +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 7508122896 nfs_write:
- IO_SYNC: don't bother to flush dirty pages before copying data from
  user buffer.
- IO_APPEND: don't invalidate pages blindly.  PR/28472 from Brian Marcotte.
2007-06-12 09:42:27 +00:00
yamt f1ce35c9f6 nfs_inactive: don't clear NTRUNCDELAYED erroneously.
(fix cache consistency problems like NUL bytes near EOF.)
2007-06-12 09:33:25 +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
dyoung a8fef725ac There is only one radix trie walker, and it is rn_walktree(), so
use that instead of the indirect function call through rnh,
rnh->rnh_walktree.
2007-06-09 02:33:41 +00:00
dyoung 99964897cf Cosmetic: de-__P() et cetera. 2007-06-09 02:32:34 +00:00
yamt a4a20623eb nfs_getattrcache: simplify. no functional changes. 2007-06-06 09:23:55 +00:00
yamt da51d139a4 improve post-ubc file overwrite performance in common cases.
ie. when it's safe, actually overwrite blocks rather than doing
read-modify-write.

also fixes PR/33152 and PR/36303.
2007-06-05 12:31:30 +00:00
yamt 326517bd8d add some #include. 2007-06-02 03:32:51 +00:00
dogcow 0023297d28 it seems like a good idea to include <sys/condvar.h>, as we're using them... 2007-06-01 23:16:33 +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 61131eb130 nfsdsock_lock: fix an inverted check of SLP_VALID. 2007-06-01 11:38:44 +00:00
yamt febe85111f - remove nfs_exit exit hook. ok'ed by christos@.
- as far as i understand the code, it shouldn't be necessary
	  because nfs_request can't return without removing its request
	  and r->r_lwp is either curlwp or NULL.
	- even if it's necessary, leaking requests is not the correct way
	  to recover from the condition.
- nfs_request: add a related assertion.
2007-05-28 16:47:38 +00:00
yamt 683644f00e nfs_write: report an error correctly in the case of IO_SYNC. 2007-05-09 23:17:45 +00:00
manu f39939ad43 Fix buid (broken by a fix introduced in the wrong file...) 2007-05-08 09:29:50 +00:00
manu 31b57f40ff Add the TFTPROOT kernel option for TFTP'ing root RAMdisk at root mount time.
This allows working around situations where a kernel with embedded RAMdisk
cannot be booted by the bootloader because the RAMdisk is too big.
2007-05-08 06:10:27 +00:00
yamt fce3c58e5e nfs_rcvlock: fix NFSMNT_INT check, which has been broken since rev.1.39. 2007-05-02 16:19:55 +00:00
yamt e4c778084c - nfs_reply: keep rcvlock longer so that lwp which already have its reply
received won't be stuck in nfs_receive.
- nfs_rcvlock: check exceptions before sleeping on the lock.
- nfs_rcvunlock: use cv_broadcast rather than cv_signal to ensure that
  lwps which received its reply get woken up.
2007-05-02 14:48:47 +00:00
yamt ab54f30196 remove R_GETONEREP. 2007-04-30 23:10:55 +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 fbee155d25 use mutex and condvar. 2007-04-29 15:31:53 +00:00
yamt 6623a01439 don't forget to destroy mutex and condvar. 2007-04-29 15:30:26 +00:00
yamt f14398066d include condvar.h. pointed by Kurt Schreiner. 2007-04-29 14:58:21 +00:00
yamt bbe5115ad9 use condvar. 2007-04-29 14:56:59 +00:00
yamt aca6764004 use mutex and condver. 2007-04-29 10:30:18 +00:00
yamt ac99b69f8d use mutex and condvar. 2007-04-29 08:41:10 +00:00
dsl b8fbaf8c4b Change the way that emulations locate files within the emulation root to
avoid having to allocate space in the 'stackgap'
  - which is very LWP unfriendly.
The additional code for non-emulation namei() is trivial, the reduction for
  the emulations is massive.
The vnode for a processes emulation root is saved in the cwdi structure
  during process exec.
If the emulation root the TRYEMULROOT flag are set, namei() will do an initial
  search for absolute pathnames in the emulation root, if that fails it will
  retry from the normal root.
".." at the emulation root will always go to the real root, even in the middle
  of paths and when expanding symlinks.
Absolute symlinks found using absolute paths in the emulation root will be
  relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links
  inside the emulation root don't need changing).
If the root of the emulation would be returned (for an emulation lookup), then
  the real root is returned instead (matching the behaviour of emul_lookup,
  but being a cheap comparison here) so that programs that scan "../.."
  looking for the root dircetory don't loop forever.
The target for symbolic links is no longer mangled (it used to get the
  CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended).
CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding
  TRYEMULROOT to the flags to NDINIT().
A lot of the emulation system call stubs could now be deleted.
2007-04-22 08:29:55 +00:00
yamt 337d052ee1 hold proclist_mutex when calling psignal(). 2007-04-19 11:05:14 +00:00
hannken 29ddf6065f Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-06 14:28:28 +00:00
ad 59d979c5f1 Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.
2007-03-12 18:18:22 +00:00
yamt 02530653ff nfs_check_wccdata: print timestamps. 2007-03-09 05:55:33 +00:00
yamt 7e98ba85a6 nfsrv_setattr: revive nfsm_srvsattr which was (mistakenly?)
removed with caddr_t.
2007-03-05 23:18:50 +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
yamt 5057834077 nfs_getpages: fix an inverted condition in rev.1.147. 2007-02-27 10:03:56 +00:00
thorpej b3667ada6d TRUE -> true, FALSE -> false 2007-02-22 06:05:00 +00:00
thorpej 712239e366 Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
2007-02-21 22:59:35 +00:00
pooka 033e539d53 after freeing cookies, set the pointer to NULL to prevent dangling reuse 2007-02-20 16:27:21 +00:00
ad adbb9ec2fa Call genfs_node_destroy() where appropriate. 2007-02-20 16:21:03 +00:00
yamt 6d6b5c51d6 use mutex and rwlock rather than lockmgr. 2007-02-15 16:01:51 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
chs f0cdf39d80 add back a mistakenly removed vput(). 2007-02-05 16:03:53 +00:00
yamt cb2e7baf50 have a mowner dedicated to nfs reply cache. 2007-02-05 11:55:45 +00:00
yamt 7224686465 nfsrv_updatecache: actually use reply caches for connection oriented protocols. 2007-02-05 11:55:03 +00:00
chs 0507747213 more fixes for the new vnode locking scheme:
- don't use SAVESTART in calls to relookup() from unionfs,
   just vref() the desired vnode when we need to.
 - fix locking and refcounting in the unionfs EEXIST error cases.
 - release any vnode locks before calling VFS_ROOT(), vfs_busy() is enough.
   this allows us to simplify union_root() and fix PR 3006.
 - union_lock() doesn't handle shared lock requests correctly,
   so convert them to exclusive instead.  fixes PR 34775.
 - in relookup(), avoid reusing "dp" for different purposes,
   the error handling wasn't right.  (actually just get rid of dp.)
   also, change relookup() to ignore LOCKLEAF and always return the
   vnode locked since the callers already expect this.
2007-02-04 15:03:20 +00:00
chs 6721fd793e in nfsrv_rename(), change vput(fdirp) back to vrele() since the dirp
returned from nfs_namei() is not locked in this case.  fixes PR 35542.
also, apply the same fix here as was made in rename_files() to handle
the case when dvp and vp are the same.
2007-02-04 14:48:51 +00:00
hubertf 142c2a33ba Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
2007-01-24 13:08:11 +00:00
hannken 1b9c6382e3 New file system suspension API to replace vn_start_write and vn_finished_write.
The suspension helpers are now put into file system specific operations.
This means every file system not supporting these helpers cannot be suspended
and therefore snapshots are no longer possible.

Implemented for file systems of type ffs.

The new API is enabled on a kernel option NEWVNGATE.  This option is
not enabled by default in any kernel config.

Presented and discussed on tech-kern with much input from
Bill Studenmund <wrstuden@netbsd.org> and YAMAMOTO Takashi <yamt@netbsd.org>.

Welcome to 4.99.9 (new vfs op vfs_suspendctl).
2007-01-19 14:49:08 +00:00
yamt 2224a4350f plug a mbuf leak. 2007-01-17 12:40:36 +00:00
yamt 3be095f658 plug mbuf leaks. 2007-01-17 12:40:08 +00:00
elad 8426ae751a Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 20:24:08 +00:00
yamt a23a6ee6c6 remove several nqnfs definitions. 2006-12-28 00:39:03 +00:00
yamt 431da137b1 - remove the rest of nqnfs.
- reject NFSMNT_MNTD and NFSMNT_KERB.  (no users in tree.)
2006-12-27 12:51:22 +00:00
yamt ccfd2c0df0 remove nqnfs. 2006-12-27 12:10:09 +00:00
chs c398ae9734 a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
   these now always return the parent vnode locked.  namei() works as before.
   lookup() and various other paths no longer acquire vnode locks in the
   wrong order via vrele().  fixes PR 32535.
   as a nice side effect, path lookup is also up to 25% faster.
 - the above allows us to get rid of PDIRUNLOCK.
 - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
 - remove an assumption in layer_node_find() that all file systems implement
   a recursive VOP_LOCK() (unionfs doesn't).
 - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
   fill in eopnotsupp() for file systems that don't support being exported
   and remove the checks for NULL.  (layerfs calls these without checking.)
 - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
   adjust which vnode is locked.  fixes PR 33374.
 - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
2006-12-09 16:11:50 +00:00
yamt 9c62b6fe1d nfs_disconnect: 2 -> SHUT_RDWR. no functional change. 2006-12-06 09:13:46 +00:00
yamt 6c575a38c3 nfsrv_rcv: claim ownership of received mbufs. 2006-12-06 08:55:52 +00:00
yamt 89682b24fe remove some __unused in function parameters. 2006-11-09 09:53:57 +00:00
mjf a2be0ed655 Revert the changes I introduced trying to solve tmpfs' NFS export problem.
Requested by yamt@
2006-10-31 08:12:46 +00:00
jmmv bccb33bf70 Fix a typo in a comment. 2006-10-30 16:06:05 +00:00
reinoud dc5b5420b9 Revisit mnt_vnodelist TAILQ patch. Remove all suspicious TAILQ_FOREACH()
loops where vnodes can get removed or added during the loops. This could
lead to panic's on unmount since nodes are skipped or otherwise
TAILQ_NEXT(0xdeadbeef, ...) was dereferenced.
2006-10-25 22:01:54 +00:00
mjf 84bd46b9f9 Add support to allow a file system to not permit being exported over NFS.
Approved by elad@ and wrstuden@
2006-10-24 21:53:10 +00:00
pooka 96d8335980 kauth_cred_uucvt() -> kauth_uucred_to_cred(), introduce kauth_cred_to_uucred()
per tech-kern proposal
2006-10-22 13:07:15 +00:00
reinoud 0ce809091d Replace the LIST structure mp->mnt_vnodelist to a TAILQ structure since all
vnodes were synced and processed backwards. This meant that the last
accessed node was processed first and the earlierst last.

An extra benefit is the removal of the ugly hack from the Berkly days on
LFS.

In the proces, i've also replaced the various variations hand written loops
by the TAILQ_FOREACH() macro's.
2006-10-20 18:58:12 +00:00
dogcow 372e6ef309 now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.
2006-10-17 18:21:29 +00:00
christos 3b347a3429 another variable should have been _KERNEL only. 2006-10-17 14:55:13 +00:00
christos 0a3d351aae don't expose kernel variables to userland. 2006-10-17 14:53:54 +00:00
yamt 583781abd3 grab glock when calling uvm_unp_setsize, so that it doesn't interfere
mmap'ed accesses.  this fixes an assertion failure in in nfs_doio_read.
("vp->v_size >= uiop->uio_offset + uiop->uio_resid")
2006-10-14 09:18:57 +00:00
christos 6c265266c5 more __unused 2006-10-13 20:53:59 +00:00
dogcow 44603cac1f more unused variable fallout. 2006-10-13 18:28:06 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
dogcow 55ddfc9aae change the MOWNER_INIT define to take two args; fix extant struct mowner
decls to use it. Makes options MBUFTRACE compile again and not whinge about
missing structure declarations. (Also makes initialization consistent.)
2006-10-10 21:49:14 +00:00
drochner 429dff1c3d Flush regular files before setattr also if the mode bits are going to
be set. Linux NFS servers (at least) reset suid/sgid bits if a write
happens afterwards. Add a comment why this is done.
This fixes system builds on diskless systems for me where suid bits
were missing after install(1).
Approved by yamt.
2006-09-29 16:19:50 +00:00