Commit Graph

424 Commits

Author SHA1 Message Date
gwr 258bcc09af Change test from NETHER to NARP (revarpwhoami is in if_arp.c) 1997-09-02 21:33:17 +00:00
gwr 2f81e6c9c1 Supporting changes for the new BOOTP support in nfs_mountroot. 1997-08-29 16:12:49 +00:00
gwr 79c1e7ca6b Add support for nfs_mountroot using BOOTP based on the contributions
of Tor Egge (closes PR kern/2351).
1997-08-29 16:10:31 +00:00
gwr 78e695f5b3 Support for RARP,RPC/bootparam moved from nfs_boot.c to here. 1997-08-29 16:07:46 +00:00
gwr e25a1c17c1 The nfs_boot_xxx functions are declared in nfsdiskless.h
so remove the duplicate declarations here.
1997-08-29 16:06:41 +00:00
drochner 40db8a98f5 1. Allow to set a netmask (option NFS_BOOT_NETMASK) for the booting
interface. Without this, NFS_BOOT_NETMASK could be useless in
   subnetting envirinment.
2. Comment out unneeded NFS swap related stuff.
   Closes PR kern/3918.
1997-08-14 15:50:05 +00:00
christos 7af5edbdc3 Fix reversed test for version 3 that broke nfs version 2 mounts. 1997-07-18 17:31:46 +00:00
fvdl 43e1b9384f * Deal with servers that don't give complete FSINFO (like NT)
From Olaf Seibert <rhialto@polder.ubc.kun.nl> (PR 3687)
* Make an attempt to check the maximum filesize before attempting
  a write to the server, as write RPCs will typically happen
  asynchronously, and the process will not see the error.
  Fixes problems with unexpectly truncated files at 4G
* Pass up errors in nfs_writerpc correctly
1997-07-17 23:54:27 +00:00
fvdl c437b55ca7 A filesystem may not support VFS_VGET (like msdosfs). If it doesn't,
the server code would always skip all dir entries for a readdirplus
operation. To avoid endlessly retrying clients, try VFS_VGET first,
and it it fails, return NFSERR_NOTSUPP so that client will fall
back to normal readdir operations.
1997-07-15 01:07:47 +00:00
fvdl 2c5bca83ed Don't assume that pointers into mbuf data remain valid across nfsm_dissect.
In readdirplus, don't keep such pointers but store the file attributes
in a variable instead until they are needed. Change nfsm_loadattr*
a bit so it can accept a direct pointer to an nfs_fattr structure.
1997-07-14 20:46:20 +00:00
fvdl acdbbd5215 Do locking around nfsnode hashing (perhaps even right this time!) 1997-07-07 23:34:55 +00:00
fvdl d9e3ab6bcb Revert until I have time to fix it today (lock applied wrongly). 1997-07-07 11:50:49 +00:00
fvdl 1680996881 Put lock around nfs node hashing to avoid race conditions, as MALLOC
or getnewvnode may block.
1997-07-06 12:42:06 +00:00
drochner 8c0a9bab00 Don't cast 64bit (off_t) file sizes to vm_offset_t (32bit on many
architectures), truncate them intelligently instead.
The truncation is done centralized in vnode_pager.c.
This prevents from wrap-over effects when parts of large (>2^32 byte) files
are mmapped.
Don't allow to mmap above the numerical range of vm_offset_t.
This is considered a temporary solution until the vm system handles the
object sizes/offsets more cleanly.
1997-07-04 20:22:09 +00:00
fvdl 1dfdc8999d Immediately return EPERM for a VOP_REMOVE on a directory. 1997-06-30 20:23:56 +00:00
fvdl 55cde5331c Let nfsm_srvmtofh deal with the public filehandle, convert to all zeroes
for both v2 and v3 internally.
1997-06-24 23:40:43 +00:00
fvdl e21d2702b0 Add prototype for nfs_ispublicfh, change the ones for nfs_namei and
nfsrv_fhtovp.
1997-06-24 23:39:34 +00:00
fvdl 246567553a Invalidate nfs_pub info when reinitting the NFS server. 1997-06-24 23:38:10 +00:00
fvdl 28e824c9b7 Extend lookup handling for WebNFS. This means that nfs_namei deals
with full pathname lookups if a public filehandle is used, and that
it translates the '%' escapes (URL-style) in the same case. Also,
make nfsrv_fhtovp convert the public filehandle to the vp of the
publicly exported filesystem, as stored in the nfs_pub structure.
1997-06-24 23:36:02 +00:00
fvdl 6611bf92a5 Provide the extra arg to nfsrv_fhtovp, signalling if we're dealing with
a request on the public filehandle. Extend the lookup operation to
support WebNFS, including index file support (URL style). Yucky, it's
optional in the spec, but Solaris 2.6 will support it, so..
1997-06-24 23:32:45 +00:00
fvdl 66081af1c0 Provide extra arg to nfsrv_fhtovp (just FALSE in this case), it was
extended for WebNFS support.
1997-06-24 23:30:04 +00:00
fvdl 3416a7ca6d Add a few defines for WebNFS support. 1997-06-24 23:28:15 +00:00
mrg 295af85e9e remove swap configuration. 1997-06-12 17:12:17 +00:00
gwr 01adc15274 Minor reorganization of nfs_mountroot code to simplify BOOTP support.
The RPC/bootparamd calls to get the root and swap paths are now done
in nfs_boot_init() instead of nfs_boot_getfh(), so the latter now just
does the RPC/mountd call.  Also changed some panics into error returns.
1997-05-27 23:37:39 +00:00
gwr 248eff8eee Temporary work-around for PR kern/3579 (from Jonathan Stone). 1997-05-22 18:20:06 +00:00
fvdl f9d1ae2243 clear B_AGE for non-flush writes, buffers seem to be reused
too quickly, disturbing NFS performance (XXXX needs further analysis
and a _real_ fix)
1997-05-12 23:42:11 +00:00
fvdl fe28924160 * If nfs_reconnect fails, be sure to release the sndlock, otherwise no
other requests will get through and the mount point will be effectively dead.
  This could happen for mounts using TCP and -i and/or -s.
