Commit Graph

915 Commits

Author SHA1 Message Date
yamt 437ecc32b5 fix some simple bugs in the 64bit ino_t changes.
- edp -> dp
- * -> +
2005-08-19 10:08:48 +00:00
christos 50f8955b6e 64 bit inode changes. 2005-08-19 02:04:03 +00:00
onoe 5c08c84474 Fix mbuf leak in nfssvc_nfsd(). 2005-08-03 06:25:11 +00:00
yamt d5c148af81 use a correct credential for readlink. discussed on source-changes@. 2005-07-21 10:39:46 +00:00
yamt 445a39080e nfs_doio_read: revert readlink part of 1.129 and 1.130 because they were wrong. 2005-07-21 10:37:36 +00:00
christos d9a0117f1e Back to using curproc in the VLNK case when uiop->uio_procp == NULL,
and explain why we need to.
2005-07-07 14:26:37 +00:00
christos c7f5a1fb60 1. use p = uio->uio_procp consistently and eliminate suspicious uses
of curproc (where uio->uio_procp should be used?). Don't do this
   for nfs_commit(), because yamt says it is possibly wrong.
2. nfs_doio() does not use struct proc; remove it and the code to compute it.
3. use copyin_proc() and copyout_proc() instead of copyin() and copyout().
4. check return of copyout_proc(). and mark return from copyin_proc() XXX
5. Eliminate check p == curproc assertion check from nfs_write;
   nfs_read does not have it and we might be called in a different
   process context anyway (PR 20138).
2005-07-07 02:05:03 +00:00
yamt 44d128fa8e - constify genfs_ops.
- use member designators.
2005-06-28 09:30:37 +00:00
atatat 420d91208b Properly fix the constipated lossage wrt -Wcast-qual and the sysctl
code.  I know it's not the prettiest code, but it seems to work rather
well in spite of itself.
2005-06-09 02:19:59 +00:00
christos e7c15fae96 - sprinkle const
- avoid shadowed variables
- mark bad const use with XXXUNCONST
2005-05-29 20:58:13 +00:00
yamt 9cb572b112 nfsrv_mknod: reject device numbers which we can't handle. 2005-05-18 12:57:34 +00:00
christos 362a4a0bd5 Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
2005-05-17 04:14:57 +00:00
yamt c5544c42b5 nfsrv_rcv: don't do so_receive from socket upcall context.
while there's little benefits, it complicates locking and confuses
flow control.
2005-03-29 09:22:35 +00:00
thorpej e633e8b61b - Define a VFS_ATTACH() macro that places a reference to a vfsops structure
into the "vfsops" link set.
- Use VFS_ATTACH() where vfsops are declared for individual file systems.
- In vfsinit(), traverse the "vfsops" link set, rather than vfs_list_initial[].
2005-03-29 02:41:05 +00:00
perry bcfcddbac1 nuke trailing whitespace 2005-02-26 22:31:44 +00:00
yamt 12ee5f9c3a nfs_namei: return EACCES for empty filenames as rfc1813 says. 2005-01-28 10:12:23 +00:00
yamt 2520660990 nfs_clearcommit: don't attempt to clear commit info (n_pushlo, etc)
unless the vnode is of VREG.  union members used to keep commit info
are used for other purposes in the case of !VREG.
2005-01-28 10:11:31 +00:00
yamt f1661c75d1 - simplify nfs_bio.c rev.1.126
- add an assertion.

