Commit Graph

585 Commits

Author SHA1 Message Date
matt 9bd0cc2bb9 Make sure these all agree on the same definitons of various variables. 2002-12-01 23:02:10 +00:00
matt b5e32a190e Don't define VA_EXCLUSIVE if it's not defined. If we do, it'll be a
different value from the one in <sys/vnode.h>
2002-12-01 23:00:51 +00:00
matt b360b734b1 Add multiple inclusion protection. 2002-12-01 22:59:42 +00:00
lukem 0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
scw ba1d389688 Fix an uninitialised variable warning. 2002-11-24 11:02:57 +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
yamt 869f4a9733 fix panic introduced by my previous commit.
for device special files, VOP_UNLOCK is called
by nfs_loadattrcache with v_data == 0.

reported and tested by Matthias Drochner.
2002-10-22 10:10:28 +00:00
simonb 7a4056e25c "nmp" in nfs_lookup() is set but not used, remove it. 2002-10-22 02:19:57 +00:00
yamt 005c29fafb fix a page locking deadlock problem for nfs.
add a flag that specify if the file can be truncated safely or not
to nfsm_loadattr and friends.  when it isn't safe, just mark the nfsnode
as "should be truncated later".

ok'ed by Frank van der Linden and Chuck Silvers.
close kern/18036.
2002-10-21 12:52:32 +00:00
enami 7409653fdf When printing filesystem specific parameters, also print the address and
port of server numerically.
2002-10-21 03:58:07 +00:00
thorpej ae19c3c263 nfs_remove(): Don't vput() the vnode twice if vp == dvp, vrele() and
vput() instead.
2002-10-18 19:08:15 +00:00
christos 1fafdc0bf2 forgot to set deadthresh; thanks to YAMAMOTO Takashi. 2002-10-01 15:00:04 +00:00
christos 7b0d38f045 back out previous. the problem is not the v_mount is null, but it appears
corrupted.
2002-10-01 14:59:21 +00:00
christos da8db7611e deal with v_mount == NULL in nfs_reclaim(). We should not be touching this
anyway, but nq-nfs wants us to.
2002-09-30 20:55:55 +00:00
bouyer c7b51b5566 In nfs_commit(), sanity-check what we get from network: if we try to fluch
past end of file, or if off + cnt overflows a quad_t, flush to end of file.
2002-09-27 19:30:46 +00:00
provos 0f09ed48a5 remove trailing \n in panic(). approved perry. 2002-09-27 15:35:29 +00:00
bouyer 992abe6e5b In nfsrv_create(), kill an extra PNBUF_PUT() in the NFSv2 mknod case. The
pnbuf has already been freed by VOP_MKNOD. This should have been removed in
rev 1.60.
Should fix PR 18013, OK'd by fvdl.
2002-09-26 20:41:25 +00:00
bouyer 7005ca7253 nfsrv_commit(): Properly handle the case cnt == 0, which means "flush to
end of file". Calling VOP_FSYNC with start == end triggers a DIAGNOSTIC
check. Noticed with NFSv3 Linux clients. OK'd by fvdl.
2002-09-26 20:38:04 +00:00
jdolecek ea3e4c9a2a <sys/conf.h> and <sys/device.h> are not needed here 2002-09-22 19:35:22 +00:00
jdolecek eb337a8a22 don't seem to need <sys/conf.h> or <net/if.h> here 2002-09-22 19:15:09 +00:00
christos 6868d0a7d6 MNT_GETARGS support 2002-09-21 18:08:27 +00:00
chs 73e5c26ec7 pick up a fix from openbsd:
revision 1.33
    date: 2002/07/24 23:32:11;  author: nordin;  state: Exp;  lines: +3 -3
    Use sizeof(array) instead of sizeof(array *) for bcopy length. ok deraadt@
2002-09-14 21:45:16 +00:00
bouyer 3a7aeb79ca nfs_doio(): handle the case where nfs_writerpc() returned error != 0.
Fix kern/18125. OK'd by thorpej and chs.
2002-09-01 10:39:38 +00:00
enami 691598efd0 s/FREE/PNBUF_PUT/ 2002-08-23 05:38:51 +00:00
fvdl 316b8f10e7 Initialize recm to NULL inside the loop, so that a record length of
NULL will not accidentallly append bogus data (the previous record).