* Reserve enough space for UDP sockets. Fixes PR 3008, from Naofumi Honda.
1997-05-12 23:40:22 +00:00
fvdl 7b65591cb9 In nfsrvw_coalesce, make sure the coalesce list from the nfsd is moved
as well. This fixes client hangs. (from Naofumi Honda
<honda@Kururu.math.sci.hokudai.ac.jp> / NetBSD-pc98)
1997-05-12 23:37:12 +00:00
fvdl ae69375a24 Store RPC procnum consistently as an u_int32_t. This is as it should be,
and avoid possible server crashes due to bogus comparisons. Partly
from BSDI.
1997-05-12 23:36:04 +00:00
mycroft 76ee747754 Need stat.h. 1997-05-08 17:17:29 +00:00
mycroft e3f99a9397 Pass the vnode type to vaccess(), and use it when checking VEXEC. Make sure
that the mode bits passed to vaccess() and returned by foo_getattr() contain
only permission bits.
1997-05-08 16:19:43 +00:00
mycroft 837a72363d VEXEC -> VLOOKUP, as appropriate. 1997-05-08 10:57:17 +00:00
fvdl b9f22ef8f3 Only wake up one nfsiod when there is an async write to do. (from FreeBSD). 1997-04-20 16:24:44 +00:00
kleink 9c16cd8a46 Implement a POSIX compliant genfs VOP_SEEK() and use it in the appropriate
places; by Chris G. Demetriou and myself.
1997-04-11 21:52:00 +00:00
fvdl b4e49cf0e9 Avoid nfsiods acquiring/releasing a lock, then acquiring it again, before
anyone else can get to it, by checking if a reply was received, and it
has thus become unnecessary to take the lock. From FreeBSD.

XXX I don't really like this, "locks" potentially suffer from the same
problem throughout the whole kernel; they should probably be FIFO everywhere.
1997-04-08 17:57:16 +00:00
thorpej 76d601d33e Don't assume mbuf external storage is MCLBYTES. 1997-03-27 20:45:27 +00:00
thorpej 22ea1671cf Update for new mbuf code. 1997-03-27 20:40:09 +00:00
mycroft 6962daa0f8 KNF police. 1997-03-24 21:50:48 +00:00
fvdl 17d7bd9d41 Check for the use of reserved ports on a per-request basis, unless
MNT_EXNORESPORT is specified. The check is cheap and doesn't impose
any extra overhead.
1997-03-23 20:55:51 +00:00
thorpej 7cb794d91d Add some missing "\n"'s. 1997-03-17 17:41:45 +00:00
is 07b064e02e New ARP system, supports IPv4 over any hardware link.
Some of the stuff (e.g., rarpd, bootpd, dhcpd etc., libsa) still will
only support Ethernet. Tcpdump itself should be ok, but libpcap needs
lot of work.

For the detailed change history, look at the commit log entries for
the is-newarp branch.
1997-03-15 18:09:08 +00:00
mycroft bbb6842922 In nfs_link(), check for a cross-device mount *before* looking in the
v_data field.
1997-03-05 02:08:06 +00:00
fvdl a94614a50f Use ALIGNED_POINTER to see whether mbuf data needs to be realigned. 1997-02-24 23:26:20 +00:00
fvdl d4b4c37b39 Cast pointer to u_long, not int, when doing the alignment check.
Fixes warnings on the Alpha. Needs a better solution.
1997-02-22 23:33:05 +00:00
fvdl 9abd6715f6 Fixes from BSDI (thanks go to Keith Bostic). Original RCS message:
date: 1997/02/10 18:41:15;  author: cp;  state: Exp;  lines: +8 -2
Make nfs_realign go away on sparc and add functionality to nfsm_disct.

===
[XXX this introduces an ifdef __i386__, see the comment. Should be changed]
1997-02-22 03:11:12 +00:00
fvdl 37986aa09a Fixes from BSDI (thanks go to Keith Bostic). Original RCS messages:
date: 1996/07/23 17:14:46;  author: donn;  state: Exp;  lines: +6 -4
Be sure to push out the last page of the file before truncating it.