no functional changes.
2005-01-27 12:46:42 +00:00
yamt cf56f2b873 keep directory eof cache when inactivating vnode
because there's no reason to throw it away.
(fix an unintended side effect of nfs_subs.c rev.1.144.)
2005-01-27 11:33:26 +00:00
yamt 407a63dc34 nfs_bioread:
- if a buffer is still empty after successful nfs_doio, it implies EOF.
- don't cache blocks beyond EOF.
2005-01-27 11:29:25 +00:00
yamt f6e331ee7c nfs_readdirrpc, nfs_readdirplusrpc:
avoid infinite loops when getting readdir response without
any entries or eof.  PR/28971.
2005-01-26 10:33:54 +00:00
yamt 72d6e88acf handle a really empty directory, which doesn't have even the dot entry. 2005-01-26 10:30:58 +00:00
yamt a7b5d8f567 nfs_check_wccdata: comment. 2005-01-25 12:20:32 +00:00
yamt de3e729ad9 s/time/mono_time/ for n_attrstamp and n_accstamp. (parts of) PR/25641. 2005-01-21 14:31:29 +00:00
yamt fc08656a20 implement inaccurate mtime/ctime detection.
namely, if mtime or ctime are same between pre_op_attr and post_op_attr
when we expected them to be changed, don't trust the server.
2005-01-19 16:22:19 +00:00
chs 8975a0856f adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway.  there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.
2005-01-09 16:42:43 +00:00
yamt e5bd47dc3c invalidate cache if filesize is changed besides our activity
because it means that we're out of sync with the server.
2005-01-09 01:32:32 +00:00
yamt 68c071389c nfs_lookup: check n_nctime for positive entries as well to improve
cache consistency.
2005-01-08 03:12:30 +00:00
yamt f80647ef1e nfs_loadattrcache: invalidate access cache when ctime is changed. 2005-01-06 11:52:44 +00:00
thorpej 1c95472d01 Add the system call and VFS infrastructure for file system extended
attributes.

From FreeBSD.
2005-01-02 16:08:28 +00:00
yamt f4221aaaf6 revive spec vop_bwrite as it's needed for block devices.
PR/28684 from Jukka Salmi.
2004-12-17 03:31:20 +00:00
yamt ee344f939f redirect some VOPs which shouldn't be used for nfs
to genfs_badop (ie. panic).
2004-12-14 09:15:23 +00:00
yamt e3ed5def47 - centerize code to invalidate stale cache.
- don't ignore errors when invalidating buffers in nfs_open.
2004-12-14 09:13:13 +00:00
bouyer 0f82537ed4 The macro used for static server address is NFS_BOOTSTATIC_SERVADDR, not
NFS_BOOTSTATIC_SADDR. From Xen source distribution.
XXX NFS_BOOTSTATIC* doesn't seem to be documented anywhere ...
2004-12-12 16:24:14 +00:00
yamt 8cd5f554ba nfsrv_commit: make cnt unsigned so that very large commit requests can be
handled properly.
2004-12-09 02:18:45 +00:00
yamt 2bc7120ab8 when calling create-type VOP, make sure that va_mode is set
even when a client doesn't specify it.
(most filesystems get confused if va_mode is VNOVAL.)
2004-12-09 01:48:22 +00:00
yamt f11ea18093 nfsrv_read: fall back to copying when fail to loan pages.
(i forgot to commit this with uvm_loan.c rev.1.51.)
2004-12-04 08:07:52 +00:00
yamt a9fa9f0745 since daddr_t is 64-bit these days, simply use nfs directory cookies
as buffer cache indexes.  regress/sys/fs/getdents is now supposed to work.
fix PR/27112.
2004-10-26 04:34:46 +00:00
yamt 20a0770136 remove #if 0'ed out definition of VA_EXCLUSIVE. 2004-10-26 00:58:54 +00:00
yamt 3d250e0476 remove an unused macro, NMOD. 2004-10-26 00:27:07 +00:00
yamt 94223b8ff0 nfs_enterdircache: initialize dc_flags of a newly allocated dircache entry.
provided by Greg Oster.
2004-10-03 10:51:28 +00:00
yamt 31c025d90c nfs_readdirrpc, nfs_readdirplusrpc:
don't expose kernel garbage data to userland.
2004-10-03 10:17:33 +00:00
yamt 6b8cd53946 nfs_writerpc: fix PHOLD leak on error. 2004-10-01 01:08:01 +00:00
yamt 77b63b73b8 g/c NFSMINOFF, which is unused and identical with MRESETDATA. 2004-09-29 11:24:28 +00:00
yamt ac65f2420a nfs_readdirplusrpc: fix spurious EBUSYs. 2004-09-23 10:46:44 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
yamt e11d5e7c46 fix access-after-free bugs in dircache code by refcounting nfsdircache.
PR/26864.
2004-09-15 09:50:56 +00:00
yamt 4fd5a025bf nfs_request: a workaround for servers doing "maproot".
for i/o requests which are expected not to fail due to permission
to mimic unix file open semantics (READ, WRITE, COMMIT),
try two credentials.  namely, the file owner's one and open time one.
remember which credential worked in per-file basis and try it first
next time to minimize number of retries.
ideas from Chuck Silvers.  PR/23716 and PR/24987.
2004-08-24 20:09:44 +00:00
yamt bee0b74932 remove a "proc botch" debug printf. ok'ed by Jonathan Stone. 2004-08-18 23:44:47 +00:00
mycroft 45a21b76f0 Fixing age old cruft:
* Rather than using mnt_maxsymlinklen to indicate that a file systems returns
  d_type fields(!), add a new internal flag, IMNT_DTYPE.

