Commit Graph

303 Commits

Author SHA1 Message Date
wollman
a76fb5eefa Yow! Completely change the way socket options are handled, eliminating
another specialized mbuf type in the process.  Also clean up some
of the cruft surrounding IPFW, multicast routing, RSVP, and other
ill-explored corners.
1998-08-23 03:07:17 +00:00
bde
09bd4b9603 Fixed printf format errors. 1998-08-18 00:32:50 +00:00
dfr
cb85cf3e66 Protect all modifications to v_numoutput with splbio(). 1998-08-13 08:09:08 +00:00
bde
92b68e1a4b Don't configure compatibility code for pre-Lite2 mount() calls by
default.  This code should go away soon.
1998-08-12 20:17:42 +00:00
peter
6adfc2e8bc If we get an ENOBUFS from the network, it's normally transient network
interface congestion (eg: nfs over a ppp link, etc).  Don't log these
for UDP mounts, and don't cause syscalls to fail with EINTR.
This stops the 'nfs send error 55' warnings.

If the error is because the system is really hosed, this is the least
of your problems...
1998-08-01 09:04:02 +00:00
bde
863d5c8b68 Cast pointers to uintptr_t/intptr_t instead of to u_long/long,
respectively.  Most of the longs should probably have been
u_longs, but this changes is just to prevent warnings about
casts between pointers and integers of different sizes, not
to fix poorly chosen types.
1998-07-15 02:32:35 +00:00
dfr
0787c79732 Use u_int32_t in NQFHHASH instead of u_long. 1998-07-05 10:13:22 +00:00
julian
4363221ba2 VOP_STRATEGY grows an (struct vnode *) argument
as the value in b_vp is often not really what you want.
(and needs to be frobbed). more cleanups will follow this.
Reviewed by: Bruce Evans <bde@freebsd.org>
1998-07-04 20:45:42 +00:00
kato
b262a6b558 Moved `#ifndef NFS_NOSERVER' after including nfs.h. 1998-07-02 12:41:42 +00:00
jmg
c8ef0cb9cd fix buildworld hopefully be3fore anyone complains...
NFS_*TIMO should possibly be converted to sysctl vars (jkh's suggestion),
but in some cases it looks like nfs keeps a copy of the value in a struct

hash sizes are already ifdef'd KERNEL, so there aren't userland inpact
from them...
1998-06-30 11:19:22 +00:00
jmg
0e50288276 convert some nfs tunables to options, these are:
NFS_MINATTRTIMO         VREG attrib cache timeout in sec
NFS_MAXATTRTIMO
NFS_MINDIRATTRTIMO      VDIR attrib cache timeout in sec
NFS_MAXDIRATTRTIMO
NFS_GATHERDELAY         Default write gather delay (msec)
NFS_UIDHASHSIZ          Tune the size of nfssvc_sock with this
NFS_WDELAYHASHSIZ       and with this
NFS_MUIDHASHSIZ         Tune the size of nfsmount with this
NFS_NOSERVER            (already documented in LINT)
NFS_DEBUG               turn on NFS debugging

also, because NFS_ROOT is used by very different files, it has been
renamed to opt_nfsroot.h instead of the old opt_nfs.h....
1998-06-30 03:01:37 +00:00
bde
193dd07396 Fixed typo in ifdefed code. (NFS_ACDEBUG is not in LINT. Therefore,
code controlled by it did not even compile.)
1998-06-21 12:50:12 +00:00
bde
a90040b583 Avoid an egcs pessimization for 64-bit signed division on i386's.
Pre-2.8 versions of gcc generate a call to __divdi3() for all 64-bit
signed divisions, but egcs optimizes them to a shift and fixup when
the divisor is a constant power of 2.  Unfortunately, it generates
a call to __cmpdi2() for the fixup, although all except possibly
ancient versions of gcc and egcs do ordinary 64-bit comparisons
inline.
1998-06-14 15:52:00 +00:00
dfr
1d5f38ac22 This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
1998-06-07 17:13:14 +00:00
peter
dec84bd443 Make sure we go a nfs_fsinfo() in get/putpages before calling
readrpc/writerpc, since they assume it's already been done.  This could
break if the first read/write access to a nfs filesystem was an exec() or
mmap() instead of a read(), write() syscall.  (or statfs()).
nfs_getpages() could return an errno (EOPNOTSUPP) instead of a VM_PAGER_*
return code.  Some layout tweaks for the get/putpages code.
1998-06-01 11:32:53 +00:00
peter
21629df4dd Fix post-test pre-commit cleanup typo. 1998-06-01 11:07:16 +00:00
peter
4178bd0c41 readlink() returns EINVAL rather than EPERM if called on a non-symlink. 1998-06-01 10:59:23 +00:00
peter
aca365c43e Preset the maximum file size before we get to nfs_fsinfo(), based on
an (over?) conservative assumption about what the client can store in it's
buffer cache using a signed 32-bit 512-byte block number index.  Otherwise
it's possible for some file access when maxfilesize = 0 (eg: /usr is nfs
mounted and doing an execve())
Pointed out by:	 bde

XXX It might make sense to do a preemptive nfs_fsinfo() call at mount time.
1998-06-01 10:01:31 +00:00
peter
66d2475e6f Hide more kernel stuff from userland. This stops nethostaddr etc being
wanted by mount_nfs.c.
1998-06-01 07:23:26 +00:00
peter
19ad2aa63b For the on-the-wire protocol, u_long -> u_int32_t; long -> int32_t;
int -> int32_t; u_short -> u_int16_t.  Also, use mode_t instead of u_short
for storing modes (mode_t is a u_int16_t).

Obtained from: NetBSD
1998-05-31 20:09:01 +00:00
peter
401c250cc4 Support 'mount -u' remounts. This may require disconnecting and rebinding
the socket.  Certain mode changes are not allowed.

Obtained from:  NetBSD
1998-05-31 19:49:31 +00:00
peter
5080277e0e Cut-n-paste glitch 1998-05-31 19:43:34 +00:00
peter
d9c0dc4a94 xdr encode -1 properly.
Obtained from: NetBSD
1998-05-31 19:29:28 +00:00
peter
2a5188e78c Fully fill in nfsv2 write rpc requests rather than leaving garbage.
Obtained from: NetBSD
1998-05-31 19:28:15 +00:00
peter
da4830ce17 Don't silently fail to set file flags.
Obtained from:  NetBSD
1998-05-31 19:24:19 +00:00
peter
a378822d22 Don't blindly accept the server's preferences if they are too small.
Obtained from:  NetBSD
1998-05-31 19:20:44 +00:00
peter
21746bb862 Prototype support for selectively allowing non-reserved ports on a per
export basis.  Needs userland support yet.

Obtained from:  NetBSD
1998-05-31 19:16:08 +00:00
peter
7966818099 Hide whiteouts from NFS, since the protocol doesn't support them.
Obtained from:  NetBSD
1998-05-31 19:10:52 +00:00
peter
49e79dfe9e NetBSD has a comment that Solaris 2.5 doesn't do verifiers correctly,
we have weakened this test already for Digital Unix, so it may be enough
for Solaris.  It needs to be checked again.

Obtained from: NetBSD
1998-05-31 19:07:47 +00:00
peter
a21fad22e0 Don't pass a second copy of the uid/gid in with the v2/v3 sattr structures,
it just makes more work.  We pass a copy of the uid/gid with the
credentials.  (although, this may need to be revisited if a non AUTHUNIX
authentication method (such as NFSKERB) ever gets implemented).

Obtained from:  NetBSD
1998-05-31 19:00:19 +00:00
peter
985cae8566 Use the new SB_UPCALL flag,
Obtained from:  NetBSD (but I changed the flag clear order in case).
1998-05-31 18:46:06 +00:00
peter
c4805fc7a0 NFS_SMALLFH is defined in nfsproto.h, not sys/mount.h
Obtained from:  NetBSD
1998-05-31 18:32:23 +00:00
peter
1f34203061 Don't let the user try "rmdir ."
Obtained from:  NetBSD
1998-05-31 18:30:42 +00:00
peter
f61450c5b0 Don't let the user try and unlink() a directory on a NFS server.
Obtained from:  NetBSD
1998-05-31 18:28:45 +00:00
peter
c45767477f When a write rpc returns an error, break the loop.
Obtained from: NetBSD
1998-05-31 18:27:07 +00:00
peter
7d869157f3 Don't leak an mbuf when a write rpc returns zero bytes written.
Obtained from: NetBSD
1998-05-31 18:25:32 +00:00
peter
feb54238cc #ifdef a diagnostic printf
Obtained from:  NetBSD
1998-05-31 18:23:24 +00:00
peter
c50a18d361 Don't try and free mrep twice on some error conditions.
Obtained from:  NetBSD
1998-05-31 18:19:43 +00:00
peter
66a3e6b96c #ifdef a diagnostic panic, plus another missed costmetic change.
Obtained from:  NetBSD
1998-05-31 18:11:03 +00:00
peter
32e00d316d We have gained 2 more errno's, add them to the NFSv2 mapping table. 1998-05-31 18:09:18 +00:00
peter
87e3e1a54b Missed a cosmetic change that the other BSD's have. 1998-05-31 18:08:09 +00:00
peter
e410a1b026 oops, nfs_msg() is called from client code too. 1998-05-31 18:06:07 +00:00
peter
35835ef239 When we can't reconnect a socket, don't forget to unlock before retrying
or we can deadlock.

Obtained from:  NetBSD
1998-05-31 18:02:56 +00:00
peter
7f449d8699 Don't log zero length reads, this can happen during normal operation.
Obtained from: NetBSD
1998-05-31 18:00:46 +00:00
peter
7246bc5193 Consider for readdir chunk sizes when tuning socket buffer reservations.
Obtained from:  NetBSD
1998-05-31 17:57:43 +00:00
peter
2b239be950 Refuse READDIR / READDIRPLUS rpc's for non-directories
Obtained from: NetBSD
1998-05-31 17:54:18 +00:00
peter
cbeeaf83f2 Some const's
Obtained from: NetBSD
1998-05-31 17:48:07 +00:00
peter
e58631da3c NFS Jumbo commit part 1. Cosmetic and structural changes only. The aim
of this part of commits is to minimize unnecessary differences between
the other NFS's of similar origin.  Yes, there are gratuitous changes here
that the style folks won't like, but it makes the catch-up less difficult.
1998-05-31 17:27:58 +00:00
peter
c8c505e6c0 VOP_ABORTUP() appears to be called with the wrong vnode. The other callers
that I checked (eg: ufs_link()) do the ABORTOP on the directory rather than
the file itself.  After Michael Hancock's patches, the abortop doesn't seem
all that critial now since something else will free the pathname buffer.
1998-05-31 01:03:07 +00:00
peter
aa33f20993 When using NFSv3, use the remote server's idea of the maximum file size
rather than assuming 2^64.  It may not like files that big. :-)
On the nfs server, calculate and report the max file size as the point
that the block numbers in the cache would turn negative.
(ie: 1099511627775 bytes (1TB)).

One of the things I'm worried about however, is that directory offsets
are really cookies on a NFSv3 server and can be rather large, especially
when/if the server generates the opaque directory cookies by using a local
filesystem offset in what comes out as the upper 32 bits of the 64 bit
cookie.  (a server is free to do this, it could save byte swapping
depending on the native 64 bit byte order)

Obtained from:	NetBSD
1998-05-30 16:33:58 +00:00