Commit Graph

139409 Commits

Author SHA1 Message Date
Alan Cox
ba3042115f 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
Craig Rodrigues
8e7a2353ec 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
Bjoern A. Zeeb
835f1f1216 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
Bjoern A. Zeeb
079d3bfcfb Remove redundant redeclaration of 'zone_drain'. 2008-05-24 19:30:38 +00:00
Bjoern A. Zeeb
b319692931 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 Schouten
166eef7229 Change my email address to the one from the FreeBSD project.
Approved by:	philip (mentor)
2008-05-24 18:35:55 +00:00
Bjoern A. Zeeb
eaa9325f48 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
Bjoern A. Zeeb
9a38ba8101 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
Ulf Lilleengen
60af8a6a7a - 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
Oleksandr Tymoshenko
7ccfef9e4a Add myself to the calendar
Approved by:	cognet (mentor)
2008-05-24 11:10:46 +00:00
Yoshihiro Takahashi
6f73422ac9 MFi386: revision 1.249
Add a cyclic hook for DTrace.
2008-05-24 09:07:52 +00:00
Manolis Kiagias
4970de14a5 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 Kiagias
9f567cef74 Add myself to commiters-doc.dot
Approved by: gabor (mentor)
2008-05-24 08:49:55 +00:00
John Birrell
8fc6245976 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
John Birrell
367f3ce5e6 Add the DTrace hooks for exception handling (Function boundary trace
-fbt- provider), cyclic clock and syscalls.
2008-05-24 06:32:26 +00:00
John Birrell
f1bd3c150c Add a cyclic hook for DTrace. 2008-05-24 06:27:54 +00:00
John Birrell
15653bada1 Add the DTrace hooks for exception handling (Function boundary trace
-fbt- provider), cyclic clock and syscalls.
2008-05-24 06:27:02 +00:00
John Birrell
5d217f173c Add DTrace 'proc' provider probes using the Statically Defined Trace
(sdt) mechanism.
2008-05-24 06:22:16 +00:00
Kirk McKusick
f72ab79315 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
John Birrell
3a3f8cb443 Leave out a couple of DTrace modules for now. 2008-05-24 04:36:07 +00:00
Craig Rodrigues
fb77e0af12 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
Craig Rodrigues
02a871f1ea 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
Craig Rodrigues
a9722ace80 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
Kirk McKusick
693c40a39a 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
John Birrell
25f292128c Messing with the endian defines breaks the use of other FreeBSD headers. 2008-05-23 23:03:17 +00:00
John Birrell
aa06238273 Don't need to include vmem.h anymore. 2008-05-23 22:44:46 +00:00
John Birrell
fd930d81d8 Delete a couple of OpenSolaris headers which get in the way of our
implementation.
2008-05-23 22:40:58 +00:00
John Birrell
8599306711 OpenSolaris kernel module compatibility sources. 2008-05-23 22:39:28 +00:00
John Birrell
adab6548de Hook the DTrace kernel modules into the build. 2008-05-23 22:36:12 +00:00
John Birrell
2c2491dd98 The cyclic code is in sys/cddl/dev/cyclic to be consistent with
the other stuff.
2008-05-23 22:23:28 +00:00
John Birrell
5a3c3bfaa3 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
John Birrell
597c90a27e Add the KDTRACE_HOOKS option for DTrace support. 2008-05-23 22:17:28 +00:00
Marcel Moolenaar
2cddc3d722 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
Kirk McKusick
a73665b028 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 Moolenaar
86c1fb4cde Invalidate the TLB in pmap_cpu_bootstrap(), so that it also happens
on the APs.
2008-05-23 19:16:24 +00:00
Ed Schouten
4bd31dd151 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
Konstantin Belousov
15822fcdbe 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
Konstantin Belousov
cc57af357b 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
Konstantin Belousov
ca091c56e3 Use the t_state for the TS_GONE test.
Submitted by:   jhb
MFC after:	3 days
2008-05-23 16:43:59 +00:00
Konstantin Belousov
06fe11294d 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
Konstantin Belousov
772e245341 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 Schouten
8837b0dd09 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 Schouten
81590c5b37 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
Konstantin Belousov
741b6cf8a5 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
Konstantin Belousov
e2e1693f15 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
John Birrell
9445f413ee 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
John Birrell
7d15d0a9c6 Change the alignment of the NOTE to match what gcc does. 2008-05-23 07:33:45 +00:00
John Birrell
c4607eb7ad Add the case for SHT_AMD64_UNWIND. 2008-05-23 07:32:19 +00:00
John Birrell
4b3d60930a Add the ctf_get function and update the args to linker_file_function_listall. 2008-05-23 07:08:59 +00:00
John Birrell
91eaf3e183 Custom DTrace kernel module files plus FreeBSD-specific DTrace providers. 2008-05-23 05:59:42 +00:00