Add 3 new elements to ufsmount:
* um_maxsymlinklen, replaces mnt_maxsymlinklen (which never should have existed
  in the first place).
* um_dirblksiz, which tracks the current directory block size, eliminating the
  FS-specific checks littered throughout the code.  This may be used later to
  make the block size variable.
* um_maxfilesize, which is the maximum file size, possibly adjusted lower due
  to implementation issues.

Sync some bug fixes from FFS into ext2fs, particularly:
* ffs_lookup.c 1.21, 1.28, 1.33, 1.48
* ffs_inode.c 1.43, 1.44, 1.45, 1.66, 1.67
* ffs_vnops.c 1.84, 1.85, 1.86

Clean up some crappy pointer frobnication.
2004-08-15 07:19:54 +00:00
yamt 7653f67dd6 nfs_readdirplusrpc: fix a very long-standing cache corruption bug.
in the case of !bigenough, don't fill d_type or dnlc with bogus data.
2004-07-20 22:02:21 +00:00
yamt 62190652f1 revert nfs_vnops.c rev.1.189.
it's no longer needed because cache_enter() has been changed to handle
duplicated entries by itsself.
2004-07-20 22:00:29 +00:00
yamt e9bca9a46e nfs_doio_read: on short read, zero out the rest of the buffer unconditionally.
we can't rely on n_size here because it can be changed under us.
2004-07-18 07:43:00 +00:00
yamt 1c77f27a7a nfs_commit: use NAC_NOTRUNC when loading an attribute
as we're called holding pages locked.
2004-07-18 07:41:42 +00:00
yamt 72afe94686 nfs_fsinfo: when changing rsize/wsize,
keep mnt_fs_bshift in-sync.  otherwise genfs_getpages behaves badly.
2004-07-12 12:40:30 +00:00
yamt 0f5d997ee9 - include opt_inet.h for INET.
- catchup to in_ifaddr -> in_ifaddrhead rename.

