bz [Mon, 26 May 2008 10:40:09 +0000 (10:40 +0000)]
Remove ISDN4BSD (I4B) from HEAD as it is not MPSAFE and
parts relied on the now removed NET_NEEDS_GIANT.
Most of I4B has been disconnected from the build
since July 2007 in HEAD/RELENG_7.
This is what was removed:
- configuration in /etc/isdn
- examples
- man pages
- kernel configuration
- sys/i4b (drivers, layers, include files)
- user space tools
- i4b support from ppp
- further documentation
delphij [Mon, 26 May 2008 07:40:14 +0000 (07:40 +0000)]
We can not call iwn_start directly in the interrupt
context, where the iwn mutex is being held, and
iwn_start assumes that we do not have that mutex held.
Resolve this issue with what we do for other NICs by
splitting the iwn_start procedure into two parts,
iwn_start() do the locking, and iwn_start_locked()
assumes that the mutex is being held. This resolves
panic when WITNESS is enabled.
rwatson [Sun, 25 May 2008 22:11:40 +0000 (22:11 +0000)]
Remove netatm from HEAD as it is not MPSAFE and relies on the now removed
NET_NEEDS_GIANT. netatm has been disconnected from the build for ten
months in HEAD/RELENG_7. Specifics:
- netatm include files
- netatm command line management tools
- libatm
- ATM parts in rescue and sysinstall
- sample configuration files and documents
- kernel support as a module or in NOTES
- netgraph wrapper nodes for netatm
- ctags data for netatm.
- netatm-specific device drivers.
jb [Sun, 25 May 2008 20:24:07 +0000 (20:24 +0000)]
Comment out the code that breaks with invariants. This is stuff that is
still WIP along with the lockstat provider, so there is no harm leaving
it out for now.
attilio [Sun, 25 May 2008 14:57:43 +0000 (14:57 +0000)]
Replace direct atomic operation for the file refcount witht the
refcount interface.
It also introduces the correct usage of memory barriers, as sometimes
fdrop() and fhold() are used with shared locks, which don't use any
release barrier.
jb [Sun, 25 May 2008 02:48:57 +0000 (02:48 +0000)]
Remove sun4v from the list of arches in 'make universe'. There has been
no active development on it for over a year now and it isn't
reliable under a simple buildworld. Developers can't be expected to
test code targeted for it.
alc [Sat, 24 May 2008 21:57:16 +0000 (21:57 +0000)]
To date, our implementation of munmap(2) has required that the
entirety of the specified range be mapped. Specifically, it has
returned EINVAL if the entire range is not mapped. There is not,
however, any basis for this in either SuSv2 or our own man page.
Moreover, neither Linux nor Solaris impose this requirement. This
revision removes this requirement.
bz [Sat, 24 May 2008 19:29:02 +0000 (19:29 +0000)]
Restore buildable state. Style ignored.
Leave IDTVEC(ill) where it was unless we compile with KDTRACE_HOOKS[1].
Hide the with DTRACE case case under #ifdef KDTRACE_HOOKS.
bz [Sat, 24 May 2008 15:20:48 +0000 (15:20 +0000)]
Factor out the v4-only vs. the v6-only inp_flags processing in
ip6_savecontrol in preparation for udp_append() to no longer
need an WLOCK as we will no longer be modifying socket options.
Requested by: rwatson
Reviewed by: gnn
MFC after: 10 days
lulf [Sat, 24 May 2008 14:51:30 +0000 (14:51 +0000)]
- Add locking to all filesystem operations in fdescfs and flag it as MPSAFE.
- Use proper synhronization primitives to protect the internal fdesc node cache
used in fdescfs.
- Properly initialize and uninitalize hash.
- Remove unused functions.
Since fdescfs might recurse on itself, adding proper locking to it needed some
tricky workarounds in some parts to make it work. For instance, a descriptor in
fdescfs could refer to an open descriptor to itself, thus forcing the thread to
recurse on vnode locks. Because of this, other race conditions also had to be
fixed.
rodrigc [Sat, 24 May 2008 00:41:32 +0000 (00:41 +0000)]
After converting the "snapshot" mount option to the MNT_SNAPSHOT flag,
delete "snapshot" from the persistent mount options list.
This should fix problems with doing a mount -o snapshot of a file system, followed by
an NFS export of the same file system.
PR: 122833
Reported by: Leon Kos <leon.kos lecad fs uni-lj si>,
Jaakko Heinonen <jh saunalahti fi>
MFC after: 1 month
rodrigc [Sat, 24 May 2008 00:02:12 +0000 (00:02 +0000)]
For the following mount options, do not perform the string to flag conversions
here, because we already do them further up in vfs_donmount() in vfs_mount.c
mckusick [Fri, 23 May 2008 23:13:14 +0000 (23:13 +0000)]
When using dump to generate level 0 dumps which are then rsync'ed
to a remote machine, the fact that the dump date is stored with
each header (inode) record makes rsync significantly less efficient
than necessary. This also applies to inode access times when they
are not important data to retain. When implementing an offsite
backup solution of this type, these dates in particular are not
important, especially if it prevents effective offsite backups.
PR: bin/91049
Submitted by: Forrest W Christian <fwc@mt.net>
jb [Fri, 23 May 2008 22:21:58 +0000 (22:21 +0000)]
The cyclic timer device. This is a cut down version of the one in
OpenSolaris. We don't have the lock levels that they do, so this is just
hooked into clock interrupts.
ed [Fri, 23 May 2008 18:34:33 +0000 (18:34 +0000)]
Fix the build by including <sys/param.h> in <sys/clist.h>.
Of course I was silly enough to only check LINT for build failures, but not
the userspace bits. In the mpsafetty branch I didn't notice this, because
<sys/clist.h> never got included in userspace.
Approved by: philip (mentor)
Pointy hat to: me :-(
kib [Fri, 23 May 2008 16:47:55 +0000 (16:47 +0000)]
Rev. 1.274 put the ttyrel() call before the destroy_dev() in the
ttyfree(), freeing the tty. Since destroy_dev() may call d_purge()
cdevsw method, that is the ttypurge() for the tty, the code ends up
accessing freed tty structure.
Put the ttyrel() after destroy_dev() in the ttyfree. To prevent the
panic the rev. 1.274 provided fix for, check the TS_GONE in sysctl
handler and refuse to provide information on such tty.
Reported, debugging help and tested by: pho
DIscussed with and reviewed by: jhb
MFC after: 1 week
kib [Fri, 23 May 2008 16:46:27 +0000 (16:46 +0000)]
The dev_refthread() in the tty_gettp() may fail, because Giant is taken
in the giant_trick routines after the dev_refthread increments the
si_threadcount. Remove assert, do not perform dev_relthread() for failed
dev_refthread(), and handle failure in the tty_gettp() callers (cdevsw
tty methods).
Before kern_conf.c 1.210 and 1.211, the kernel usually paniced in the
giant_trick routines dereferencing NULL cdevsw, not taking this fault.
Reported by: Vince Hoffman <jhary unsane co uk>
Debugging help and tested by: pho
Reviewed by: jhb
MFC after: 1 week
ed [Fri, 23 May 2008 16:06:35 +0000 (16:06 +0000)]
Move TTY unrelated bits out of <sys/tty.h>.
For some reason, the <sys/tty.h> header file also contains routines of the
clists and console that are used inside the TTY layer. Because the clists
are not only used by the TTY layer (example: various input drivers), we'd
better move the entire clist programming interface into <sys/clist.h>. Also
remove a declaration of nonexistent variable.
The <sys/tty.h> header also contains various definitions for the console
code (tty_cons.c). Also move these to <sys/cons.h>, because they are
not implemented inside the TTY layer.
While there, create separate malloc pools for the clist and console code.
ed [Fri, 23 May 2008 14:24:33 +0000 (14:24 +0000)]
Move sysinstall/sade away from TIOCGSIZE.
Both sysinstall and sade still seem to use the TIOCGSIZE ioctl to obtain
the terminal dimensions. We'd better use TIOCGWINSZ to do this. The
TIOCGWINSZ interface is preferred, because it also allows sizes in pixels
to be passed to the application (though this is not used here).
kib [Fri, 23 May 2008 11:14:03 +0000 (11:14 +0000)]
Another problem caused by the knlist_cleardel() potentially dropping
PIPE_MTX().
Since the pipe_present is cleared before (potentially) sleeping, the
second thread may enter the pipeclose() for the reciprocal pipe end.
The test at the end of the pipeclose() for the pipe_present == 0 would
succeed, allowing the second thread to free the pipe memory. First
threads then accesses the freed memory after being woken up.
Properly track the closing state of the pipe in the pipe_present.
Introduce the intermediate state that marks the pipe as mostly
dismantled but might be sleeping waiting for the knote list to be
cleared. Free the pipe pair memory only when both ends pass that point.
Debugging help and tested by: pho
Discussed with: jmg
MFC after: 2 weeks
kib [Fri, 23 May 2008 11:09:50 +0000 (11:09 +0000)]
Destruction of the pipe calls knlist_cleardel() to remove the knotes
monitoring the pipe. The code sets pipe_present = 0 and enters
knlist_cleardel(), where the PIPE_MTX might be dropped when knl->kl_list
cannot be cleared due to influx knotes.
If the following often encountered code fragment
if (!(kn->kn_status & KN_DETACHED))
kn->kn_fop->f_detach(kn);
knote_drop(kn, td); [1]
is executed while the knlist lock is dropped, then the knote memory is freed
by the knote_drop() without knote being removed from the knlist, since
the filt_pipedetach() contains the following:
if (kn->kn_filter == EVFILT_WRITE) {
if (!cpipe->pipe_peer->pipe_present) {
PIPE_UNLOCK(cpipe);
return;
Now, the memory may be reused in the zone, causing the access to the
freed memory. I got the panics caused by the marker knote appearing on
the knlist, that, I believe, manifestation of the issue. In the Peter
Holm test scenarious, we got unkillable processes too.
The pipe_peer that has the knote for write shall be present. Ignore the
pipe_present value for EVFILT_WRITE in filt_pipedetach().
Debugging help and tested by: pho
Discussed with: jmg
MFC after: 2 weeks
jb [Fri, 23 May 2008 07:35:36 +0000 (07:35 +0000)]
Relax the strict type check because gcc as distributed doesn't create
debug strtabs with type SHT_STRTAB. Although we could change FreeBSD's
gcc, we really need to play nicely with gcc as distributed by the FSF.
cperciva [Fri, 23 May 2008 05:07:22 +0000 (05:07 +0000)]
The value le->name cannot be NULL when we're freeing an entry in the
hardlink table for two reasons: 1. If le->name is set to NULL, the
structure le won't be inserted into the table; 2. Even if le somehow
did manage to get into the table with le->name equal to NULL, we would
die when we dereferenced le->null before we could get to the point of
freeing the entry.
Remove the unnecessary "if (le->name != NULL)" test and just free the
pointer.
cperciva [Fri, 23 May 2008 05:01:29 +0000 (05:01 +0000)]
Check that lseek(2) succeeds and puts us where we expect. [1]
While we're here, fix a long-standing bug in the handling of write(2)
errors: The API changed from "return # of bytes written" to "return
status code" almost 4 years ago, so instead of returning (-1) we need
to return ARCHIVE_FATAL.
cperciva [Fri, 23 May 2008 04:57:28 +0000 (04:57 +0000)]
We only use the string "?rwxrwxrwx " once, so inline it rather than
declaring a variable which points to it. Aside from eliminating a
line of code and one level of unnecessary indirection, this eliminates
a false positive in Coverity.
jb [Fri, 23 May 2008 04:20:59 +0000 (04:20 +0000)]
Add a knob to allow just the kernels to be built during a 'make universe'.
This is useful when wanting to retry a broken build using NOCLEAN and the
buildworlds are known to have completed.
jb [Fri, 23 May 2008 03:52:55 +0000 (03:52 +0000)]
Add a kernel option for amd64 to compile with the frame on the stack
so that the DTrace Function Bounadry Trace (fbt) provider can get
coverage of most functions in the kernel.
jb [Fri, 23 May 2008 00:49:39 +0000 (00:49 +0000)]
Add hooks for the Compact C Type Format (CTF) data to be attached to
the elf files. This is complicated by the fact that the actual CTF
parsing has to be done in CDDL'd code, so the BSD licensed code only
knows about the opaque data which it must be able to free.
sam [Thu, 22 May 2008 22:22:10 +0000 (22:22 +0000)]
special-case broadcast probe request in ieee80211_find_rxnode; we need
to spam all vaps and this won't happen if the frame comes from a station
that is associated to an ap vap (and so has an entry in the table)
mckusick [Thu, 22 May 2008 22:19:33 +0000 (22:19 +0000)]
This fixes the "getfile: lost data" panic when restoring dumps
on a 7.0 or later system that were created on a pre-5.0 system.
We must ensure that restore zeros out the previously undefined
birthtime and external attribute size fields when reading dump
tapes made by the UFS1 dump program.
The problem is that UFS2 dump carefully zeros out the unused
birthtime and external attribute size fields in the dump header
when dumping UFS1 filesystems, but the UFS1 dump didn't know about
those fields (they were spares) so just left whatever random junk
was in them. So, when restoring one of these pre-UFS2 dumps,
the new restore would eventually trip across a header that had
a non-zero external attribute size and try to extract it. That
consumed several tape blocks which left it totally out of sync
and very unhappy (i.e., the panic). The fix is in the gethead()
function which modernizes old headers by copying old fields to
their new location (and with this fix) zeroing out previously
undefined fields.
PR: bin/120881
Review by: David Malone & Scott Lambert
MFC after: 1 week
mckusick [Thu, 22 May 2008 22:18:38 +0000 (22:18 +0000)]
Follow on to fix 1.51 for "Header with wrong dumpdate" message.
Must ensure that dump tapes from UFS1 filesystems properly copy
old fields of dump headers to new locations. Move check of dumpdate
to follow the code which ensures that the appropriate fields have
been copied.
PR: bin/118087
Help from: David Malone, Scott Lambert, Javier MartÃn Rueda
MFC after: 2 weeks
ed [Thu, 22 May 2008 14:40:03 +0000 (14:40 +0000)]
Introduce REMOVE_NEXT() macro's for SLIST and STAILQ.
Even though single linked lists allow items to be removed at constant time
(when the previous element is known), the queue macro's don't allow this.
Implement new REMOVE_NEXT() macro's. Because the REMOVE() macro's also
contain the same code, make it call REMOVE_NEXT().
The OpenBSD version of SLIST_REMOVE_NEXT() needs a reference to the list
head, even though it is unused. We'd better mimic this. The STAILQ version
also needs a reference to the list. This means the prototypes of both
macro's are the same.
ed [Thu, 22 May 2008 13:46:41 +0000 (13:46 +0000)]
Add a new group definition to sys/conf.h: GID_TTY.
Our current TTY layer uses a set-uid application called ptchown to
change ownership of a PTY slave device. The new TTY layer implements
this functionality through a new ioctl().
By accident I discovered Darwin's TTY layer also uses this approach.
Because of this, they also have a GID_TTY.