Commit Graph

750 Commits

Author SHA1 Message Date
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