Commit Graph

571 Commits

Author SHA1 Message Date
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
minoura 1dded0f21b Back out the previous.
It was my misreading from the lack of mbuf usage...
Sorry for the mess.
2002-01-22 09:37:59 +00:00
fvdl e4701eef88 VOP_UNLOCK + vgone --> vput, since the vnode will already have
a reference.
2002-01-21 13:48:51 +00:00
minoura a2791dabb9 Correctly write back the updated value of the local variable to the
struct nfssvc_sock.
Affected only when a recordmark of RPC over TCP is fragmented to
multiple mbufs.  I do not know whether this code has ever been executed :)
2002-01-21 13:21:51 +00:00
fvdl 9e4014046f Unlock vnode before calling vgone() in case of getattr failure during
nfs_nget. Fixes problem reported by Chuck Cranor.
2002-01-18 18:59:24 +00:00
chs b4224d4d38 fix locking in nfs_getpages(). 2001-12-31 07:16:47 +00:00
fvdl e3e7b4bd55 Set np->n_size before calling nfs_vinvalbuf, to avoid recursion
and confusion about the actual filesize. From Matt Dillon's
similar change in FreeBSD.

XXX n_size is really redundant in -current and must die. This commit
XXX is more of a placeholder for a pullup into the 1.5 branch.
2001-12-15 00:32:49 +00:00
lukem 290cc55a28 - Implement
uint32_t namei_hash(const char *p, const char **ep)
  which determines the equivalent MI hash32_str() hash for p.
  If *ep != NULL, calculate the hash to the character before ep.
  If *ep == NULL, calculate the has to the first / or NUL found, and
  point *ep to that location.
- Use namei_hash() to calculate cn_hash in lookup() and relookup().
  Hash distribution goes from 35-40% to 55-70%, with similar profiled
  time spent in cache_lookup() and cache_enter() on my P3-600.
- Use namei_hash() to calculate cn_hash in nfs_readdirplusrpc(),
  insetad of homegrown code (that differed from that in lookup() !)
  namei_hash() has better spread and is faster than previous code
  (which used a non-constant multiplication).
2001-12-08 04:09:59 +00:00
lukem 1546835120 Replace nfs_hash() (with its extremely bad hash) with a macro to call
hash32_buf() to obtain a 32 bit hash.  On some tests I ran I obtained
a 30x improvement in hash distribution and a 6x reduction in time spent
in nfs_nget().
2001-12-06 01:26:36 +00:00
lukem 78fd77ad3f don't need nfs_hash prototype here 2001-12-05 23:58:14 +00:00
christos 10b6cdd540 PR/14817: Gregory McGarry: NFS_V2_ONLY doesn't seem to work. 2001-12-04 18:38:08 +00:00
chs 68b5980eb0 call VOP_PUTPAGES() directly instead of indirecting through
the UVM pager op vector.
2001-11-30 07:08:53 +00:00
christos 9caaf10ee6 PR/14776: Emmanuel Dreyfus: cross device hard link causes panic.
Call VOP_ABORTOP on the right vnode damnit!
2001-11-29 22:32:53 +00:00
christos a74164fa6e sprinkle crcvt() 2001-11-29 21:23:13 +00:00
christos b2cfd799a6 use struct uucred in nfsd_svcargs so that we don't break the sys_nfssvc() ABI. 2001-11-29 21:22:50 +00:00