Derived from a fix by Matt Dillon in FreeBSD.
2002-08-02 00:09:33 +00:00
soren 178d83d503 Die, qaddr_t, die! - mnt_data in struct mount is already effectively
a void *, so stop pretending otherwise.
2002-07-30 07:40:07 +00:00
enami 5f5918e1e7 Synchronize code and comment again to prevent mbuf leak. Sprinkle some
KNF while I'm here.
2002-07-26 01:36:30 +00:00
jdolecek 413ebb2a10 Reduce stack usage on the NFS mount code path. This fixes kernel stack
overflow when using IPsec on vax, as reported by Olaf Seibert on
current-users@.
2002-07-25 19:03:27 +00:00
drochner 92ade669c9 increase IP TTL for BOOTP/DHCP request packets to avoid dumb
routers dropping the packet
(seems to be a problem with Cisco and its "helper-address" feature;
a Cabletron SSR I tested with didn't have this problem)
2002-06-10 17:45:54 +00:00
tls 92f8323be6 Fix client-side lockmgr: locking against myself panic immediately upon an
attempt to NFS-mount a filesystem with the -l (use ReaddirPlus RPC) option.

Fix from Bill Sommerfeld.
2002-05-19 20:51:04 +00:00
matt caf4b56c6f Eliminate commons 2002-05-12 23:04:35 +00:00
simonb 8cb3bbd37c In bootpcheck(), make sure we m_pullup() all the of bootp header that we
actually examine.
While here, toss out home-grown ofs() macro and use offsetof().
2002-05-12 12:52:58 +00:00
enami 59a79c7928 Remove wrong assertion in previous commit. 2002-05-06 03:20:54 +00:00
enami cfa571e2e2 The per nfsnode n_commitlock is a sleep lock, but we can't sleep if
PGO_LOCKED getpages request.  So, just make the lock fail and tell
the caller that there is no pages available if we can't acquire it.
The caller will call us again soon without PGO_LOCKED.  Reviewed by chuq.
2002-05-06 00:07:51 +00:00
thorpej 37dc008ca3 Cleanup how file system configuration information is declared, grouping
related information together, with the file system code itself.

This is just low-hanging fruit -- more to come.
2002-04-16 23:14:05 +00:00
chs a5838679d1 only use UBC_FAULTBUSY to access offsets past EOF,
otherwise we can deadlock trying to busy the same page in uiomove().
2002-04-10 03:06:57 +00:00
wrstuden a36c34f662 In the SETATTR code, if the changes to a & m time are exclusively
set via NFSV3SATTRTIME_TOSERVER and not NFSV3SATTRTIME_TOCLIENT,
add VA_UTIMES_NULL to the va_vflags. This reflects our policy
where we're much more liberal about who can set a & m times to 'now'
than we are about who can set them to a specific time.

Should close PR 15597 from Martin Husemann. Patch is based on the
one Matthias Drochner gave in the PR.
2002-04-03 00:20:15 +00:00
chs f80ed5892c remove PGO_WEAK, it isn't needed anymore. 2002-03-25 02:08:09 +00:00
chs 20a94bdf2d only do v3 stuff for v3 filesystems. 2002-03-23 05:00:57 +00:00
thorpej df292ba439 Add a NetBSD Vendor Class Identifier option as proposed on tech-net in
message <20020216172527.C23901@dr-evil.shagadelic.org>.
2002-03-20 23:07:37 +00:00
christos 14eaffb49d use the exithook mechanism to remove the exiting process from the list
of processes to be signalled in a soft mount.
2002-03-17 22:22:39 +00:00
chs b4b7853b08 make sure that if NMODIFIED is clear, all pages attached to the vnode are
clean and without writable mappings.  if we try to flush dirty pages past
EOF to the server when NMODIFIED is clear, we'll update the attrcache before
doing the write, which will try to free the pages past EOF and deadlock.
to deal with this, we write-protect pages before we send them to the server,
and restrict ourselves to creating read-only mappings if NMODIFIED isn't set.
score another one for enami.
2002-03-16 23:05:25 +00:00
jdolecek 86835ed7d1 Cosmetic change for nfs_enterdircache() - since 'blkno' is last arg,
define it's type last, too.
Noted in kern/14742 by John Franklin.
2002-03-11 22:56:47 +00:00
jdolecek 934735396a nfs_enterdircache() had last two parameter types swapped
Noted in kern/14742 by John Franklin.
2002-03-11 22:55:05 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
fvdl a16656fe06 Invalidate the access cache when loading a new set of attributes into
the atribute cache. Fixes access cache problem seen by
Nathan Funk of the UofS, relayed by Greg Oster.
2002-02-28 21:38:08 +00:00
lukem 1119bfe6ea nfs_connect(): if NFSMNT_RESVPORT is set, set IP_PORTRANGE_LOW on the socket
rather than using home-grown code to find a free reserved socket.
this also results in nfs pcb's having the INP_ANONPORT and INP_LOWPORT flags
set, which is useful for netstat(1) to know.
2002-02-27 03:46:36 +00:00
chs 8a910799bb use curproc instead of b_proc for NFS. that's what we want for sync commits
and it doesn't cause any problems for async commits.
2002-01-31 05:56:57 +00:00
chs 2a8b52def1 re-enable NFSv3 commit RPCs by abandoning my new approach in favor of
frank's scheme, with one new twist:  don't wait until we've totally run
out of free pages before committing, but instead notice when we've built
up a largish range of uncommitted pages and commit only the older half of
the range, which is likely to already be on disk on the server.
2002-01-26 02:52:19 +00:00