date: 1996/10/14 22:41:20;  author: donn;  state: Exp;  lines: +2 -2
From Chris: Nfs_link() called vput() on the wrong vnode when aborting
from a cross-device link, which could (and did) lead to crashes.

date: 1996/10/24 16:43:43;  author: pjd;  state: Exp;  lines: +6 -2
Return EOPNOTSUPP when trying to do a setattr with flags.

===

Also (from BSDI too, but the RCS message did not quite describe the change
to this particular file well): move the EROFS a bit further down to
let VOP_ACCESS do it's work and return an 'expected' error value to
a possible layered filesystem.
1997-02-22 03:08:47 +00:00
fvdl 03fd36b882 Fixes from BSDI (thanks go to Keith Bostic). Original RCS messages:
date: 1997/02/10 18:41:14;  author: cp;  state: Exp;  lines: +110 -46
Make nfs_realign go away on sparc and add functionality to nfsm_disct.
1997-02-22 03:03:03 +00:00
fvdl dce1770311 Fixes from BSDI (thanks go to Keith Bostic). Original RCS messages:
date: 1995/11/30 20:37:03;  author: cp;  state: Exp;  lines: +25 -14
Change splsoftclock() to splnet();
Make nfsrv_getstream create two copies of data when
splitting up an mbuf rather than two references to the
same external buffer. The symptom this fixes is client
hangs.

date: 1997/02/10 18:41:13;  author: cp;  state: Exp;  lines: +4 -1
Make nfs_realign go away on sparc and add functionality to nfsm_disct.
1997-02-22 02:59:08 +00:00
fvdl 2958b47104 Fixes from BSDI (thanks go to Keith Bostic). Original RCS message:
date: 1996/11/20 20:02:54;  author: pjd;  state: Exp;  lines: +7 -4
In nfsrv_access(), if VOP_ACCESS() returns an error and the
error == EPERM or its not the owner doing the access, return the error.
1997-02-22 02:56:01 +00:00
fvdl 78d0ef4390 Fixes from BSDI (thanks go to Keith Bostic). Original RCS messages:
date: 1995/11/30 20:37:53;  author: cp;  state: Exp;  lines: +3 -3
Change splsoftclock() to splnet();
Make nfsrv_getstream create two copies of data when
splitting up an mbuf rather than two references to the
same external buffer. The symptom this fixes is client
hangs.

date: 1996/10/16 00:06:05;  author: ewv;  state: Exp;  lines: +5 -3
Clear pending signal when an unmount fails, this allows us another chance
at the umount after a short sleep. The fixes a problem where /usr is
mounted via nqnfs and the system hangs on shutdown since the umount()
always fails with EBUSY (inetd is still busy on usr) and since we don't
clear the signal we end up stuck looping and never give inetd a chance to
catch its SIGKILL.

date: 1996/10/23 18:22:14;  author: donn;  state: Exp;  lines: +12 -7
Kirk's changes to prevent races when unmounting.  (1) Unmount()
and vfs_unmountall() now call vfs_busy() so that they participates
in the mount structure locking scheme.  Dounmount() calls vfs_unbusy()
to unlock things, and makes sure to wake up waiters if there's an
error.  (2) The MFS and NQNFS daemons also now use vfs_busy() when
unmounting filesystems.  Kirk restructured the code so that a
successful unmount by another process won't leave the possibility
that a daemon might reference a mount structure that has been freed.
1997-02-22 02:51:47 +00:00
fvdl c7a919199a Silently clear NFSMNT_NOCONN if it's a TCP mount. 1997-02-22 02:48:26 +00:00
fvdl 7a970115da Fixes from BSDI (thanks go to Keith Bostic). Original RCS messages:
date: 1996/09/06 03:00:31;  author: donn;  state: Exp;  lines: +1 -2
Because NFS doesn't implement vnode locking, nfs_inactive() doesn't really
have the vnode locked and hence it can't reliably access the vnode after
it performs a blocking operation.  We remove one blocking call and push
the no-op VOP_UNLOCK higher so that we don't access the vnode after we
delete the sillyrename file.  This should prevent crashes we've seen in
which the vnode turned into a UFS vnode and caused a panic in ufs_unlock()
when we tried to 'unlock' it.

date: 1996/09/25 19:15:21;  author: cp;  state: Exp;  lines: +4 -0
Kirk's change to not corrupt files after a delete.

date: 1996/11/08 19:53:45;  author: donn;  state: Exp;  lines: +16 -4
Krik's change to solve the paradox that vclean() calls nfs_inactive()
with VXLOCK set on the vnode, and nfs_inactive() was calling vget()
to get a reference on the vnode, which in turn hung on VXLOCK.
Nfs_inactive() now checks v_usecount to make sure that the vnode
is not coming from vclean() before it does a vget().
1997-02-22 02:45:48 +00:00
fvdl 744438b408 Don't set sillyrename field to 0 for directories, as it's in a union with
the head of the cookie list. Fixes PR 3215, fix supplied by
Hiroshi Tezuka <tezuka@trc.rwcp.or.jp>. Should also fix M_NFSDIROFF
memory leak.
1997-02-12 17:26:56 +00:00
fvdl c76913c26f Move vnode_pager_uncache to a better spot in nfsrv_remove. Also use it
in nfsrv_rename, if the 2nd argument is an existing file and will thus
be removed.
1997-02-10 12:20:49 +00:00
fvdl be787cc073 * Fix some bugs in NQNFS (malformed RPC requests, no directory lease eviction)
* Avoid possible NULL ptr ref in nfs_reply
* Don't ever try to sillyrename directories (from FreeBSD)
1997-02-09 21:19:04 +00:00
fvdl 64fcae7bcb * Make sure a new socket is created when switching to/from NOCONN with
a mount
* Add extra printf statements to hopefully get some more info on lockups,
  specifically when a send error is ignored.
