imp [Fri, 5 Aug 2005 04:56:14 +0000 (04:56 +0000)]
When the MAC address is reported all zeros, then error is necessarily
0. This means that we 'succeed' the attach, even after we've freed
the internal data bits. This leads to a panic when you eject the card
with this problem.
jhb [Thu, 4 Aug 2005 14:39:47 +0000 (14:39 +0000)]
Initialize the if_addr mutex in if_alloc() rather than waiting until
if_attach(). This allows ethernet drivers to use it in their routines
to program their MAC filters before ether_ifattach() is called (de(4) is
one such driver). Also, the if_addr mutex is destroyed in if_free()
rather than if_detach(), so there was another potential bug in that a
driver that failed during attach and called if_free() without having
called ether_ifattach() would have tried to destroy an uninitialized mutex.
Reported by: Holm Tiffe holm at freibergnet dot de
Discussed with: rwatson
rwatson [Thu, 4 Aug 2005 10:06:39 +0000 (10:06 +0000)]
Define LIBMEMSTAT so that vm_page.h won't perform a nested include of
opt_vmpage.h.
Remove definition of _KERNEL, it is no longer required in order to
include uma_int.h, as the sensitive parts of uma_int.h (a number of
inlines depending on kernel-only constants) are now protected by
_KERNEL.
dds [Thu, 4 Aug 2005 10:05:12 +0000 (10:05 +0000)]
Bug fix: a numeric flag specification in the substitute command would
cause the next substitute flag to be ignored.
While working at it, detect and report overflows.
rwatson [Thu, 4 Aug 2005 10:05:11 +0000 (10:05 +0000)]
Don't perform a nested include of opt_vmpage.h if LIBMEMSTAT is defined,
as opt_vmpage.h will not be available to user space library builds. A
similar existing check is present for KLD_MODULE for similar reasons.
rwatson [Thu, 4 Aug 2005 10:03:53 +0000 (10:03 +0000)]
Wrap inlines in uma_int.h in #ifdef _KERNEL so that uma_int.h can be
used from memstat_uma.c for the purposes of kvm access without lots
of additional unsafe includes.
iedowse [Thu, 4 Aug 2005 02:21:37 +0000 (02:21 +0000)]
Fix two bugs that interacted to cause page faults in softclock()
when using mice containing a tilt movement: there was a missing
usb_callout_init() for the UMS_SPUR_BUT_UP quirk code, and UMS_T
was defined to the same flag value as UMS_SPUR_BUT_UP.
rwatson [Wed, 3 Aug 2005 19:29:47 +0000 (19:29 +0000)]
Introduce in_multi_mtx, which will protect IPv4-layer multicast address
lists, as well as accessor macros. For now, this is a recursive mutex
due code sequences where IPv4 multicast calls into IGMP calls into
ip_output(), which then tests for a multicast forwarding case.
For support macros in in_var.h to check multicast address lists, assert
that in_multi_mtx is held.
Acquire in_multi_mtx around iteration over the IPv4 multicast address
lists, such as in ip_input() and ip_output().
Acquire in_multi_mtx when manipulating the IPv4 layer multicast addresses,
as well as over the manipulation of ifnet multicast address lists in order
to keep the two layers in sync.
Lock down accesses to IPv4 multicast addresses in IGMP, or assert the
lock when performing IGMP join/leave events.
Eliminate spl's associated with IPv4 multicast addresses, portions of
IGMP that weren't previously expunged by IGMP locking.
Add in_multi_mtx, igmp_mtx, and if_addr_mtx lock order to hard-coded
lock order in WITNESS, in that order.
Problem reported by: Ed Maste <emaste at phaedrus dot sandvine dot ca>
MFC after: 10 days
gibbs [Wed, 3 Aug 2005 14:08:41 +0000 (14:08 +0000)]
Correct attribution in clause three to address the correct copyright
holders. The license that was approved for my changes to this driver
originally came from LSI, but the changes to the driver core are not
owned by LSI.
jeff [Wed, 3 Aug 2005 05:02:08 +0000 (05:02 +0000)]
- Use lockmgr_printinfo rather than rolling our own. This introduces a
slight problem by using printf instead of db_printf however
'show lockedvnods' does the same so I believe it is ok for now.
jeff [Wed, 3 Aug 2005 04:59:07 +0000 (04:59 +0000)]
- Fix a problem that slipped through review; the stack member of the lockmgr
structure should have the lk_ prefix.
- Add stack_print(lkp->lk_stack) to the information printed with
lockmgr_printinfo().
jeff [Wed, 3 Aug 2005 04:48:22 +0000 (04:48 +0000)]
- Replace the series of DEBUG_LOCKS hacks which tried to save the vn_lock
caller by saving the stack of the last locker/unlocker in lockmgr. We
also put the stack in KTR at the moment.
Contributed by: Antoine Brodin <antoine.brodin@laposte.net>
davidxu [Wed, 3 Aug 2005 01:23:45 +0000 (01:23 +0000)]
In adjustrunqueue(), add code to handle thread migrating case for
ULE scheduler. In original code, local run queue of threaded ksegrp
is corrupted if adjustrunqueue() is called while thread is migrating.
rwatson [Wed, 3 Aug 2005 00:18:35 +0000 (00:18 +0000)]
Modify device drivers supporting multicast addresses to lock if_addr_mtx
over iteration of their multicast address lists when synchronizing the
hardware address filter with the network stack-maintained list.
Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca>
MFC after: 1 week
rwatson [Tue, 2 Aug 2005 23:23:26 +0000 (23:23 +0000)]
Protect link layer network interface multicast address list manipulation
using ifp->if_addr_mtx:
- Initialize if_addr_mtx when ifnet is initialized.
- Destroy if_addr_mtx when ifnet is torn down.
- Rename ifmaof_ifpforaddr() to if_findmulti(); assert if_addr_mtx.
Staticize.
- Extract ifmultiaddr allocation and initialization into if_allocmulti();
accept a 'mflags' argument to indicate whether or not sleeping is
permitted. This centralizes error handling and address duplication.
- Extract ifmultiaddr tear-down and deallocation in if_freemulti().
- Re-structure if_addmulti() to hold if_addr_mtx around manipulation of
the ifnet multicast address list and reference count manipulation.
Make use of non-sleeping allocations. Annotate the fact that we only
generate routing socket events for explicit address addition, not
implicit link layer address addition.
- Re-structure if_delmulti() to hold if_addr_mtx around manipulation of
the ifnet multicast address list and reference count manipulation.
Annotate the lack of a routing socket event for implicit link layer
address removal.
- De-spl all and sundry.
Problem reported by: Ed Maste <emaste at phaedrus dot sandvine dot ca>
MFC after: 1 week
rwatson [Tue, 2 Aug 2005 17:52:52 +0000 (17:52 +0000)]
When allocating link layer ifnet address list entries in
ifp->if_resolvemulti(), do so with M_NOWAIT rather than M_WAITOK, so
that a mutex can be held over the call. In the FDDI code, add a
missing M_ZERO. Consumers are already aware that if_resolvemulti()
can fail.
rwatson [Tue, 2 Aug 2005 17:43:35 +0000 (17:43 +0000)]
Add if_addr_mtx to struct ifnet, a mutex to protect ifnet-related address
lists. Add accessor macros.
This changes the size of struct ifnet, but ideally, all ifnet consumers
are now using if_alloc() to allocate these structures rather than
embedding them into device driver softc's, so this won't modify the
network device driver ABI.
Add missing ether_poll_deregister(). This is still not enough to
kldunload/kldload without a panic. The same (but worse) problem
is also present in ixgb(4).
kientzle [Tue, 2 Aug 2005 03:17:57 +0000 (03:17 +0000)]
Generate default fake "device" and "inode" numbers for entries
extracted from tar archives. Otherwise, converting tar archives to
cpio format (with "bsdtar -cf out.cpio @in.tar") convert every entry
into a hard link to a single file. This simple logic breaks hard
links, but that's better than the alternative.
kientzle [Tue, 2 Aug 2005 03:13:42 +0000 (03:13 +0000)]
When copying time values from the main entry header to be used in the
header of the pax extension entry, clip them to ustar limits. In particular,
this prevents an internal panic for very old files.
kientzle [Tue, 2 Aug 2005 03:10:52 +0000 (03:10 +0000)]
Correct a few minor mis-statements (libarchive does support reading
GNU tar sparse files, people have extended cpio) and clarify an
important detail about pax format (that ustar-compliant archivers
can mostly read pax archives correctly).
kientzle [Tue, 2 Aug 2005 03:02:55 +0000 (03:02 +0000)]
The bsdtar_warnc() reporting function requires the program name to be
set up before it is called, so move the progname initialization before
the first possible call to bsdtar_warnc().
Thanks to: Stanislav Sedov
PR: bin/83366
MFC after: 7 days
brooks [Tue, 2 Aug 2005 02:24:47 +0000 (02:24 +0000)]
- Document network_interfaces=auto (the default!).
- Remove documentation of pccard_ifconfig as it is now gone.
- Document pccard_ifconfig's replacement ifconfig_DEFAULT.
rwatson [Mon, 1 Aug 2005 21:33:17 +0000 (21:33 +0000)]
Teach vmstat's domemstat_zone() to use memstat_kvm_uma() when the kvm
descriptor is non-NULL, restoring vmstat -z support for core dumps and
kmem access. These were broken with the introduction of UMA.
rwatson [Mon, 1 Aug 2005 19:07:39 +0000 (19:07 +0000)]
Add memstat_kvm_uma(), an implementation of a libmemstat(3) query routine
that knows how to extract UMA(9) allocator statistics from a core dump or
live memory image using kvm(3). The caller is expected to provide the
necessary kvm_t handle, which is then used by libmemstat(3).
With these changes, it is trivially straight forward to re-introduce
vmstat -z support on core dumps, which was lost when UMA was introduced.
In the short term, this requires including vm/ include files that are not
intended for extra-kernel use, requiring in turn some ugliness.
rwatson [Mon, 1 Aug 2005 13:18:21 +0000 (13:18 +0000)]
Correct two libmemstat(3) bugs:
- Move memory_type_list flushing logic from memstat_mtl_free() to
_memstat_mtl_empty(), a libmemstat-internal function that can
be called from other parts of the library. Invoke
_memstat_mtl_empty() from memstat_mtl_free(), which also frees
the containing list structure.
Invoke _memstat_mtl_empty() instead of memstat_mtl_free() in
various error cases in memstat_malloc.c and memstat_uma.c, which
previously resulted in the list being freed prematurely.
- Reverse the order of updating the mt_kegfree and mt_free fields
of the memory_type in memstat_uma.c, otherwise keg free items
won't be counted properly for non-secondary zones.
phk [Mon, 1 Aug 2005 12:14:53 +0000 (12:14 +0000)]
The Berkeley pascal implementation for the VAX 11/780 has only
historical relevance these days, stow it in the attic instead of
on millions of FreeBSD computers.
Add support for IPv6 over GRE [1]. PR kern/80340 includes the
FreeBSD specific ip_newid() changes NetBSD does not have.
Correct handling of non AF_INET packets passed to bpf [2].
PR: kern/80340[1], NetBSD PRs 29150[1], 30844[2]
Obtained from: NetBSD ip_gre.c rev. 1.34,1.35, if_gre.c rev. 1.56
Submitted by: Gert Doering <gert at greenie.muc.de>[2]
MFC after: 4 days
imp [Mon, 1 Aug 2005 07:03:10 +0000 (07:03 +0000)]
Add pnp and location info for the ISA bus. The pnp info is the
primary vendor id for this device. The location is empty because ISA
doesn't give one a way to generally locate a card. PNP BIOS entries
do provide a way to locate cards, as do isa pnp cards. These
locations will be added as soon as the code to remember them is
written.
Delay freeing disk space for file system blocks until all dirty buffers
are safely released. This fixes softdep problems on truncation (deletion)
of files with dirty buffers.