Commit Graph

139373 Commits

Author SHA1 Message Date
alc
933221c70b 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.

Submitted by: Tijl Coosemans
PR: 118510
MFC after: 6 weeks
2008-05-24 21:57:16 +00:00
rodrigc
4e4b0a667c Fix comments to replace SBSIZE with SBLOCKSIZE, since SBSIZE
was renamed to SBLOCKSIZE in version 1.33

Reviewed by:	mckusick
2008-05-24 20:44:14 +00:00
bz
0683a5dd33 Remove 'fasttrap' module for amd64 for now as the code is not there
in sys/cddl/dev/fasttrap.
2008-05-24 19:52:19 +00:00
bz
439c12d3f0 Remove redundant redeclaration of 'zone_drain'. 2008-05-24 19:30:38 +00:00
bz
91ff240d1e 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.

Suggested by:	attilio [1]
Reviewed by:	attilio
2008-05-24 19:29:02 +00:00
ed
c7242d199f Change my email address to the one from the FreeBSD project.
Approved by:	philip (mentor)
2008-05-24 18:35:55 +00:00
bz
db8afa9bc3 In addition to the ipsec_osdep.h removal a week ago, now also eliminate
IPSEC_SPLASSERT_SOFTNET which has been 'unused' since FreeBSD 5.0.
2008-05-24 15:32:46 +00:00
bz
f3ab94f7b4 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
2008-05-24 15:20:48 +00:00
lulf
0bf5a314d8 - 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.

Tested by:	pho
Reviewed by:	kib (mentor)
Approved by:	kib (mentor)
2008-05-24 14:51:30 +00:00
gonzo
197cf7b9ba Add myself to the calendar
Approved by:	cognet (mentor)
2008-05-24 11:10:46 +00:00
nyan
b94b3707da MFi386: revision 1.249
Add a cyclic hook for DTrace.
2008-05-24 09:07:52 +00:00
manolis
792d40b14c Add myself to calendar.freebsd
This will also help me not forget my own birthday :)

Approved by: gabor (mentor)
2008-05-24 08:54:00 +00:00
manolis
c2c68fca18 Add myself to commiters-doc.dot
Approved by: gabor (mentor)
2008-05-24 08:49:55 +00:00
jb
c35410fc27 Make the zfs module depend on the opensolaris module in preparation for it
to shared stuff with the DTrace modules.
2008-05-24 06:43:55 +00:00
jb
3c417aadf3 Add the DTrace hooks for exception handling (Function boundary trace
-fbt- provider), cyclic clock and syscalls.
2008-05-24 06:32:26 +00:00
jb
5ca78c67db Add a cyclic hook for DTrace. 2008-05-24 06:27:54 +00:00
jb
afeacbb0ca Add the DTrace hooks for exception handling (Function boundary trace
-fbt- provider), cyclic clock and syscalls.
2008-05-24 06:27:02 +00:00
jb
c4443570b6 Add DTrace 'proc' provider probes using the Statically Defined Trace
(sdt) mechanism.
2008-05-24 06:22:16 +00:00
mckusick
e0c188cb54 Expand dump to allow MAX_INT dump levels.
PR:           bin/100732
Submitted by: Matthew Vincenz <msvincen@midway.uchicago.edu>
2008-05-24 05:20:46 +00:00
jb
fbc7e633a8 Leave out a couple of DTrace modules for now. 2008-05-24 04:36:07 +00:00
rodrigc
c1896c3fec 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
2008-05-24 00:41:32 +00:00
rodrigc
44e2059da2 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

async -> MNT_ASYNC
force -> MNT_FORCE
multilabel -> MNT_MULTILABEL
noatime -> MNT_NOATIME
noclusterr -> MNT_NOCLUSTERR
noclusterw -> MNT_NOCLUSTERW

