Commit Graph

170 Commits

Author SHA1 Message Date
hannken
04c776e5c8 Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
2014-01-23 10:13:55 +00:00
hannken
1139274440 Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
2014-01-17 10:55:01 +00:00
christos
cfda4afeac only prevent autounload, not regular unload when we have exports 2013-12-14 22:04:03 +00:00
christos
d956cedc98 don't allow the nfs server module to unload if it has exported filesystems. 2013-12-14 16:19:28 +00:00
martin
6fd75b6342 Backout wildcard pragma to kill warnings and instead sprinkle a few dozen
__unused attributes.
Requested by joerg@
2013-09-14 22:29:08 +00:00
christos
b0fb40a0ab When unloading the nfsserver module, call nfs_fini() so that the nfsrvdescpl
pool gets destroyed. Otherwise we are left with a stray pool that points to
unmapped memory behind (and bad things happen). Typically you get seemingly
random page faults (without printing uvm_fault) that happen in various pool
operations. Most frequent one is the pool_drain() from the page daemon.
2012-08-29 14:00:22 +00:00
chs
bd1e3e7e16 fix error handling in nfsrv_rename(): when the first nfs_namei() fails,
don't try to free the resources allocated by a successful lookup.
2012-08-27 11:35:13 +00:00
matt
72094f6fb4 When using socket loaning, make sure the KVA used for the loan has the same
color as the UVA being loaned.
2012-02-01 02:27:23 +00:00
hannken
0114172335 nfsrv_lookup(): Defer the postopattr lookup on dirp until the
child node is unlocked.

Ok: YAMAMOTO Takashi <yamt@netbsd.org>
2011-11-21 09:07:59 +00:00
hannken
9f4935d778 VOP_GETATTR() needs a shared lock at least. 2011-10-30 12:00:27 +00:00
dholland
ce8c87ef91 nfs_namei() should not return a non-null path buffer except on success,
even though the callers are apparently prepared to cope.

Fixes last tidyup part of PR 44625.
2011-08-08 16:04:07 +00:00
dholland
7cb501d652 Back in -r1.60 of nfs_serv.c (a long time ago) VOP_MKNOD was changed
so nfsd no longer needed to do a lookup() call immediately afterwards
to retrieve the newly created object.

Since that change there has been no way for ISSYMLINK to be set upon
return from VOP_MKNOD (or before the call to VOP_MKNOD either) so
remove the test for it and associated block of dead code.

(I do not understand how this code was reachable before then either.
The logic in question is only reached if no object by that name
existed, and there's no reasonable way that a successful call to
VOP_MKNOD should ever create a symlink. The code appears to come from
4.4lite; maybe they had locking bugs?)
2011-04-18 00:38:33 +00:00
dholland
87f3ba8ed6 Clean up. Move some more code across from nfsd's private entry points. 2011-04-11 01:33:04 +00:00
dholland
4a414f41ec Fix memory leak introduced with the struct pathbuf changes. Hi, me.
Closes PR 44625.
2011-03-19 01:34:24 +00:00
yamt
eacfcada26 typo in a comment 2011-02-05 13:35:11 +00:00
dholland
6d2ff39e83 Remove remaining references to SAVESTART. 2011-01-02 05:12:33 +00:00
dholland
13fc777536 Remove the special refcount behavior (adding an extra reference to the
parent dir) associated with SAVESTART in relookup().

Check all call sites to make sure that SAVESTART wasn't set while
calling relookup(); if it was, adjust the refcount behavior. Remove
related references to SAVESTART.

The only code that was reaching the extra ref was msdosfs_rename,
where the refcount behavior was already fairly broken and/or gross;
repair it.

Add a dummy 4th argument to relookup to make sure code that hasn't
been inspected won't compile. (This will go away next time the
relookup semantics change, which they will.)
2011-01-02 05:09:30 +00:00
dholland
a508b19c66 Remove unused nameidata field ni_startdir. 2011-01-02 05:01:20 +00:00
dholland
d4eb05390d Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
2010-11-30 10:29:57 +00:00
hannken
1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +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
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
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
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
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
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
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
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
pooka
4b18ba9da3 nfsd_use_loan: int -> bool 2008-12-03 14:56:05 +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
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
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
e769ba6b4a desupport link/unlink of directories. noted by Elad Efrat. 2008-03-08 08:03:46 +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
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
0c303876e6 nfsrv_create: fix a use-after-release. 2007-12-22 03:31:15 +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
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
yamt
c90a0e2579 stop nfs tick when we have nothing to do. 2007-07-27 10:03:58 +00:00
hannken
29ddf6065f Remove calls to now obsolete vn_start_write() and vn_finished_write(). 2007-04-06 14:28:28 +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
thorpej
b3667ada6d TRUE -> true, FALSE -> false 2007-02-22 06:05:00 +00:00
pooka
033e539d53 after freeing cookies, set the pointer to NULL to prevent dangling reuse 2007-02-20 16:27:21 +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
elad
8426ae751a Consistent usage of KAUTH_GENERIC_ISSUSER. 2007-01-04 20:24:08 +00:00
yamt
ccfd2c0df0 remove nqnfs. 2006-12-27 12:10:09 +00:00