XXX the address on the top of in_ifaddrhead is likely 127.0.0.1.
using it to construct the verifier doesn't make much sense.
maybe it's better to use some uuid or ip_randomid-like method.
2004-07-08 11:21:35 +00:00
yamt fad58613ba nfs_create: after an exclusive create rpc, make sure to update
timestamps, which were likely used to store the verifier.
reported by Mark Davies.  PR/26200
2004-07-08 11:12:14 +00:00
pk a7c40722d8 Call inittodr() from main(). Let file system code set the recorded `last
update' time (if any) through the new function setrootfstime().
2004-07-05 07:28:45 +00:00
yamt 21ae434eb2 nfs_lookup: use cache_lookup_raw() so that:
- "intrusive" dirops now have more chances to get benefits from dnlc.
- fixes a deadlock due to vnode locking order inversion.

nfs_create and others: purge stale dnlc entries
as nfs_lookup() no longer does it automatically.
2004-06-27 08:53:03 +00:00
jonathan 5249b5a2a5 Rename MBUFTRACE helper function m_claim() to m_claimm(),
for consistency with M_FREE() and m_freem().  Affected files:

sys/mbuf.h
kern/uipc_socket2.c
kern/uipc_mbuf.c
net/if_ethersubr.c
netatalk/ddp_input.c
nfs/nfs_socket.c
2004-06-24 04:15:50 +00:00
yamt 3e209dd94a nfs_lookup: maintain PDIRUNLOCK even in the case of success to make
layered filesystems happy.
2004-06-16 23:55:30 +00:00
yamt ad338b9eff nfs_searchdircache: fix a null dereference in the case that
offset!=0 and dircache hasn't been initialized yet.
2004-06-14 12:28:35 +00:00
yamt e3b58482fb nfs_doio_read: use np->n_rcred instead of curproc->p_ucred for VDIR.
XXX maybe it's better to use a cred passed by VOP_READDIR.
2004-06-11 12:26:31 +00:00
yamt 03db65e256 make sure that nfssvc sockets are zapped before being freed. 2004-06-10 12:59:57 +00:00
yamt b0ac3e4201 nfsrv_zapsock: fix an inverted condition in nfs_syscall.c rev.1.74. 2004-06-10 12:57:43 +00:00
yamt 7407c491c3 nfsrv_create: fix an LP64 problem for exclusive create. 2004-05-31 08:47:08 +00:00
yamt ee306471a7 remove an unused instance of VOP_UPDATE. 2004-05-27 12:55:07 +00:00
hannken 8c21bc6224 Add ffs internal snapshots. Written by Marshall Kirk McKusick for FreeBSD.
- Not enabled by default. Needs kernel option FFS_SNAPSHOT.
- Change parameters of ffs_blkfree.
- Let the copy-on-write functions return an error so spec_strategy
    may fail if the copy-on-write fails.
- Change genfs_*lock*() to use vp->v_vnlock instead of &vp->v_lock.
- Add flag B_METAONLY to VOP_BALLOC to return indirect block buffer.
- Add a function ffs_checkfreefile needed for snapshot creation.
- Add special handling of snapshot files:
    Snapshots may not be opened for writing and the attributes are read-only.
    Use the mtime as the time this snapshot was taken.
    Deny mtime updates for snapshot files.
- Add function transferlockers to transfer any waiting processes from
  one lock to another.
- Add vfsop VFS_SNAPSHOT to take a snapshot and make it accessible through
  a vnode.
- Add snapshot support to ls, fsck_ffs and dump.

Welcome to 2.0F.

Approved by: Jason R. Thorpe <thorpej@netbsd.org>
2004-05-25 14:54:55 +00:00
atatat 53c625655c Sysctl descriptions under vfs subtree 2004-05-25 04:44:43 +00:00
jonathan 20f923718e Change DIAGNOSTIC warning in nfs_send() about NULL rep->r_procp: the
warning is triggered pervasively, so print it only once per boot.
(The callers who pass NULL r_procps should soon be fixed to pass a
valid struct proc* ).
2004-05-24 19:08:07 +00:00
yamt 345a3c375d - for tcp, use SO_RCVTIMEO to recover from server crash.
otherwise we can be stuck in soreceive forever.
  the problem is pointed by Minoura Makoto.  PR/25662
- clear r_rexmit on reconnect and clear r_rtt and R_TIMING on retransmit
  so that the above (and soft mounts) happy.
2004-05-23 08:08:48 +00:00
christos 45fb41a2bd cut down another 7K by more NFS_V2_ONLY ifdefs. 2004-05-23 05:53:01 +00:00
jonathan 230fb9b8ab Eliminate several uses of `curproc' from the socket-layer code and from NFS.
Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded  by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize.   Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
2004-05-22 22:52:13 +00:00
yamt 7a6774551d enable reply cache for connection oriented protocols as well.
linux retransmits rpcs even when using tcp.
2004-05-21 13:53:40 +00:00
yamt 92e4dbdd94 #if 0 out CREATE optimization for now because it has a problem in the case
of O_CREAT|O_TRUNC, which is hard to be fixed without changing upper layer.
2004-05-17 12:17:18 +00:00
yamt 8d2f96d0fc g/c unused NFS_*ALLOC defines. 2004-05-12 20:11:27 +00:00
yamt 75f99c3465 nfs_lookup: handle "." by ourselves as RFC1813 3.2 says. 2004-05-10 12:43:51 +00:00
yamt 2dd754b680 don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.
2004-05-10 10:40:42 +00:00
yamt 1c1b12397d nfs_lookup: avoid CREATE optimization for DOTDOT.
creating a DOTDOT entry has no sense and will fail anyway.
2004-05-08 21:35:13 +00:00
yamt 48e8239c5a nfs_mkdir: handle the "." case. 2004-05-08 21:33:41 +00:00
yamt 2890b70316 nfs_lookitup: handle "." correctly rather than returning garbage on the stack. 2004-05-08 21:32:34 +00:00
yamt 52fedf49f0 check read only mount appropriately.
(fix a bug of nfs_vnops.c rev.1.192.)
pointed by Rob Quinn on current-users@.
2004-05-07 16:09:46 +00:00
yamt 2a85a8c4fd because nfsv3 has the same CREATE semantics as ours,
we don't have to issue LOOKUP RPCs beforehand.
2004-05-06 21:58:17 +00:00
drochner 264eb6a8ba remove duplicated snprintf(vci, ...) 2004-05-06 12:32:59 +00:00
matt adc905e2c4 Commons are not allowed in header files. extern it. 2004-05-01 06:16:42 +00:00
jrf fc97fd571a First pass for some caddr_t removal and changes to get rid of it where we
no longer use and/or need it

	- removed casts from unionfs, deadfs and fdesc
	  (there are more to hunt down still)
	- changed vfs_quotactl args argumet from caddr_t to void *
	- changed vfs_quotactl structures/callers to reflect the api change