MFC after:  1 month
2008-05-24 00:02:12 +00:00
rodrigc
a9cd468083 Do not convert the "snapshot" string to the MNT_SNAPSHOT flag here, since
we do it further down in ffs_vfsops.c

MFC after:	1 month
2008-05-23 23:33:07 +00:00
mckusick
af9e967365 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>
2008-05-23 23:13:14 +00:00
jb
a2e581e4c7 Messing with the endian defines breaks the use of other FreeBSD headers. 2008-05-23 23:03:17 +00:00
jb
b96c45bfb8 Don't need to include vmem.h anymore. 2008-05-23 22:44:46 +00:00
jb
9fb08e48b3 Delete a couple of OpenSolaris headers which get in the way of our
implementation.
2008-05-23 22:40:58 +00:00
jb
48cebe5b1a OpenSolaris kernel module compatibility sources. 2008-05-23 22:39:28 +00:00
jb
805703972c Hook the DTrace kernel modules into the build. 2008-05-23 22:36:12 +00:00
jb
db91f2dd98 The cyclic code is in sys/cddl/dev/cyclic to be consistent with
the other stuff.
2008-05-23 22:23:28 +00:00
jb
a1fed4f2cd 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.
2008-05-23 22:21:58 +00:00
jb
19fffc811f Add the KDTRACE_HOOKS option for DTrace support. 2008-05-23 22:17:28 +00:00
marcel
431e157a7b Account for IPI_PREEMPT. We don't want to call sched_preempt() with
interrupts disabled or with td_intr_nesting_level non-zero.
2008-05-23 19:53:50 +00:00
mckusick
4fec854134 Fix nits pointed out in PR bin/39905 that have not already been
corrected since it was filed. With this change the PR will be closed.

PR:     bin/39905
2008-05-23 19:17:08 +00:00
marcel
b606eaa9b7 Invalidate the TLB in pmap_cpu_bootstrap(), so that it also happens
on the APs.
2008-05-23 19:16:24 +00:00
ed
65dd14e2b5 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 :-(
2008-05-23 18:34:33 +00:00
kib
797c3188c0 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
2008-05-23 16:47:55 +00:00
kib
90775e30db 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
2008-05-23 16:46:27 +00:00
kib
a0dac34fa6 Use the t_state for the TS_GONE test.
Submitted by:   jhb
MFC after:	3 days
2008-05-23 16:43:59 +00:00
kib
c1c2996ed2 Assert that si_threadcount > 0 before decrementing it. This helps catching
the improper use of the dev_refthread/dev_relthread.

Tested by:	pho
MFC after:	1 week
2008-05-23 16:38:38 +00:00
kib
ad73989e21 When vget() fails (because the vnode has been reclaimed), there is no
sense to loop trying to vget() the vnode again.

PR:	122977
Submitted by:	Arthur Hartwig <arthur.hartwig nokia com>
Tested by:	pho
Reviewed by:	jhb
MFC after:	1 week
2008-05-23 16:36:39 +00:00
ed
bdc5be605f 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.

Approved by:	philip (mentor)
2008-05-23 16:06:35 +00:00
ed
82e712d5ed 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).

Approved by:	philip (mentor)
2008-05-23 14:24:33 +00:00
kib
bb95365b8c 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
2008-05-23 11:14:03 +00:00
kib
c106911b42 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
2008-05-23 11:09:50 +00:00
jb
82ed3e6d66 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.
2008-05-23 07:35:36 +00:00
jb
5b8646dc24 Change the alignment of the NOTE to match what gcc does. 2008-05-23 07:33:45 +00:00
jb
1fbc3c9d60 Add the case for SHT_AMD64_UNWIND. 2008-05-23 07:32:19 +00:00
jb
6a077c58b8 Add the ctf_get function and update the args to linker_file_function_listall. 2008-05-23 07:08:59 +00:00
jb
be12e1a504 Custom DTrace kernel module files plus FreeBSD-specific DTrace providers. 2008-05-23 05:59:42 +00:00