Matthew Dillon [Sun, 24 Jun 2001 05:24:41 +0000 (05:24 +0000)]
After exhaustive discussions and some meandering and confusion, enough
people are on track with the cause and effect of this, and although
fixing this severely degenerate case appears to violate the letter of
POSIX.1-200x, Bruce and I (and enough others) agree that it should be
comitted.
So, this patch generates an ENOENT error for any attempt to do a path lookup
through an empty symlink (e.g. open(), stat()).
Submitted by: "Andrey A. Chernov" <ache@nagual.pp.ru>
Reviewed by: bde
Discussed exhaustively on: freebsd-current
Previously committed to: NetBSD 4 years ago
Ian Dowse [Sat, 23 Jun 2001 21:54:47 +0000 (21:54 +0000)]
Fix some return-value brain-damage in forward_register(). This
function has a return type of u_int32_t, into which it was somehow
supposed to encode:
* A valid 32-bit XID (which could be any value including 0).
* 0, meaning a duplicate request.
* -1, meaning a malloc failed (!);
We now ensure that all XIDs are non-zero, and pass the XID out via
a pointer argument.
In forward_find() and free_slot_by_xid(), remove an unnecessary
and confusing test for a negative result from an unsigned modulo
operation, but add an unnecessary cast to highlight why.
Ian Dowse [Sat, 23 Jun 2001 19:57:20 +0000 (19:57 +0000)]
Use the new CLSET_CONNECT clnt_control() request on UDP clients to
ensure that we never proceed with the mount() syscall if the server
is replying from the wrong source address. Previously the userland
RPC call to the remote nfsd would succeed, but the kernel uses
connect() so it would not see the replies, resulting in a hung
mount.
Ian Dowse [Sat, 23 Jun 2001 19:43:21 +0000 (19:43 +0000)]
Add a new clnt_control() request `CLSET_CONNECT' that controls
whether or not connect(2) is used for UDP client sockets. The default
is not to connect(), so existing clients will see no change in
behaviour.
The use of connect(2) for UDP clients has a number of advantages:
only replies from the intended address are received, and ICMP errors
pertaining to the connection are reported back to the application.
Reduce field width for some columns so that the default output fits in <= 79
columns. 80 columns + newline is a problem for some terminals including syscons.
Jonathan Lemon [Sat, 23 Jun 2001 06:54:28 +0000 (06:54 +0000)]
Bring in fix from rev 1.32 that got lost during the conversion to kqueue.
This prevents an indefinte timeout in case the kevent call is interrupted
for some reason.
Make the similar changes as in our keyinfo, i.e. allow user to get his own
sequence and allow root to get everybody's one. Before this change user
can't get his own sequence, root required.
Mike Silbersack [Sat, 23 Jun 2001 03:21:46 +0000 (03:21 +0000)]
Eliminate the allocation of a tcp template structure for each
connection. The information contained in a tcptemp can be
reconstructed from a tcpcb when needed.
Previously, tcp templates required the allocation of one
mbuf per connection. On large systems, this change should
free up a large number of mbufs.
Brooks Davis [Fri, 22 Jun 2001 23:35:24 +0000 (23:35 +0000)]
Fix a number of bugs in the implementation of the WEP related status
functions in ifconfig. "ifconfig an0" should output the correct
status now. Also, make the read and write functions both more
robust and more consistant. This should stop most of the incorrect
size complaints and eliminate the possiability of panics from firmware
that increases resource sizes.
John Baldwin [Fri, 22 Jun 2001 23:11:26 +0000 (23:11 +0000)]
- Lock CURSIG() with the proc lock to close the signal race with psignal.
- Grab Giant around ktrace points.
- Clean up KTR_PROC tracepoints to not display the value of
sched_lock.mtx_lock as it isn't really needed anymore and just obfuscates
the messages.
- Add a few if conditions to replace gotos.
- Ensure that every msleep KTR event ends up with a matching msleep resume
KTR event (this was broken when we didn't do a mi_switch()).
- Only note via ktrace that we resumed from a switch once rather than twice
in several places in msleep().
- Remove spl's rom asleep and await as the proc lock and sched_lock provide
all the needed locking.
- In mawait() add in a needed ktrace point for noting that we are about to
switch out.
John Baldwin [Fri, 22 Jun 2001 23:05:11 +0000 (23:05 +0000)]
- Grab the proc lock around CURSIG and postsig(). Don't release the proc
lock until after grabbing the sched_lock to avoid CURSIG racing with
psignal.
- Don't grab Giant for addupc_task() as it isn't needed.
Reported by: tegge (signal race), bde (addupc_task a while back)
John Baldwin [Fri, 22 Jun 2001 23:02:37 +0000 (23:02 +0000)]
- Change CURSIG() and postsig() to require that the proc lock is held
rather than grabbing it and releasing it themselves. This allows callers
of these functions to get the lock to close race conditions.
- Grab Giant around ktrace in postsig.
- Count the switches performed on SIGSTOP's as involuntary context switches
in the resource usage stats.
Dima Dorfman [Fri, 22 Jun 2001 21:47:55 +0000 (21:47 +0000)]
Increase the buffer sizes for the build deps, run deps, and the line
itself verbatim from INDEX. This fixes seg. faults with newer INDEX
files which have some gnome ports with outrageously long run deps.
David E. O'Brien [Fri, 22 Jun 2001 21:43:51 +0000 (21:43 +0000)]
Quiet compiler warnings by making `WARNS 2' clean.
Submitted by: Mike Barcroft <mike@q9media.com>
Set maintainer to myself. This needs to stay in sync with what Buntils
does, and it would be best to pass functionality changes thru me to make
sure future plans are taken into account.
John Baldwin [Fri, 22 Jun 2001 21:12:19 +0000 (21:12 +0000)]
- Protect all accesses to nsw_[rw]count{,_{,a}sync} with the pbuf mutex.
- Don't drop the vm mutex while grabbing the pbuf mutex to manipulate
said variables.
Jim Pirzyk [Fri, 22 Jun 2001 16:03:14 +0000 (16:03 +0000)]
changed hostid from long to unsigned long to be able to store values > 2GB
on i386 platforms. Also changed SYSCTL type from INT to ULONG and removed
comment about it.
Ruslan Ermilov [Fri, 22 Jun 2001 06:41:16 +0000 (06:41 +0000)]
- Fixed bogon in rev. 1.14 (dates are separated by a tab).
- Sort people that have the same birthday by a year.
- Added some missing data (R.O.C. for Taiwan, Australia for peter,
Englang -> United Kingdom).
- Fixed bogon in rev. 1.1 (INITCAP() was not worth doing).
- Regenerate (from the Oracle database).
Bosko Milekic [Fri, 22 Jun 2001 06:35:32 +0000 (06:35 +0000)]
Introduce numerous SMP friendly changes to the mbuf allocator. Namely,
introduce a modified allocation mechanism for mbufs and mbuf clusters; one
which can scale under SMP and which offers the possibility of resource
reclamation to be implemented in the future. Notable advantages:
o Reduce contention for SMP by offering per-CPU pools and locks.
o Better use of data cache due to per-CPU pools.
o Much less code cache pollution due to excessively large allocation macros.
o Framework for `grouping' objects from same page together so as to be able
to possibly free wired-down pages back to the system if they are no longer
needed by the network stacks.
Additional things changed with this addition:
- Moved some mbuf specific declarations and initializations from
sys/conf/param.c into mbuf-specific code where they belong.
- m_getclr() has been renamed to m_get_clrd() because the old name is really
confusing. m_getclr() HAS been preserved though and is defined to the new
name. No tree sweep has been done "to change the interface," as the old
name will continue to be supported and is not depracated. The change was
merely done because m_getclr() sounds too much like "m_get a cluster."
- TEMPORARILY disabled mbtypes statistics displaying in netstat(1) and
systat(1) (see TODO below).
- Fixed systat(1) to display number of "free mbufs" based on new per-CPU
stat structures.
- Fixed netstat(1) to display new per-CPU stats based on sysctl-exported
per-CPU stat structures. All infos are fetched via sysctl.
TODO (in order of priority):
- Re-enable mbtypes statistics in both netstat(1) and systat(1) after
introducing an SMP friendly way to collect the mbtypes stats under the
already introduced per-CPU locks (i.e. hopefully don't use atomic() - it
seems too costly for a mere stat update, especially when other locks are
already present).
- Optionally have systat(1) display not only "total free mbufs" but also
"total free mbufs per CPU pool."
- Fix minor length-fetching issues in netstat(1) related to recently
re-enabled option to read mbuf stats from a core file.
- Move reference counters at least for mbuf clusters into an unused portion
of the cluster itself, to save space and need to allocate a counter.
- Look into introducing resource freeing possibly from a kproc.
Reviewed by (in parts): jlemon, jake, silby, terry
Tested by: jlemon (Intel & Alpha), mjacob (Intel & Alpha)
Preliminary performance measurements: jlemon (and me, obviously)
URL: http://people.freebsd.org/~bmilekic/mb_alloc/
Warner Losh [Fri, 22 Jun 2001 04:50:11 +0000 (04:50 +0000)]
More updates
# Note, I managed to fat finger some mail commands and lost who submitted some
# of these entries. If it was you, email me and I'll for a commit to
# give proper credit.
Ian Dowse [Fri, 22 Jun 2001 00:41:20 +0000 (00:41 +0000)]
Make it much more obvious that the use of NQNFS is discouraged (the
NQNFS code is ancient, bug-ridden, and should probably be removed).
The wording here was very confusing; it was easy to get the impression
that NQNFS is an extension to NFSv3 when in fact it just uses some
NFSv3-like extensions on top of NFSv2. As witnessed by the mailing
lists and PRs, some people were reading the description and deciding
that NQNFS was what they wanted to use.
Matt Jacob [Fri, 22 Jun 2001 00:23:02 +0000 (00:23 +0000)]
Okay, I'll go along with the gag.... Interesting- I'm quite startled
to note that of the people added so far, one has the same birthdate as me
(April Fool's Day), and that only two other folks are older than I am.