1997-02-04 21:33:19 +00:00
thorpej 604572daf0 This file is now obsolete. 1997-01-31 19:11:31 +00:00
fvdl ffffefac59 nfsrv_readdirplus also suffered from the off-by-one loop problem; fix it too. 1997-01-31 16:12:26 +00:00
fvdl 5710775a55 Fix order error in loop condition which could cause a crash in nfsrv_readdir().
Fixes PR #3170
1997-01-31 09:09:43 +00:00
thorpej 647fa23dc4 - Add nfs_mountroot to nfs_vfsops.
- Only attempt to mount NFS root on a DV_IFNET class device.
- If nfs_boot_init() failes, return the error code to the caller.
1997-01-31 03:00:31 +00:00
thorpej dc33841893 NFSCLIENT -> NFS. 1997-01-31 02:58:48 +00:00
thorpej 2ec3e70ff4 - Don't look for a "suitable interface"; we're now given the name of the
network interface to use.
- If any part of the NFS root mount process fails, don't panic.
  Simply return the appropriate error and let the caller recover.
1997-01-31 02:57:31 +00:00
cgd 90688fce27 Change the second and third args to struct vfsops' (*vfs_mount)() to
'const char *', and 'void *', respectively.  The second arg is taken directly
from user arguments, and is const there, so must be const in the prototypes
and functions.  The third arg is also taken directly from user arguments.
It doesn't have to be changed, but since it's cleaner to keep the type
the same as the user arg's type, and I'm already making the 'const char *'
change...
1996-12-22 10:10:12 +00:00
fvdl 6913afc057 Give permission to the owner of the file to preserve semantics only
in the relevant cases (read, write). Fixes PR 3017.
1996-12-11 00:01:56 +00:00
mycroft c1de76e30b Allocate real malloc types for NFS, rather than using M_TEMP. 1996-12-10 10:07:22 +00:00
fvdl 2914743038 Comment change in previous made for some bad english.. 1996-12-09 11:31:11 +00:00
fvdl 46795a244d Move '#ifdef NFSSERVER' back to the right spot; NQNFS datastructures need
to be initialized on both the client and the server side. Remove misleading
comment about this being just server stuff.
1996-12-09 10:46:20 +00:00
thorpej f02e8b3cf0 Make NFSSERVER work without NFSCLIENT. This is achieved by splitting
the client and server/shared data initialization into separate functions,
and calling the server/shared initialization directly from main().
Problem noted in PR #1308 (Kenneth Stailey) and PR #1780 (Chris Demetriou).
Fix suggested in PR #1780 by Chris Demetriou, and munged a bit by me,
and OK'd by Frank van der Linden <fvdl@netbsd.org>.
1996-12-03 00:22:43 +00:00
thorpej aa25de69d1 NFS performance improvement from Doug Rabson/FreeBSD:
Improve the queuing algorithms used by NFS' asynchronous i/o.  The
existing mechanism uses a global queue for some buffers and the
vp->b_dirtyblkhd queue for others.  This turns sequential writes into
randomly ordered writes to the server, affecting both read and write
performance.  The existing mechanism also copes badly with hung
servers, tending to block accesses to other servers when all the iods
are waiting for a hung server.

The new mechanism uses a queue for each mount point.  All asynchronous
i/o goes through this queue which preserves the ordering of requests.
A simple mechanism ensures that the iods are shared out fairly between
active mount points.

Reviewed/integrated/approved by Frank van der Linden <fvdl@netbsd.org>
1996-12-02 22:55:39 +00:00
cgd ce53653783 make the namei struct members ni_dirp and ni_next, and the componentname
struct member cn_nameptr 'const', since they should never be used to
modify the path name.  (Only the pathname buffer, cn_pnbuf, should be
modified.)  Propagate the const poisoning to code that uses the namei
and componentname structs.
1996-10-25 23:13:58 +00:00
fvdl 735944405b Enhancements from Matthias Drochner:
- Try V3 first for diskless booting. Fall back to V2 if V3 fails.
	- optionally (option NFS_BOOT_TCP) try a TCP mount first
	  for diskless booting. Fall back to UDP if it fails.
	- Enable switching between UDP and TCP for remounts.