Compiled fine and ran for about a day. Approved/reviewed by
christos@netbsd.org and gimpy@netbsd.org.
2004-04-27 17:37:30 +00:00
simonb b5d0e6bf06 Initialise (most) pools from a link set instead of explicit calls
to pool_init.  Untouched pools are ones that either in arch-specific
code, or aren't initialiased during initial system startup.

 Convert struct session, ucred and lockf to pools.
2004-04-25 16:42:40 +00:00
itojun d2f1c029b9 kill sprintf, use snprintf 2004-04-21 18:40:37 +00:00
christos baf95c5d08 use VFS_MAXFIDSZ 2004-04-21 02:22:49 +00:00
christos 6bd1d6d4db Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
2004-04-21 01:05:31 +00:00
yamt 392d6f9af1 nfs_inactive: inactive the vp before doing sillyrename works.
vp can be reclaimed soon after it's unlocked.
2004-04-20 11:51:28 +00:00
yamt d1a0f61a77 nfs_readdirplusrpc: fix a deadlock problem.
don't wait for vnode lock to load attributes.
otherwise, because READDIRPLUS returns DOTDOT entry as well,
we violate locking order.
2004-04-05 10:44:09 +00:00
yamt a3a3d45be7 nfsm_mtofh: handle the case that filehandle is exist but fattr is not. 2004-04-05 10:41:45 +00:00
yamt 9ec3dce770 don't issue VOP_GETATTR blindly in nfs_nget().
in many cases, GETATTR RPCs here is redundant because the caller has
postop_attr.  instead, make sure the resulted vnode have a valid
attribute in nfs_lookup().
2004-04-05 10:40:56 +00:00
yamt 04e9fcc377 nfs_readdirplusrpc: purge existing namecache entry before entering a new one.
otherwise we'll get duplicated entries.
2004-04-05 10:36:32 +00:00
yamt 757220a432 when entering a namecache entry for nfs, ensure to update the appropriate
timestamp in the nfsnode so that we don't get namecache-miss when
looking up the node we just created.
2004-04-05 10:35:12 +00:00
yamt 0f33822b0b nfsm_wcc_data: update n_ctime and n_nctime if no one other than us
changed the file in the meantime so that we won't invalidate caches
unnecessarily due to our own activities.
2004-04-05 10:28:23 +00:00
yamt f2fb72c33f avoid unnecessary namecache purges in some places. 2004-04-05 10:27:11 +00:00
atatat 19af35fd0d Tango on sysctl_createv() and flags. The flags have all been renamed,
and sysctl_createv() now uses more arguments.
2004-03-24 15:34:46 +00:00
yamt aefad8a7e8 nfs_getattrcache: deal with timer wraparound. 2004-03-19 13:53:28 +00:00
yamt 0f554e4324 comments on some nfsm_ macros. 2004-03-19 13:52:07 +00:00
yamt a2d33a3097 nfsrv_zapsock: zap an nfsd socket only if it's valid. 2004-03-17 10:43:35 +00:00
yamt 995e6c528b nfsrv_zapsock: remove slp from nfssvc_sockpending before zapping. 2004-03-17 10:42:37 +00:00
yamt ec3b565db1 nfs_sndlock: fix nfsd null dereference. 2004-03-17 10:40:34 +00:00
yamt fd4b77d30f SHUT_RDWR rather than bare 2. 2004-03-17 10:37:02 +00:00
yamt c12b63c2e0 some comments on cryptic nfsm_ macros. 2004-03-15 11:47:52 +00:00
yamt c819fadc97 shrink sizeof struct nfsnode by putting exclusive members into union. 2004-03-12 16:52:37 +00:00
yamt a4cbf5b042 introduce a macro NFS_INVALIDATE_ATTRCACHE and use it
instead of "n_attrstamp = 0".
2004-03-12 16:52:14 +00:00
cl 638599b22b Add static nfs boot configuration, from the kernel config file or from
a driver selectable callback function.  This is used in the Xen port to
allow controlling  the domain's network setup from the domain building
environment at domain creation (vs. having to maintain/change this on a
dhcp server).  The Xen network driver parses a command line passed in
from the domain builder.
2004-03-11 21:48:43 +00:00
matt d377ba32b7 Don't report EPIPE errors on nfs sockets. These can be due to idle tcp
mounts which will be closed by netapp, solaris, etc. if left idle too long.
2004-03-10 22:36:42 +00:00
wrstuden b5053f07a1 Adjust sillyrename cleanup code to deal with the parent vnode
already being locked by our thread. VOP_INACTIVATE() makes no
statement as to the lock state of the parent, yet this code assumed
we had it unlocked.

