Commit Graph

145 Commits

Author SHA1 Message Date
ad
f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
yamt
3333e8aa5c fix handling of NFSERR_NOTSUPP and NFSERR_BAD_COOKIE,
which have been broken since nfs_socket.c rev.1.115.
2006-06-30 09:55:34 +00:00
elad
fc9422c9d9 integrate kauth. 2006-05-14 21:31:52 +00:00
yamt
ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
yamt
cabee93abb nfs_doio_read: clear uio_resid when filling a hole. 2006-01-14 08:57:40 +00:00
reinoud
255662c92a Fix of panic that was introduced since ktrace-lwp branch was merged. The
shortcut to the process of the passed lwp paniced the kernel since lwp
could/can be passwd as NULL in VOP_WRITE().

This was happening when ktracing to NFS. The function ktrwrite() set the
uio_lwp to NULL and then calls VOP_WRITE() with this argument. nfs_write()
then accessed lwp *l->l_proc wich paniced.

Thanks to David Laight for his help on tracking it down.
2005-12-13 13:12:18 +00:00
christos
95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt
221616873d merge yamt-readahead branch. 2005-11-29 22:52:02 +00:00
yamt
a0a8d930a4 nfs_bioread: push delayed truncation and tweak loop accordingly.
PR/31926 from Jed Davis.
2005-11-04 19:39:30 +00:00
yamt
e10443f324 nfs_bioread: handle file truncation on the server a little more gracefully. 2005-10-06 10:20:58 +00:00
jdolecek
5fbad4b597 use killproc() for killing the process due to text file modification, so
that it's logged too

PR: 17392 by Greg A. Woods
2005-10-01 21:09:03 +00:00
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
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