1996-10-20 13:13:22 +00:00
christos bcf4552fb1 revert kprintf changes 1996-10-13 01:39:03 +00:00
christos 117a51c5a5 printf -> kprintf, sprintf -> ksprintf 1996-10-10 23:31:17 +00:00
mycroft 2bc736661a Implement poll(2). 1996-09-07 12:40:22 +00:00
mycroft c52352c819 Add a set of generic file system operations that most file systems use.
Also, fix some time stamp bogosities.
1996-09-01 23:47:48 +00:00
thorpej 5404d54edb Another %lx -> %x for ntohl() 1996-08-14 03:47:42 +00:00
cgd 2af08e028e print result of ntohl/htonl as a long. 1996-07-10 18:43:23 +00:00
fvdl 90b2034c7c Use the right time for v3 setattr operation. 1996-07-07 12:25:47 +00:00
fvdl 88eff7ea92 Start XIDs at a value based on the current time, not 0. This avoids nasty
XID confusions with servers that cache them over a long period and
with clients that reboot quickly.

Problems: because of the sanity check that is done by comparing the system
time with filesystem time, XIDs will start at 0 until root is mounted,
which means it isn't completely safe for diskless setups. But it's clearly
better than it was. It would also be cleaner if all XID handling (more
generally, all RPC handling) within the kernel went through the
same functions.
1996-07-07 12:23:49 +00:00
fvdl 0f6afee9a7 Remove bogus check on record length < NFS_MINPACKET.
(From Guy Harris via Rick Macklem).
1996-07-02 23:21:15 +00:00
fvdl 1e8262b3d6 Don't mistake a non-async block that needs to be commited for an
interrupted write.
1996-07-02 16:03:47 +00:00
fvdl 2f1b74d9f0 Always call vnode_pager_uncache when removing a file in the server
(same as in sys_unlink()).
1996-07-01 11:16:03 +00:00
fvdl b27bafebd5 We're only handling uio with iovcnt == 1, so don't ever attempt to increment
uio_iov, this will get us into nasty trouble. (Thanks to Matthias Drochner for
tracking this down).
1996-07-01 10:22:47 +00:00
pk 6e8ba625ef Ignore the mountpoint's `v_usecount' in nfs_unmount() if MNT_FORCE is on.
This takes care of two related problems:
	- `umount -f' wouldn't work if someone's working directory is
	  the filesystem root.
	- vfs_unmountall() would complain about a busy `/' on a
	  diskless setup.
1996-06-24 10:26:40 +00:00
cgd d73abf41aa avoid unnecessary checks of m_get/MGET/etc.'s return values. When
they're called with M_WAIT, they are defined to never return NULL.
1996-06-14 22:21:12 +00:00
cgd d9d0cc229c fix two bugs (the latter potentially fatal) in xdr_string_encode():
(1) if length needed was > MCLBYTES, an mbuf would be lost, and
(2) the wrong check was being used to determine if MCLGET succeeded.
1996-06-07 00:48:10 +00:00
fvdl e4145cb406 Align things right in NWDELAYHASH (for the Alpha). This fixes crashes in
the server code. From John Birell.
1996-05-27 11:22:31 +00:00
fvdl 2847784948 * Make mounts with symlinks work (needed for direct mounts with amd). PR #1917
* Never change the NQNFS flag and/or version when just doing an update mount.
  Fixes a problem that made diskless booting impossible under some
  circumstances.
1996-05-23 22:47:27 +00:00
mycroft 49d52c9b1c Pass a proc pointer down to the usrreq and pcbbind functions for PRU_ATTACH, PRU_BIND and
PRU_CONTROL.  The usrreq interface really needs to be split up, but this will have to wait.
Remove SS_PRIV completely.
1996-05-22 13:54:55 +00:00
mycroft 261382c331 Change VOP_UPDATE() semantics:
* Make 2nd and 3rd args timespecs, not timevals.
* Consistently pass a Boolean as the 4th arg (except in LFS).
Also, fix ffs_update() and lfs_update() to actually change the nsec fields.
1996-05-11 18:26:27 +00:00
thorpej 3b8a528094 Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating
if_name and if_unit.  Updated interface to (*if_watchdog)() and (*if_reset)()
to take a struct ifnet *, rather than a unit number.
1996-05-07 02:51:25 +00:00
thorpej b417cc19fe Make this compile again on a SPARC if NFSCLIENT is defined without
NFSSERVER.  (-Wall unused variable lossage)
1996-04-15 20:20:00 +00:00
thorpej ea39811fd8 Make these link in the absense of "options FIFO". 1996-04-03 23:25:36 +00:00
fvdl fa29f1090f Return earlier on error in nfs_statfs. Should fix problem reported by
both mrg and cgd.
1996-03-24 23:58:10 +00:00
fvdl c0d2b279c6 Make sure not to free the reply mbuf twice. Should fix PR #2240 1996-03-20 21:59:56 +00:00
christos 3fac949f8f Fix printf format strings. 1996-03-17 02:38:20 +00:00
fvdl f5e6df1ed0 Disable invalidating of directory offsets cookies. Should fix one or two
directory problems.

XXX There is no clean solution to the cookie/cookieverifier validity mess.
    Together with the disabled strict cookie check, this puts us back at
    what v2 did in this case. Slightly better solution possible by
    consequently storing 64bit cookies in other places too.