With this change, we let vn_lock() fail with EDEADLK if we already
have the parent locked. We then handle the rename cleanup, and on
the way out just vrele() the parent vnode, not vput() it.

Fixes a case seen by Steve Woodford at Wasabisystems dot com where
we'd panic while running a pkgsrc configure test that verified
fork() functionality. I expect the problem is a result of the recent
exit() changes and the performance of the machines he tested on.

Specifically we would crash during an nfs_remove(). As best I can
tell, when nfs_remove() tested to see if we should rename or we
should remove, v_usecount was > 1 and vattr.va_nlink was 1. Thus
we did the sillyrename in nfs_remove(). However by the time we got
down to the vput(vp), v_usecount had dropped to one and thus vput()
triggered the VOP_INACTIVATE() code path. nfs_inactive() tries to
lock the parent to undo the sillyrename, and deadlocks as we still
have it locked.
2004-01-23 22:20:20 +00:00
yamt 5abccc6a0c comments in nfs_doio_write. 2004-01-10 14:52:53 +00:00
yamt 59afac32fe - get pages to loan out in uvm_loanuobjpages() rather than
having caller (nfsd, in this case) do so.
- tweak locking so that nfs loaned READ works on layered filesystems.
2004-01-07 12:17:10 +00:00
fvdl b916f59963 Unix semantics dictate that access checks for files are done when it
is opened. An open file can always be read from and/or written to,
depending on how it was opened.

