Commit Graph

133 Commits

Author SHA1 Message Date
christos
50f8955b6e 64 bit inode changes. 2005-08-19 02:04:03 +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
perry
bcfcddbac1 nuke trailing whitespace 2005-02-26 22:31:44 +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
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
72d6e88acf handle a really empty directory, which doesn't have even the dot entry. 2005-01-26 10:30:58 +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
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
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
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
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
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
christos
45fb41a2bd cut down another 7K by more NFS_V2_ONLY ifdefs. 2004-05-23 05:53:01 +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
yamt
5abccc6a0c comments in nfs_doio_write. 2004-01-10 14:52:53 +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
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
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
yamt
883426c958 don't call nfs_delayedtruncate() from nfs_getpages().
it causes simplelock deadlock.
2003-09-17 09:11:12 +00:00
pk
e881551a43 VOP_PUTPAGES() must be called with the vnode's interlock held. 2003-08-26 16:40:10 +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
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
yamt
c8ad6cc17b interlock for NFLUSHINPROG/NFLUSHWANT. 2003-05-22 15:59:24 +00:00
yamt
ddd5ced644 eliminate memcpy in the common and easy case of write. 2003-05-21 13:27:19 +00:00
yamt
4811ccb6a0 correct a KASSERT. 2003-05-16 17:16:05 +00:00
yamt
19bdd5d1e5 acquire vmobjlock when touch pg->flags. 2003-05-15 14:34:06 +00:00
yamt
de31ef25cd simple lock for nfs iod. 2003-05-07 16:18:53 +00:00
yamt
3698fcc62e - check page's offset in the object as well. (pointed by Chuck Silvers.)
- remove false assertion.
2003-05-03 17:27:20 +00:00
yamt
455e4333eb - if writerpc ends with a stable result, no need to commit them anymore.
- add comments.
2003-05-03 16:46:39 +00:00
yamt
8c5ba805e5 better handling of write verifier change. 2003-05-03 16:28:57 +00:00
yamt
8178e19cb6 fix a use of an uninitialized variable. 2003-04-18 15:19:02 +00:00
yamt
63de87c34b remove line-wrapping that is no longer needed. 2003-04-15 13:48:40 +00:00
yamt
dcf4c9093f fix a typo in the previous. 2003-04-12 14:41:28 +00:00
yamt
1505b097fa set b_resid correctly. 2003-04-12 14:38:57 +00:00
yamt
9ad479d8c2 split nfs_doio to nfs_doio_{phys,read,write} to avoid too deep indents. 2003-04-12 14:26:58 +00:00
yamt
043759a005 - do FILESYNC writes if we're freeing the page or the page doesn't
belong to us.  otherwise, data will be lost on server crash.
- use b_bcount instead of b_bufsize to determine
  how many pages we should deal with.

based on a patch from Chuck Silvers.
discussed on tech-kern.
2003-04-12 06:53:09 +00:00
yamt
65e3d14a8a rename a very confusing variable name.
(must_commit -> stalewriteverf)
2003-04-09 14:30:30 +00:00
yamt
b90af31ce6 when commit failed and fall to write, re-set 'off' and 'cnt'
because it can be changed in 'needcommit' path.
2003-04-09 14:27:58 +00:00
yamt
9b96b4ab78 make per-iod datas together. 2003-04-09 14:22:33 +00:00
thorpej
b78f59b443 Merge the nathanw_sa branch. 2003-01-18 08:51:40 +00:00
yamt
059aba1c85 fix panic (assertion failure) on error case.
if uiomove is failed, we should clean up pages past eof.

the problem reported by kay.
ok'ed by Chuck Silvers.
2002-10-29 10:15:16 +00:00
jdolecek
e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00