1996-03-13 00:44:17 +00:00
fvdl 146f96c2ce Make readdirsize default to rsize if rsize is explicitly specified,
and readdirsize isn't.
1996-03-13 00:38:55 +00:00
jtk 6c62245a7b fix panic "leaf should be empty" on diagnostic kernels when unlinking on
a read-only file system.
1996-03-05 05:30:09 +00:00
jtk 115750720d Do not return whiteout directory entries in NFS readdir replies. (The
NFS protocol doesn't know how to deal with them properly, yet.)
1996-03-02 15:55:52 +00:00
fvdl 52d04f3b3f Make sure to clear B_NEEDCOMMIT in the right spot. Fix 'officially blessed'
by Rick Macklem. Fixes PR kern/2128.
1996-02-29 20:26:16 +00:00
fvdl 3821dd940b Oops. Do previous fix on the right line this time.. (thanks Charles) 1996-02-25 17:47:26 +00:00
fvdl 1f20fc9fc2 Call soreserve() with the right size for receives (from pk). 1996-02-25 15:30:01 +00:00
cgd e98dc62664 Third argument to VOP_PATHCONF is a register_t *, and register_t may be
different than 'int'.  Do the right thing when declaring variables which
are used this way.
1996-02-20 23:45:10 +00:00
fvdl e9788cf246 Fix a missing 'error =' before 'if (error)'. 1996-02-18 14:06:50 +00:00
fvdl 5ac7df1caf Bring in a merge of Rick Macklem's NFSv3 code from Lite2 1996-02-18 11:53:36 +00:00
gwr 04ff35d122 Add stub for nfs_boot_getfh if NETHER==0 1996-02-16 15:18:19 +00:00
gwr b29ca3a272 Do the RPC to bootparamd a little later (just before the mountd call)
so that we do not ask for the "swap" path when swapping on disk.
1996-02-13 17:53:32 +00:00
christos 216907979a add 2 missing fwd struct declarations 1996-02-13 17:06:52 +00:00
pk b153275d13 Don't return EBADRPC if we have something else. 1996-02-10 22:55:16 +00:00
christos e4c93ec893 nfs prototype changes 1996-02-09 21:48:19 +00:00
mycroft c9c8301a91 Fix vop_link, vop_symlink, and vop_remove semantics in several ways:
* Change the argument names to vop_link so they actually make sense.
* Implement vop_link and vop_symlink for all file systems, so they do proper
  cleanup.
* Require the file system to decide whether or not linking and unlinking of
  directories is allowed, and disable it for all current file systems.
(Also, remove the cross-device link check, that was moved into the file
systems some time ago.)
1996-02-09 15:47:11 +00:00
mycroft 53fccab940 Fix vop_link, vop_symlink, and vop_remove semantics in several ways:
* Change the argument names to vop_link so they actually make sense.
* Implement vop_link and vop_symlink for all file systems, so they do proper
  cleanup.
* Require the file system to decide whether or not linking and unlinking of
  directories is allowed, and disable it for all current file systems.
1996-02-09 14:45:36 +00:00
jtc 2ea599d8f8 Rename struct timespec fields to conform to POSIX.1b 1996-02-01 00:41:19 +00:00
jtc 299e1fe9df Rename struct timespec fields to conform to POSIX.1b 1996-02-01 00:31:05 +00:00
mycroft 59d1cce3ae Don't specify a uid or gid in create operations; let the server fill it in. 1996-01-31 05:13:33 +00:00
mycroft 85f2006f7a Correct some uses of -1 and VNOVAL. 1996-01-31 04:24:35 +00:00
cgd 3e0efb4d89 changes to make this work on systems where pointers & longs are 64 bits.
This is mostly just changes to make the stuff that goes over the wire
use fixed-size types.
1995-12-19 23:07:11 +00:00
ghudson d61f235615 Add cookie support. Stash cookies in the word prior to the end of
each entry, and read them out in nfs_readdir().

Caveat: our current caching method for directory blocks uses the
server offset of the first directory entry as an identifier, so a
Linux emulation getdirentries() will wind up retrieving one block from
the NFS server for each directory entry, unnecessarily thrashing the
cache.  The situation isn't as bad for other emulations.

Instead of getblk(), we need to write a routine to scan each cache
block associated with vp to find a cookie that matches at some
directory entry.  Some later time.
1995-10-14 00:56:07 +00:00
mycroft b12f4a4409 For now, return EINVAL if the client needs cookies. 1995-10-09 11:25:30 +00:00
mycroft 245f292fed Prefix names of system call implementation functions with `sys_'. 1995-10-07 06:25:19 +00:00
thorpej 60024eb978 Make system calls conform to a standard prototype and bring those
prototypes into scope.
1995-09-19 21:40:36 +00:00
ws 4d035ffc4d No point in computing cn_hash here,
as it gets immediately recomputed in lookup
1995-09-08 13:52:23 +00:00
mycroft 5482957905 splnet --> splsoftnet 1995-08-12 23:59:09 +00:00
gwr 19969f2fe2 Use RPCAUTH_UNIX in requests to please picky NFS servers. 1995-08-08 20:43:43 +00:00
cgd e9d17d38b5 avoid unnecessary aging of buffers. This used to make sense, when buffer
caches were much smaller, but makes little sense now, and will become more
useless as RAM (and buffer cache) sizes grow.  Suggested by Bob Baron.
1995-07-24 21:19:27 +00:00
cgd 8f62c773e8 don't assume the f_fsnamelen is nul-truncated or longer than MFSNAMELEN 1995-06-18 14:45:14 +00:00
mycroft 6897f39ae9 Various cleanup, including:
* Convert several data structures to use queue.h.
* Split in_pcbnotify() into two parts; one for notifying a specific PCB, and
one for notifying all PCBs for a particular foreign address.
1995-06-12 00:46:47 +00:00
mycroft 41a1b362f8 Fix more off by one errors. 1995-06-02 19:50:11 +00:00
mycroft f1365566f1 Fix another off by one error. 1995-06-02 18:49:31 +00:00
mycroft b1b27effa0 Imported group list now starts at offset 0, not 1. 1995-06-02 18:38:57 +00:00
mycroft f5f32d8328 Exported group list now starts at offset 0, not 1. 1995-06-02 18:35:50 +00:00
jtc 95ded74f58 Moved egid credential from cr_groups[0] to new field cr_gid. POSIX.1
requires that sgid executables and the setuid() syscall *not* change
the supplemental group list.
1995-06-01 22:43:30 +00:00
mycroft 1448ab7a19 Remove gratuitous extra indirections. 1995-05-23 06:22:45 +00:00
cgd f66bf5fd18 don't blindly set IFF_UP; or it with old flags 1995-05-23 00:14:06 +00:00
mycroft f6ff0fba6d Use fxdr_*() and txdr_*() macros to do byte order conversions. 1995-05-20 01:52:49 +00:00
cgd 14b1452a90 kill unnecessary blank line at end of file 1995-04-30 07:03:13 +00:00
gwr d73db495da Fixed RPC code to deal with RPC messages larger than one mbuf. 1995-04-24 21:54:56 +00:00
gwr 1012443810 Cosmetic changes suggested by Adam. 1995-03-28 21:29:32 +00:00
jtc f76f1f89ad KERNEL -> _KERNEL 1995-03-26 20:35:13 +00:00
gwr ca3ff7bdd8 Initialize fields in the RPC data where we were sending garbage. 1995-03-18 05:56:32 +00:00
gwr 8f7b63df4e Print the "root/swap on ..." messages here.
Add NFS_BOOT_OPTIONS for things like NFSMNT_NOCONN.
1995-03-18 05:54:10 +00:00
gwr efc4706419 Do the printf "root/swap on" elsewhere to avoid confusion. 1995-03-18 05:51:22 +00:00
gwr 4b284ae4ba Make call to nfs_writerpc() consistent with others. 1995-03-18 05:49:51 +00:00
mycroft 2f805fa51b copy*str() should use size_t. 1995-03-09 12:05:21 +00:00
pk d6faa0bf9c Working "config generic" support; from Theo. 1995-02-16 21:42:50 +00:00
mycroft 7b85c59a4e Turn mountlist into a CIRCLEQ, and handle setting and checking of MNT_ROOTFS
differently.
1995-01-18 06:15:17 +00:00
mycroft 396d1c1d0c Convert unspecified usec value to 0, per discussion with Rick. 1995-01-13 16:15:02 +00:00
mycroft 775d061b43 Add two missing brelse() calls. From Rick Macklem. 1995-01-12 12:08:23 +00:00
mycroft 69eef46dd1 Make sure readdir requests are only truncated on block boundaries. 1995-01-10 06:50:03 +00:00
mycroft e16d63a4c0 Minor consistency nits. 1994-12-29 22:21:37 +00:00
mycroft d23d4ad181 Remove a bit of redundant code. 1994-12-29 22:16:19 +00:00
mycroft 609063ce2b Format police. 1994-12-27 19:05:12 +00:00
mycroft 34c8e07091 Fix typos in last change. 1994-12-27 19:00:20 +00:00
ws 2f0fb8ee09 Implement and use a common access checking routine 1994-12-24 16:44:12 +00:00
mycroft 527b796ff5 Turn lease_check() into a vnode op, per CSRG. 1994-12-13 20:14:30 +00:00
mycroft 629ef9cd78 Sync with CSRG. 1994-12-13 17:17:01 +00:00
mycroft 6bd48aee2d Remove an old `#ifdef notyet'. 1994-12-13 16:18:48 +00:00
cgd 58604c58ca fix a couple of obvious, painful endianness bugs introduced in last commit. 1994-10-29 06:38:11 +00:00
cgd 6b7c260753 new RCS ID format. 1994-10-26 02:45:11 +00:00
cgd 6f353db960 update for new syscall args description mechanism 1994-10-20 04:28:10 +00:00
gwr 62f18b1dda Do the first BOOTPARAM RPC call to the broadcast address instead of
using the address of the RARP server because a BOOTPARAM server
might not be running on the machine that sent the RARP reply.
1994-09-26 16:42:29 +00:00
pk cdf3d1ed89 mknod() must release its new vnode. 1994-08-30 19:42:22 +00:00
pk e052143aab When updating an NFS mountpoint, we cannot just increase `rsize' or `wsize'
without also adjusting the corresponding socket buffers. We could probably
call sbrelease/sbreserve/soreserve ourselves without much harm, but we'd
have to duplicate much of the logic in nfs_connect(). In stead, blow the
socket away entirely and let nfs_connect() do its job again.
1994-08-23 09:31:00 +00:00
cgd 56364fe8b1 cleanliness; don't wrap lines. 1994-08-21 21:07:13 +00:00
mycroft 27377e3e10 Don't attempt to use IO_APPEND for NQNFS, as suggested by Rick Macklem. 1994-08-21 15:10:44 +00:00
mycroft f7c13d44bd More LIST/CIRCLEQ migration. 1994-08-18 22:47:43 +00:00
mycroft 8743009944 Convert some more lists and queues. 1994-08-17 14:43:47 +00:00
mycroft 7b8734f3e8 Use LIST and TAILQ for hash chain and LRU chain, respectively. 1994-08-17 12:34:12 +00:00
mycroft dbd174a5da Change the reply list to a TAILQ. 1994-08-17 11:41:36 +00:00
gwr f23d6f0929 Add the option NFS_BOOT_RWSIZE to allow diskless boot configuration
to start with a reduced NFS read and write size (need for wd8003).
1994-08-14 03:35:27 +00:00
pk 4e501cd0bf Files with > 1 links can always be removed on the server, even if a
"silly name" exists.
1994-08-13 08:46:53 +00:00
cgd c4b592cd82 fix typo 1994-08-12 04:31:51 +00:00
cgd 8814bea1a6 kill two errant spaces. 1994-08-12 03:49:24 +00:00
mycroft 1f532b06bd char * --> caddr_t, where appropriate. 1994-08-11 23:47:51 +00:00
gwr 38cca96798 Diskless boot will now bind the local socket to a reserved port to
satisfy picky servers.  Also fix some missing initializations.
(Thanks to Chuck Cranor for PR#394 -- now fixed.)
1994-08-11 22:25:32 +00:00
deraadt 0e5ad5faf5 delete unused extern decl 1994-08-08 19:29:29 +00:00
mycroft 9c55cb1c79 Set the group list length when copying credentials. 1994-07-22 23:16:36 +00:00
mycroft 24f8e9187d Fix a problem with write-behind causing processes to be killed occasionally.
From Rick Macklem.
1994-07-20 04:16:01 +00:00
gwr dc718c003d Fix the conditionally compiled code inside #ifdef NFS_BOOT_GATEWAY
and make some printf args use host byteorder.
1994-07-19 02:23:27 +00:00
paulus a02a99e328 If we don't have ethernet, nfs_boot_init reduces to just a panic.
This is so I don't get an undefined symbol compiling a kernel with
NFSCLIENT but no ethernet.
1994-07-16 11:43:12 +00:00
cgd 65855280c7 minor cache consistency fix 1994-07-12 21:03:14 +00:00
mycroft a28c342dee Bug fix from Rick Macklem for a problem with linking to an open file. 1994-07-12 19:46:36 +00:00
mycroft 2896174213 Save FS type at mount time for some later tests. 1994-07-03 09:24:01 +00:00
mycroft c6d5fd7263 Fix problem with O_TRUNC and NFS device nodes. 1994-07-03 09:22:37 +00:00
pk 4070698468 error codes are in network order too. 1994-06-30 10:45:03 +00:00
deraadt 9bc624e44c knf 1994-06-29 07:28:36 +00:00
cgd fccfa11af5 New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD' 1994-06-29 06:39:25 +00:00
gwr ccb36b6b7d Minor nits: replace ... with ...
p->p_cred->pc_ucred	p->p_ucred
	x / DEV_BSIZE		x >> DEV_BSHIFT
1994-06-28 19:12:59 +00:00
pk bccc2c3c1b straighten out diskless swap code somewhat. 1994-06-22 14:01:45 +00:00
pk 2d90c57d10 Construct mountpath for remote root. 1994-06-21 08:30:20 +00:00
mycroft 0d8affb278 Turn P_NOSWAP and P_PHYSIO into a hold count, as suggested by a comment. 1994-06-15 19:59:21 +00:00
gwr b7692860e5 Fix false "hits" in the attribute cache when booting diskless.
(Yet another thing that breaks when time.tv_sec is near zero...)
1994-06-14 03:29:12 +00:00
mycroft fee90785c2 Move a misplaced #endif. 1994-06-13 16:00:41 +00:00
mycroft d87a71b8c8 Undo last change. 1994-06-13 15:39:13 +00:00
gwr 3247b5928d Fix unresolved: prtactive 1994-06-13 15:33:32 +00:00
gwr 0784b58d30 New diskless boot code (uses RARP, bootparamd). 1994-06-13 15:28:55 +00:00
mycroft 0c51ee36cb Clean up deleted files. 1994-06-08 11:37:21 +00:00
mycroft cde1d47595 Update to 4.4-Lite fs code, with local changes. 1994-06-08 11:33:09 +00:00
cgd f42a80c7ea MIN -> min, MAX -> max 1994-05-24 02:33:03 +00:00