Therefore, the read/write/commit RPCs should never return EACCESS,
as they are only performed on files that have been successfully opened
already.

This change improves the current situation and works in most cases.
It simply always uses the most recently known owner/group of the file,
iff the authentication mechanism is AUTH_UNIX (in other cases, the
creds for a succesful open are used, but note that no other cases
are currently implemented).

A retry mechanism can be used to catch a few more cases, but this is
a good improvement for now.
2003-12-07 21:15:46 +00:00
thorpej fbc2b3fcd3 Fix a couple of small whitespace errors. 2003-12-07 18:58:11 +00:00
jonathan 47eb5abfab Commit message for previous revision to sys/nfs/nfs.h:
Increase NFS_MAXRAHEAD to 32. With 32k read or write requests, that
amounts to 1 Mbyte of read-ahead, enough to cover about 10 ms latency
at gigabit Ethernet speeds.  Increase the table of nfsiod kthreads
(NFS_MAXASYNCDAEMON) from 20 to 128, to match the raised value of
NFS_MAXRAHEAD. (Making the limit dynamic requires   replacing the
compile-time array with a dynamic structure.)

Add a comment explaining that each read-ahead requires an I/O thread.

Wrap both parameters with an #ifdef <parameter>/#endif, to allow
hand-tuned values or (later) a kernel config-file option override.
2003-12-06 02:48:35 +00:00
jonathan 8f814572a8 *** empty log message *** 2003-12-06 02:43:17 +00:00
atatat 13f8d2ce5f Dynamic sysctl.
Gone are the old kern_sysctl(), cpu_sysctl(), hw_sysctl(),
vfs_sysctl(), etc, routines, along with sysctl_int() et al.  Now all
nodes are registered with the tree, and nodes can be added (or
removed) easily, and I/O to and from the tree is handled generically.

Since the nodes are registered with the tree, the mapping from name to
number (and back again) can now be discovered, instead of having to be
hard coded.  Adding new nodes to the tree is likewise much simpler --
the new infrastructure handles almost all the work for simple types,
and just about anything else can be done with a small helper function.

All existing nodes are where they were before (numerically speaking),
so all existing consumers of sysctl information should notice no
difference.

PS - I'm sorry, but there's a distinct lack of documentation at the
moment.  I'm working on sysctl(3/8/9) right now, and I promise to
watch out for buses.
2003-12-04 19:38:21 +00:00
yamt 32e454901e nfs_zeropad: remove an unneeded substitution (and clean up a little.) 2003-11-29 19:31:13 +00:00
yamt 4e8d9fe867 pad requests correctly in the zerocopy case of write rpc. 2003-11-29 19:27:57 +00:00
yamt 348187802d comments. 2003-11-20 16:18:49 +00:00
yamt 0b47e1b287 fix a race case of nfsrv_getcache. 2003-11-20 16:17:25 +00:00
jonathan 30cbe1194d Fix hanging-paren typo. 2003-11-17 02:02:31 +00:00
jonathan cc1346b1a2 Change previous patch to have same effect as patch posted to
tech-kern. Suggested reformatting inadvertently changed the meaning of
the code, as noted by YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>.
2003-11-17 01:44:49 +00:00
jonathan 6ddd119256 Commit fix for NFS write deadlock, on filesystems mounted via
local-loopback (lo0). As posted for review on tech-kern 2003-18-09,
with a long  comment explaining (one of) the deadlock scenarios.

I've used this since shortly after 2002-09-12-, without noticing
performance degradataion or instability for non-loopback mounts.
2003-11-17 00:28:32 +00:00
hannken 2ef662a69e Clean up the usage of vn_start_write(). At least one occurence clobbered
previous error conditions.
If "(flags & (V_WAIT|V_PCATCH)) == V_WAIT" the return value is always zero.
Ignore the return value in these cases.

From Darrin B. Jewell.
2003-11-05 10:18:38 +00:00
simonb a2facef339 Remove some assigned-to but otherwise unused variables. 2003-10-30 01:43:08 +00:00
mycroft 3fbc866a6e Back out the bogus initializer -- the compiler bug is fixed. 2003-10-29 21:26:43 +00:00
cl b8d68ee313 note 'm68k {u,}int64_t used uninitialized' bug.
add reference to gcc bug report.
mark all (known) occurrences.
2003-10-28 02:01:46 +00:00
christos fe659fa011 fix uninitialized variable 2003-10-25 08:48:11 +00:00
yamt f3f1661306 set READres EOF flag correctly. 2003-10-20 13:53:47 +00:00
hannken a3a898ff0f Add the gating of system calls that cause modifications to the underlying
file system.
The function vfs_write_suspend stops all new write operations to a file
system, allows any file system modifying system calls already in progress
to complete, then sync's the file system to disk and returns. The
function vfs_write_resume allows the suspended write operations to
complete.

From FreeBSD with slight modifications.

Approved by: Frank van der Linden <fvdl@netbsd.org>
2003-10-15 11:28:59 +00:00
yamt f2aa877507 for nfs_timer_ch, use callout_schedule rather than callout_reset
as the former is a little more efficient.
2003-10-09 13:23:33 +00:00
yamt 589e82f2ba terminate snprintb 'new' format strings correctly.
(fixes overrun in mount_*)
2003-10-03 16:34:31 +00:00
itojun ea3d98658c plug mbuf leak due to manual mbuf handling. PR kern/13807.
(martti confirmed that it stabilizes the situation described in kren/13807)
2003-10-02 06:01:51 +00:00
yamt ef98d23ce3 do delayed truncation in nfs_getattr. 2003-09-26 14:08:45 +00:00
yamt c2025ab0ea change n_mtime from time_t to timespec in order to improve
cache consistency.
(1 second granularity is too loose these days.)
2003-09-26 11:51:53 +00:00
enami e027b9d372 Make negative name cache works again. 2003-09-25 23:10:58 +00:00
yamt 883426c958 don't call nfs_delayedtruncate() from nfs_getpages().
it causes simplelock deadlock.
2003-09-17 09:11:12 +00:00
yamt 1e8ae1ddf3 change nctime to timespec from time_t.
there can be too many activities in a second.
2003-09-17 09:10:00 +00:00
pk e881551a43 VOP_PUTPAGES() must be called with the vnode's interlock held. 2003-08-26 16:40:10 +00:00
yamt 1877d60129 use sizeof() instead of a hardcorded constant. 2003-08-16 18:09:14 +00:00
yamt 3fcbf88d41 current trylater/jukebox retry delay is way too long and
it has a bug in the backoff calculation. so,
- clip it to 1-60 sec. (suggested by Rick Macklem)
- use a constant multiplier instead of nfs_backoff, which
  is already exponential.
- move some related constant definations to nfs.h from nqnfs.h and
  prefix with NFS_ instead of NQ_ because they are not nqnfs-specific.
2003-08-16 18:08:27 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
pk 09f1c82201 Make life slightly easier for the compiler's optimisation routines. 2003-08-03 18:20:53 +00:00
yamt 33164bffc6 vrecycle removed nfs vnodes.
not perfect, but enough for most cases.
2003-07-30 12:25:39 +00:00
yamt cc104d0635 eliminate v_id. 2003-07-30 12:10:57 +00:00
yamt 7bb74d0662 when rexmitting a request due to NFSERR_JUKEBOX,
use a new xid as RFC1813 says.
2003-07-23 13:52:23 +00:00
yamt 6b565018de fix parenthesis mismatch in rev.1.93. 2003-07-23 13:50:46 +00:00
yamt 9985a5ca73 use sizeof() instead of hardcoding the size of the array. 2003-07-23 13:41:00 +00:00