Joerg Sonnenberger [Wed, 1 Dec 2004 04:14:08 +0000 (04:14 +0000)]
Merge from vendor branch NTPD:
Force commited to annotate missing log message.
Sync with OpenBSD. Most of the local changes have been merged back.
This fixes an important problem with the DNS lookup, which made ntpd
almost impossible to kill.
Joerg Sonnenberger [Wed, 1 Dec 2004 04:14:08 +0000 (04:14 +0000)]
Force commited to annotate missing log message.
Sync with OpenBSD. Most of the local changes have been merged back.
This fixes an important problem with the DNS lookup, which made ntpd
almost impossible to kill.
Joerg Sonnenberger [Wed, 1 Dec 2004 04:14:08 +0000 (04:14 +0000)]
Force commited to annotate missing log message.
Sync with OpenBSD. Most of the local changes have been merged back.
This fixes an important problem with the DNS lookup, which made ntpd
almost impossible to kill.
Joerg Sonnenberger [Wed, 1 Dec 2004 04:09:27 +0000 (04:09 +0000)]
Merge from vendor branch NTPD:
*** empty log message ***
Joerg Sonnenberger [Wed, 1 Dec 2004 04:09:27 +0000 (04:09 +0000)]
*** empty log message ***
Joerg Sonnenberger [Wed, 1 Dec 2004 04:09:27 +0000 (04:09 +0000)]
*** empty log message ***
Joerg Sonnenberger [Wed, 1 Dec 2004 02:02:14 +0000 (02:02 +0000)]
job.c:1.52->1.53
job.h:1.22->1.23
main.c:1.92->1.93
Author: harti
Log:
Remove the remote stuff from make. This actually never worked in our make
because the necessary files were not imported with the original import.
If somebody really needs it, there is still the devel/pmake port.
This is just the first step and removes just everything that is ifdef'ed out.
Otherwise the code is unchanged.
Checked by: md5
Approved by: no objections on arch@
config.h:1.12->1.13
job.c:1.53->1.54
job.h:1.23->1.24
Author: harti
Log:
Now with the remote job support removed there can be no remote jobs and
no jobs that need to be remigrated. Remove the flags and the associated
code.
config.h:1.13->1.14
main.c:1.93->1.94
Author: phk
Log:
Get rid of now unused maxLocal variables.
job.c:1.54->1.55
job.h:1.24->1.25
main.c:1.94->1.95
Author: phk
Log:
Get rid of more local/remote leftovers
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Joerg Sonnenberger [Wed, 1 Dec 2004 01:31:52 +0000 (01:31 +0000)]
make.1: 1.77->1.78
Author: harti
Log:
Make explicit that MAKEOBJDIRPREFIX and MAKOBJDIR must be set
as environment variables and should not be set on make's command
line. They happen to work accidentially as command line variables
too when none of the sub-makes wants to play games with them (because
make is putting command line variables into the environment and will
find them there later on). Makefile.inc1 wants to change
MAKEOBJDIRPREFIX. In this case one cannot set it on the command line.
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Joerg Sonnenberger [Wed, 1 Dec 2004 01:29:31 +0000 (01:29 +0000)]
Makefile: 1.32->1.33
main.c: 1.90->1.91
nonints.h: 1.22->1.23
var.c: 1.47->1.48
Author: harti
Log:
Put variable assignments on .MAKEFLAGS and .MFLAGS targets into
the .MAKEFLAGS variable so that these are also passed to sub-makes.
This makes the handling of variables in the command environment more
consistent.
PR: bin/68853
Submitted by: Martin Kamerhofer <data@sbox.tugraz.at>
make.1:1.78->1.79
Author: ru
Log:
Document the effects of modifying the .MAKEFLAGS internal
variable and using the .MAKEFLAGS special target, and the
differences between them.
Reviewed by: harti
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Slightly adjust the change Var_Quote to not cast away a const.
Joerg Sonnenberger [Wed, 1 Dec 2004 01:10:17 +0000 (01:10 +0000)]
Makefile: 1.31->1.32
main.c: 1.89->1.90
nonints.h: 1.21->1.22
var.c: 1.46->1.47
Author: harti
Log:
Put variable assignments from the command line into the MAKEFLAGS
variable as required by POSIX. This causes such variables to be
pushed into all sub-makes called by the make (except when the MAKEFLAGS
variable is explicitely changed in the sub-make's environment).
This makes them also mostly un-overrideable in sub-makes except on the
sub-make's command line. Therefor specifying 'make CC=icc' will cause
icc to be used as C compiler in all sub-makes no matter what the Makefiles
itself try to do to the CC variable.
This patch also corrects the handling of the MFLAGS variable. MFLAGS
contains all the command line flags but not the command line variable
assignments. The evaluation of the .MFLAGS or .MAKEFLAGS target now
changes both MFLAGS and MAKEFLAGS (they used to change MAKEFLAGS only).
Makefiles can use MFLAGS for their own purposes given that they do not
except MFLAGS to be undefined at the beginning and that they don't evaluate
.MFLAGS or .MAKEFLAGS. MFLAGS should be removed for POSIX compliance,
but it is unfortunately heavily used by the X makefiles.
This has been extensively tested by port builds (thanks to portmgr), new
worlds and kernels.
PR: standards/57295 (1st part above)
Submitted by: James E. Flemer <jflemer@alum.rpi.edu>
Approved by: portmgr
Obtained from: NetBSD (1st part above)
MFC after: 4 weeks
make.1: 1.75->1.76
Author: harti
Log:
Correct the description of the MFLAGS and .MAKEFLAGS variables. Add
the MFLAGS target. Document that variable assignments from the MAKEFLAGS
environment variable and the .MAKEFLAGS and .MFLAGS target have the
same precedence as command line variable assignments.
make.1: 1.76->1.77
Author: harti
Log:
Correct the .Dd date. Pluralize 'assignment' in one place.
Requested by: ru
Joerg Sonnenberger [Tue, 30 Nov 2004 20:12:21 +0000 (20:12 +0000)]
Switch a strncpy into a strlcpy. I'm not sure why this triggers propolice,
the use seems to be correct.
Joerg Sonnenberger [Tue, 30 Nov 2004 19:21:26 +0000 (19:21 +0000)]
Remove struct ipprotosw. It's identical to protosw, so use the generic
version directly.
Joerg Sonnenberger [Tue, 30 Nov 2004 19:17:08 +0000 (19:17 +0000)]
Don't include stddef.h from the kernel.
Joerg Sonnenberger [Tue, 30 Nov 2004 19:12:57 +0000 (19:12 +0000)]
Makefile:1.30->1.31
compat.c:1.36->1.37
job.c:1.49->1.50
Author: harti
Log:
Implement POSIX's '+' flag for command lines. This flag causes a line
to be executed even when -n is given on the command line to make. This is
very handy for calls to submakes.
This is slightly changed from the original patch as obtained from NetBSD.
The NetBSD variant prints lines which have both '+' and '@' when -n
is specified. The commited version always obeys '@'.
Bump MAKE_VERSION so Makefiles can use this conditionally.
PR: standards/66357 (partly)
Submitted by: Mark Baushke <mdb@juniper.net>
Obtained from: NetBSD
make.1:1.74->1.75
Author: harti
Log:
Bump the date in .Dd for the recent '+' flag commit.
Requested by: ru
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Matthew Dillon [Tue, 30 Nov 2004 18:59:52 +0000 (18:59 +0000)]
Fix a bug in ESTALE handling for NFS. If we get ESTALE in vn_open() we
want to retry the operation, but if we cannot re-resolve the namespace
(i.e. the file is really gone) we were incorrectly calling vput(vp) where
vp might have been NULL.
Reported-by: David Rhodus <sdrhodus@gmail.com>
Joerg Sonnenberger [Tue, 30 Nov 2004 18:18:06 +0000 (18:18 +0000)]
make.1: 1.67->1.68
Author: ru
Log:
Markup nits.
make.1: 1.70->1.71
Author: ru
Log:
Mechanically kill hard sentence breaks.
make.1: 1.71->1.72
Author: keramida
Log:
Remove the dependency of the :C/regexp/replacement/ variable modifier
from the :S modifier which follows a bit further below. This way the
reader can read each of these two descriptions without having to jump
back and forth in the manpage.
PR: docs/26943
Submitted by: Alex Kapranoff <alex@kapran.bitmcnit.bryansk.su>
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Joerg Sonnenberger [Tue, 30 Nov 2004 17:58:41 +0000 (17:58 +0000)]
parse.c: 1.53->1.54
Author: ru
Log:
Added the new .warning directive.
Submitted by: Cyrille Lefevre
make.1: 1.66->1.67
Author: ru
Log:
Document the new .warning directive.
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Joerg Sonnenberger [Tue, 30 Nov 2004 17:39:41 +0000 (17:39 +0000)]
job.h: 1.20->1.21
Author: scottl
Log:
Change the select timeout from 100ms to 2 seconds now that SIGCHILD is
handled.
parse.c: 1.51->1.52
Author: ru
Log:
Make it possible to ``.undef ${VAR}'' (expanding VAR to get
the variable name to undef).
Submitted by: Cyrille Lefevre
parse.c: 1.50->1.51
Author: ru
Log:
Fixed line numbering inside the .for loops.
Submitted by: Cyrille Lefevre
for.c:1.20->1.21
nonints.h:1.19->1.20
parse.c:1.52->1.53
Author: ru
Log:
Reworked the fix to print the useful line number on error in
the .for loop:
- Replaced four global variables in parse.c with one.
- Made Parse_FromString() accept the "lineno" as an argument.
- Fixed line numbering when there are escaped newlines in the
body of the .for loop.
Adopted from: NetBSD
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Joerg Sonnenberger [Tue, 30 Nov 2004 16:02:21 +0000 (16:02 +0000)]
Fix a bug that leads to a crash when binat rules of the form
'binat from ... to ... -> (if)' are used, where the interface
is dynamic. reported by kos(at)bastard(dot)net, analyzed by
Pyun YongHyeon
Obtained-from: OpenBSD
Joerg Sonnenberger [Tue, 30 Nov 2004 15:52:57 +0000 (15:52 +0000)]
dir.c: 1.31->1.32
Author: ru
Log:
Fix a bug that prevented exists() from finding "foo/", "foo/."
and "foo/.." when ".PATH: foo" was also given.
PR: bin/34062
Members:
dir.c:1.31->1.32
compat.c: 1.35->1.36
main.c: 1.84->1.85
Author: ru
Log:
Make the -q option DTRT in the compat mode.
PR: 48210
var.c: 1.43->1.44
Author: ru
Log:
Fix a bug in variable parsing code that could cause a segfault.
PR: bin/46203
Submitted by: Stefan Farfeleder <stefan@fafoe.dyndns.org>
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Joerg Sonnenberger [Tue, 30 Nov 2004 15:22:46 +0000 (15:22 +0000)]
author: ru
Log:
- Cut out the code that caches the "." directory out of Dir_Init()
into a separate function, Dir_InitDot().
- Postpone the current and object directories detection (and caching
of the "." directory) until after all command line arguments are
parsed. This makes the -C option DTRT.
PR: bin/47149
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Joerg Sonnenberger [Tue, 30 Nov 2004 15:04:56 +0000 (15:04 +0000)]
main.c: 1.81->1.82
Author: imp
Log:
No need to check to see if we're running a version of FreeBSD 3.0 current or
newer anymore.
cond.c: 1.26->1.27
Author: imp
Log:
Keep up with minor changes to NetBSD. Consider a variable empty when
not define.
Obtained From: NetBSD (rev 1.18; sjg)
for.c: 1.19->1.20
Author: ru
Log:
Command line variables take precedence over global variables.
Make this true in the .for loops too. The following fragment,
FOO= foo bar
all:
.for f in ${FOO}
@echo ${f}
.endfor
when run as "make FOO=xxx" should print "xxx". (OpenBSD had
this bug fixed for some time.)
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Joerg Sonnenberger [Tue, 30 Nov 2004 14:48:58 +0000 (14:48 +0000)]
Set DFPORTSDIR. It will be used by "make index" soon.
Joerg Sonnenberger [Tue, 30 Nov 2004 14:27:25 +0000 (14:27 +0000)]
Convert some broken cases where Error is called, but we try to continue,
to Fatal errors, because the logic that we use to try to continue is far
too broken, and makes things look and act weird, because we end up pointing
past the end of a buffer boundry into freed memory in the caller, as we
don't come close to setting the lengthPtr to a sane value.
Reviewed by: make@
(This only changes failure cases which would have died horrid deaths to
explicit clean death failure cases.)
Obtained-from: FreeBSD
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Liam J. Foy [Mon, 29 Nov 2004 21:45:00 +0000 (21:45 +0000)]
- Constify most of the function
- Static functions
- Fix some data types
Liam J. Foy [Mon, 29 Nov 2004 20:27:30 +0000 (20:27 +0000)]
- Sync with FreeBSD
- Remove unneeded variable (Pflag)
- Only call chflags on directories once
- Static functions
- Remove main proto
- Minor cleans
Joerg Sonnenberger [Sun, 28 Nov 2004 22:29:19 +0000 (22:29 +0000)]
Allow "make index" to actually by fixing lots of smaller glitches all over
the (dfports) tree.
- PORTSDIR must be kept for bsd.port.pre.mk, because it is used to include
e.g. bsd.python.mk
- The DFPORTS_WARNING change didn't work as intended and neither did the
old version. We want be quiet about redirections if we have any of the
special targets to process (like describe), which does include the
output of the cd command. We also want to define the .BEGIN rule only
once. This is now protected by the better named _DFPORTS_REDIRECT
- Define another bunch of variables, normally provided by bsd.port.mk.
This should fix the mysterious warnings encountered.
Liam J. Foy [Sun, 28 Nov 2004 21:17:07 +0000 (21:17 +0000)]
- Fix setmode. Setmode can fail due to malloc. We should print the correct
error message if malloc does fail and not print incorrect file mode.
Liam J. Foy [Sun, 28 Nov 2004 20:20:42 +0000 (20:20 +0000)]
More cleans
- Remove registers
- Static functions
- Make WARNS 6 clean
- Add $DragonFly$ tag to Makefile
Joerg Sonnenberger [Sun, 28 Nov 2004 16:51:50 +0000 (16:51 +0000)]
Cover the verbosity code in {}, otherwise the newline is printed everytime.
Noticed-by: Sascha Wildner <saw@online.de>
Liam J. Foy [Sun, 28 Nov 2004 16:38:21 +0000 (16:38 +0000)]
- Remove unnecessary casts
- Bump WARNS upto 6
Joerg Sonnenberger [Sun, 28 Nov 2004 15:40:43 +0000 (15:40 +0000)]
Missing return-value check for malloc.
Noticed-by: Santtu Hyrkkö <santtu.hyrkko@gmail.com>
Joerg Sonnenberger [Sat, 27 Nov 2004 17:54:10 +0000 (17:54 +0000)]
Reorganise the nlist handling a bit, use an enum instead of preprocessor
defines.
Idea-from: FreeBSD.
Remove all the symbols which don't exist in our kernel anymore. Fix the
entry for SI (si__tty instead of si_tty).
Joerg Sonnenberger [Sat, 27 Nov 2004 13:22:26 +0000 (13:22 +0000)]
Fix a stupid fault in the last condition. The code should be skipped, if
the variable DFPORTS_WARNING is already defined, not the other way around.
Joerg Sonnenberger [Fri, 26 Nov 2004 14:47:04 +0000 (14:47 +0000)]
Remove some !FreeBSD compat code, which produces warnings on DragonFly.
Joerg Sonnenberger [Fri, 26 Nov 2004 14:06:57 +0000 (14:06 +0000)]
Don't define the .BEGIN with the override message twice for modules
using bsd.port.pre.mk / bsd.port.post.mk.
Pointed-out-by: YONETANI Tomokazu <qhwt+dfly@les.ath.cx>
Liam J. Foy [Thu, 25 Nov 2004 19:45:30 +0000 (19:45 +0000)]
- Add new -vv option. If the -v flag is specified more than once,
chown will print the filename, followed by the old and new numeric
user/group ID. (Obtained from FreeBSD with my modifications)
- Static functions and globals
- Remove global hflag
- Fix some casts
- Make WARNS?= 6 clean
- Add WARNS?= 6
- Constify id()
- Remove '?' case
- Update chown.8 for the addition of +vv
Ok'ed: Joerg@
Joerg Sonnenberger [Thu, 25 Nov 2004 01:20:33 +0000 (01:20 +0000)]
Fix warnings about yyerror, yylex and yy_unput
Joerg Sonnenberger [Thu, 25 Nov 2004 01:01:33 +0000 (01:01 +0000)]
Fix parameters for comparision function.
Joerg Sonnenberger [Wed, 24 Nov 2004 22:51:01 +0000 (22:51 +0000)]
Add the basic of libkcore. Switch pstat to use kcore/kinfo backing,
defaulting to kcore for now.
Joerg Sonnenberger [Wed, 24 Nov 2004 12:49:27 +0000 (12:49 +0000)]
Comment out extra tokens after #else and #endif.
Joerg Sonnenberger [Wed, 24 Nov 2004 10:20:45 +0000 (10:20 +0000)]
Change the include order of archive_string.h and archive_prviate.h.
The original order doesn't play well with the patching framework,
because the C preprocessor looks into the source directory first
for #include "".
Matthew Dillon [Wed, 24 Nov 2004 08:37:16 +0000 (08:37 +0000)]
Cleanup some ESTALE issues on the client when files are replaced on
an NFS server. Even though the attribute cache has expired DragonFly
still maintains a vnode in the namecache. If a file is replaced on the
server the vnode's file handle will become invalid.
Force re-resolution of the namecache entry rather then replacing the vnode's
file handle, so programs with open descriptors to the dead file continue to
get a proper error return while lookups succeed in finding the new version
of the file.
In this patch ESTALE is checked in strategic places: stat(), access(), and
open(). It is an imperfect solution at the moment but it seems to work pretty
well. This should bring NFS client operations back up to FreeBSD-4.x
standards.
Matthew Dillon [Wed, 24 Nov 2004 07:24:17 +0000 (07:24 +0000)]
o Give make(1) the ability to use KQUEUE to wait for worker
processes instead of polling for them.
o Bootstrapping aid from pre-kqueue(2) systems, e.g.
4.0-RELEASE.
o Treat kevent(2) returning an error EINTR as the non-error
it is.
Note: the KQUEUE feature is disabled in FreeBSD and in DragonFly.
Submitted-by: Max Okumoto <okumoto@home>
Taken-from: FreeBSD
Matthew Dillon [Wed, 24 Nov 2004 07:20:51 +0000 (07:20 +0000)]
o Fix proto type
o Mention that the left-hand side of the comparison conditional
must always be a variable expansion. Do not lie that
debugging .for loops is a no-op.
o Update tutorial.
o Update man page.
o Fixed the abuses of .Ql visible on stderr in troff mode.
o Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Taken-from: FreeBSD
Matthew Dillon [Wed, 24 Nov 2004 07:19:14 +0000 (07:19 +0000)]
o Pacify ``make -f /dev/null -V FOO''.
o Add empty default cases where they should be, remove
non-local execution stuff in compat.c which doesn't even
have preprocessor-conditional-hidden support code, and
add a debugging statement where we might end up with a
nil list somehow, but where I doubt it.
o Makeing make(1) WARNS=6 cleanup
o In lieu of a good way to prevent every possible looping
in make(1), stop there from being more than 500 processes
forked by make(1), to prevent a forkbomb from happening,
in a dumb and mechanical way.
o Some ANSI changes that we missed
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Taken-from: FreeBSD
Matthew Dillon [Wed, 24 Nov 2004 07:15:46 +0000 (07:15 +0000)]
o Print a warning when we are given two scripts for one target.
This is neither as wide-reaching nor intensive as NetBSD's
similar, but the warning uses the same text.
o Remove local prototypes for main().
o Don't declare things as extern when they will be static.
o When formatting the time for a target, use %H instead of %k,
which is mostly the same, but uses a non-extension option.
o Document the parsing bug.
o Fix spurious three-space indentation in a four-space indentation
file.
o Remove 6-years-stale #if0, the behaviour isn't ever going to
be limited to compatible mode, as far as I know, since we use
it...
o Code that has been #if0'd with the comment "WHY" since revision
1.1 can disappear.
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Taken-from: FreeBSD (as with the previous patches)
Matthew Dillon [Wed, 24 Nov 2004 07:11:33 +0000 (07:11 +0000)]
patch-4.10: Clean some includes and remove ifdef __STDC__, -Wall cleanup,
unifdef -D__STDC__, Sort #includes, remove <sys/types.h> (made redundant
by <sys/param.h>), add <signal.h> (needed for sigaction()),
Unbreak compilation on RELENG_4.
Submitted-by: Max Okumoto <okumoto@ucsd.edu>
Hiten Pandya [Wed, 24 Nov 2004 02:56:43 +0000 (02:56 +0000)]
Add a SECURITY section which describes the kern.ckptgroup sysctl among
other things.
While I am here, cleanup the manual page:
- correct mdoc(7)
- restructure some sentences for readability
- add reference to signal(3) under SEE ALSO
Matthew Dillon [Tue, 23 Nov 2004 20:04:10 +0000 (20:04 +0000)]
Remove the checkpoint module. checkpointing is now integrated into the kernel
via kern/kern_checkpoint.c (same code as checkpt.c and support.c just
migrated to a new file).
Matthew Dillon [Tue, 23 Nov 2004 20:03:40 +0000 (20:03 +0000)]
Remove checkpt/ from Makefile.modules. checkpt is not integrated into the
kernel as kern/kern_checkpoint.c
Eirik Nygaard [Tue, 23 Nov 2004 19:05:53 +0000 (19:05 +0000)]
It is sys_checkpoint.2 not checkpoint.2
Submitted by: Michal Belczyk <diavul@bsd.krakow.pl> and
Michael Neumann <mneumann@ntecs.de>
Liam J. Foy [Tue, 23 Nov 2004 16:34:34 +0000 (16:34 +0000)]
- Add newgrp(1) into the build
Liam J. Foy [Tue, 23 Nov 2004 16:26:04 +0000 (16:26 +0000)]
- Import newgrp(1) from FreeBSD
- Add WARNS?= 6
Ok'ed by: Joerg
Matthew Dillon [Tue, 23 Nov 2004 07:36:33 +0000 (07:36 +0000)]
Add the sys_checkpoint(2) manual page and expand checkpt(1).
sys_checkpoint(2) is our checkpoint system call interface. It is capable
of checkpointing and checkpoint-restoring programs with certain restrictions.
Matthew Dillon [Tue, 23 Nov 2004 06:32:39 +0000 (06:32 +0000)]
There is enough demand for Kip Macy's checkpointing code to warrent
permanent integration into the kernel. Add a fixed system call,
sys_checkpoint(2), to support the checkpt(1) utility as well as user
programs which want to install their own signal handler (SIGCKPT).
Hiten Pandya [Tue, 23 Nov 2004 05:25:10 +0000 (05:25 +0000)]
Test Commit
Matthew Dillon [Tue, 23 Nov 2004 04:05:36 +0000 (04:05 +0000)]
Document the mandatory use of vget() prior to modifying vnode/inode ops.
Matthew Dillon [Tue, 23 Nov 2004 04:03:26 +0000 (04:03 +0000)]
Fix a bug in chown, chmod, and chflags. When the setfflags(), setffown(),
and setfmode() API was cleaned up to not remove vrefs maintained by the
caller it resulted in an incorrect vref+vn_lock combination which fails
to clear the VINACTIVE bit on the vnode. vget() clears this bit as part of
its work. This prevented the filesystem from synchronizing the changes
out to the inode unless other modifications were made to the file as well,
which resulted in weird errors such as ./MAKEDEV all creating /dev/null with
perms 600 (the chmod it does afterwords doesn't always take effect), and
other things.
Additional thanks to walt for providing the information that led to the
diagnosis.
Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>,
walt <wa1ter@myrealbox.com>,
Andreas Hauser <andy@splashground.de>
Hiten Pandya [Tue, 23 Nov 2004 02:20:40 +0000 (02:20 +0000)]
Correct spelling.
Matthew Dillon [Mon, 22 Nov 2004 06:50:12 +0000 (06:50 +0000)]
Fix the PRI field to not display bogus process priorities for pure
threads. Add TDPRI (-o tdpri) to display the actual thread priority
and critical section count.
Matthew Dillon [Mon, 22 Nov 2004 00:53:54 +0000 (00:53 +0000)]
The fp argument to vn_open() is optional but the code wasn't treating it
that way entirely.
Matthew Dillon [Mon, 22 Nov 2004 00:46:14 +0000 (00:46 +0000)]
Add support for adjusting the interrupt throttling rate via
hw.emX.int_throttle_ceil, and change the default from 8000hz
to 10000hz to improve throughput with default TCP window sizes
through a GiGE switch in a LAN environment.
Note the following test results using iperf between two machines:
* Shuttle Athlon 64 3200+ box, EM card in 32 bit PCI slot
* 2 machines connected through a GiGE switch
* All other hw.em0 delays set to 0 on both sides
* throttle settings set on both sides
* -w option set on iperf client AND server for 63.5KB window
* software interrupt throttling has been turned off for these tests
throttle result result
freq (32.5KB win) (63.5KB win)
(default)
-------- -------------- -----------
maxrate 481 MBit/s 533 MBit/s (not sure what's going on here)
120000 518 MBit/s 558 MBit/s (not sure what's going on here)
100000 613 MBit/s 667 MBit/s (not sure what's going on here)
70000 679 MBit/s 691 MBit/s
60000 668 MBit/s 694 MBit/s
50000 678 MBit/s 684 MBit/s
40000 694 MBit/s 696 MBit/s
30000 694 MBit/s 696 MBit/s
20000 698 MBit/s 703 MBit/s
10000 707 MBit/s 716 MBit/s
9000 708 MBit/s 716 MBit/s
8000 710 MBit/s 717 MBit/s <--- drop off pt 32.5KB win
7000 683 MBit/s 716 MBit/s
6000 680 MBit/s 720 MBit/s
5000 652 MBit/s 718 MBit/s <--- drop off pt 63.5KB win
4000 555 Mbit/s 695 MBit/s
3000 522 MBit/s 533 MBit/s <--- GiGE throttling likely
2000 449 MBit/s 384 MBit/s (256 ring descriptors =
1000 260 MBit/s 193 MBit/s 2500 hz minimum)
Matthew Dillon [Sun, 21 Nov 2004 19:39:35 +0000 (19:39 +0000)]
Cleanup the 'cache_lock: blocked on..' warning message. Fix a minor
issue that was causing the message to be bogusly displayed when more then
one process was stuck on the lock. Plus add a sysctl, debug.nclockwarn,
which allows the warning timeout to be set (in ticks), default one second.
Reported-by: various.
YONETANI Tomokazu [Sun, 21 Nov 2004 09:07:14 +0000 (09:07 +0000)]
lwkt_runnable is declared in <sys/thread2.h>
Matthew Dillon [Sat, 20 Nov 2004 20:50:36 +0000 (20:50 +0000)]
Fix a number of SMP issues.
* Add required pause instructions in code paths that skip running "HLT". This
occurs when e.g. cpu #1 is running code with the BGL while cpu #2's only
runnable thread requires the BGL. cpu #2's LWKT scheduler spins in that
case. Similar situations can occur when the only runnable threads on a
cpu are waiting for a token.
* Add required pause instructions to spin loops. DragonFly has very few spin
locks (e.g. things like com_lock()) but its a good idea anyway to avoid
known livelock issues on Intel cpus.
* Fix a pending interrupt / HLT race. We were not atomically retiring
pending interrupts prior to potentially HLTing the cpu. This could
result in an SMP machine's network locking up until a key is hit on
the console, then magically resuming.
Lockups-reported-by: Peter Avalos <pavalos@theshell.com>
Matthew Dillon [Sat, 20 Nov 2004 20:35:33 +0000 (20:35 +0000)]
sendfile() was seriously broken. It was calling vm_page_free() without
busying the underlying page, causing a panic on kernels compiled with
INVARIANTS and potentially corrupting data on kernels compiles without
INVARIANTS. Change the calls to vm_page_try_to_free().
Symtoms: system crash when Apache2 tries to use sendfile() to send large files.
Reported-by: Jedi/Sector One <j@pureftpd.org>
Matthew Dillon [Sat, 20 Nov 2004 20:25:13 +0000 (20:25 +0000)]
Add code to the BIOS VM86 emulator to detect writes to the 8254. If a
write is detected the 8254 is reset after the bios call returns and the
event is reported. Some bioses, in particular video bioses, uses timer 2
for timing things. We need timer 2 for our master clock.
Remove restoreclocks(). This was causing gd_cpuclock_base to reverse index
and jump the time ahead an hour with a flurry of hardclock interrupts.
Introduce a new systimer API call, systimer_init_periodic_nq(), which
installs a non-queued periodic systimer. Non-queued means that if multiple
events built-up (due to an 8254 glitch, sleep, or other event), only one
event will be reported.
This should fix the BIOS/8254 glitching, the 'hour jump' problem, and
hopefully other timer jumping issues as well.
Bugs-reported-by: Andreas Hauser <andy@splashground.de>,
Jonathon McKitrick <jcm@FreeBSD-uk.eu.org>,
and others
Matthew Dillon [Sat, 20 Nov 2004 04:14:29 +0000 (04:14 +0000)]
Fix a conditional. sdl was not unconditionally being checked for NULL.
Found-by: Mikhail Teterin <mi+kde@aldan.algebra.com>
Matthew Dillon [Sat, 20 Nov 2004 04:09:34 +0000 (04:09 +0000)]
Give init the ability to chroot to a directory based on kernel environment
variable, 'init_chroot'. This makes building multi-boot DVDs a lot easier.
Submitted-by: Oliver Fromme <olli@haluter.fromme.com>
w/ minor cleanups by Matt
Eirik Nygaard [Fri, 19 Nov 2004 19:01:52 +0000 (19:01 +0000)]
Make the code WARNS= 6 clean.
Liam J. Foy [Fri, 19 Nov 2004 18:35:29 +0000 (18:35 +0000)]
- Add WARNS?= 6
- Make signaled volatile sig_atomic_t
- Static functions
- Fix most of the warns
Liam J. Foy [Fri, 19 Nov 2004 17:46:40 +0000 (17:46 +0000)]
- Add $DragonFly$ tag
- Add WARNS?= 6
- Remove registers
- Static functions
Matthew Dillon [Thu, 18 Nov 2004 20:12:26 +0000 (20:12 +0000)]
Re-enable SACK by default. Jeff fixed the corruption issue reported by
H.Miyamoto and downloads now test good again.
Originally-reported-by: H.Miyamoto (aka "Yuukis"). <Ys@PixyGarden.net>
Additional-reports/testing: H.Miyamoto,
Joerg Sonnenberger <joerg@britannica.bec.de>,
walt <wa1ter@myrealbox.com>
Matthew Dillon [Thu, 18 Nov 2004 20:04:28 +0000 (20:04 +0000)]
Cleanup some dangling issues with cache_inval(). A lot of hard work went
into guarenteeing that the namecache topology would remain connected, but
there were two cases (basically rmdir and rename-over-empty-target-dir)
which disconnected a portion of the hierarchy.
This fixes the remaining cases by having cache_inval() simply mark the
namecache entry as destroyed without actually disconnecting it from the
topology. The flag tells cache_nlookup() and ".." handlers that a node has
been destroyed and is no longer connected to any parent directory.
The new cache_inval() also now has the ability to mark an entire subhierarchy
as being unresolved, which can be a useful feature to have.
In-discussion-with: Richard Nyberg <rnyberg@it.su.se>
Joerg Sonnenberger [Thu, 18 Nov 2004 15:53:40 +0000 (15:53 +0000)]
Replace lvalue cast.
Joerg Sonnenberger [Thu, 18 Nov 2004 14:35:08 +0000 (14:35 +0000)]
Use kinfo_get_vfs_bufspace instead of kvm.
Joerg Sonnenberger [Thu, 18 Nov 2004 14:33:01 +0000 (14:33 +0000)]
Add kinfo_get_vfs_bufspace(). Remove some junk from Makefile.
Joerg Sonnenberger [Thu, 18 Nov 2004 13:57:35 +0000 (13:57 +0000)]
Include Makefile
Joerg Sonnenberger [Thu, 18 Nov 2004 13:56:56 +0000 (13:56 +0000)]
Add a new system library, libkinfo. It is intended to replace libkvm for
most userland tools, which want to deal with a living kernel, not
post-mortem analysation.
Change the kern.file backing from a struct file array to a struct kinfo_file
array. The later is an independent structure, which includes the information
useful for userland. This allows changing the kernel-internals without
having to recompile libkinfo and derived programs. This is inspired by the
changes DES did in FreeBSD 5 (struct xfile).
Partly-obtained-from: FreeBSD (kern_descrip.c changes)
Joerg Sonnenberger [Thu, 18 Nov 2004 13:35:52 +0000 (13:35 +0000)]
Revert a part of the last commit. The changes to use sysctl interface
wasn't meant for the repository and will be superseded by a different
patch.
Matthew Dillon [Thu, 18 Nov 2004 13:09:55 +0000 (13:09 +0000)]
Lots of bug fixes to the checkpointing code. The big fix is that you can
now checkpoint a program that you have checkpoint-restored. i.e. you run
program X, you checkpoint it, you checkpoint-restore X from the checkpoint,
and then you checkpoint it again. The issue here is the when a checkpointed
program is restored the checkpoint file is used to map portions of the image
of the restored program. If you then tried to checkpoint the restored image
the system would overwrite or destroy the original checkpoint file and
the new checkpoint file would have references to the old file (now
non-existant) file. Any attempt to restore the recursed checkpoint would
result in a seg-fault. That is now fixed.
* Remove the previous checkpoint file before saving the new one. If the
program we are checkpointing happens to be a checkpoint restore from the
same file then overwriting the file would wind up corrupting the
image set we are trying to save.
* When checkpointing a program that has been checkpoint-restored do not
attempt to save the file handles for the vnode representing the
checkpoint-restored program's own checkpoint file (which is a good chunk
of its backing store), because this vnode is likely to be destroyed the
moment we close the handle, since we are likely replacing the previous
checkpoint file. Instead, the backing store representing the old
checkpoint file is copied to the new one.
* Re-checkpointing a program (hitting ^E multiple times) now properly
replaces the checkpoint file.
* Properly close any file descriptors from the checkpt(1) program itself
when restoring a checkpointed program, properly replace any file descriptors
that need replacing.
* Properly replace p_comm[] when restoring a checkpoint file, so checkpointing
again saves under the same program name. 'ps' output is still wrong,
though.
TODO LIST:
* Add an iterator to the checkpoint file, accessible via kern.ckptfile,
so successive checkpoints save to a blah.ckpt.1, blah.ckpt.2, etc,
rather then always overwriting blah.ckpt (the iterator could be saved
in the proc structure).
* Add back as a 'feature' the ability for the new checkpoint file to
reference the old one. That is, each new checkpoint file would represent
a delta relative to the old one. This might be useful when checkpointing
programs with ever growing data setse so as not to have to copy the
entire contents of the program to the checkpoint file each time you want
to make a new checkpoint. It would be hell on the VM system, but it
would work.
* Add an option to checkpt(1) so you can checkpoint-restore-enter-gdb all
in one go, to be able to debug a checkpointed file more easily.
Inspired by: Brook Davis's HPC presentation. He expressed an interest in
possibly porting the checkpoint code so I figure I ought to
fix it up.
Joerg Sonnenberger [Thu, 18 Nov 2004 12:54:13 +0000 (12:54 +0000)]
Make pstat WARNS=6 clean.
Joerg Sonnenberger [Thu, 18 Nov 2004 12:38:43 +0000 (12:38 +0000)]
Change the name entry in struct nlist to const char *.
Jeroen Ruigrok/asmodai [Thu, 18 Nov 2004 12:08:01 +0000 (12:08 +0000)]
Merge FreeBSD SA 04:16 security fix.
Submitted by: the kind FreeBSD security officer folks
Matthew Dillon [Thu, 18 Nov 2004 10:01:47 +0000 (10:01 +0000)]
Clear the NOCORE flag on any text mappings that the RTLD modifies due to
text relocations or compacted BSS areas. Otherwise the checkpt code will
not write out the modified areas.
Also note that if you mmap() a file MAP_PRIVATE, then modify portions of it
so the mapping is changed from OBJT_VNODE to OBJT_DEFAULT->OBJT_VNODE,
the current ELF coredump code will *NOT* write out a file handle record for
the backing vnode. This means that the entire vm_map_entry containing
the modified portions must be marked as COREable if it was previously mapped
NOCORE.
In the case of the RTLD code the text area is mapped read-only. The text
area is temporarily remapped read-write for the relocation pass and so
the whole area is still represented by a single vm_map_entry and thus the
whole area must be marked COREable. For the BSS fixup only the last page
is remapped read-write and so it gets its own private vm_map_entry and
thus only the last page must be marked COREable.
The DEFAULT->VNODE backing issue is actually a bug in the elf coredump code,
but even if it were fixed core dump sizes would not get much smaller because
relocations tend to be all over the map.
Checkpt-Nonworking-Bug-Reported-by: Michael Neumann <mneumann@ntecs.de>
Matthew Dillon [Thu, 18 Nov 2004 02:01:44 +0000 (02:01 +0000)]
Bring in various fixes from FreeBSD:
* MAXPATHLEN includes the trailing NUL, Correct array sizes to reflect this.
* Correct NUL termination after strncpy.
* Make ${.OBJDIR} canonical.
* -Wall cleanup.
* unifdef -D__STDC__
* Sort #includes, remove <sys/types.h> (made redundant by <sys/param.h>),
add <signal.h> (needed for sigaction())
* Unbreak compilation on RELENG_4.
* unifdef -UWANT_ENV_PWD. No one ever going to use this bugfeature.
* Reorder #include. Cast arg #2 of lseek to an off_t when constant. No need to
test if failsafe memory allocation fails, it can't. perror -> warn. Use
failsafe memory allocation provided.
* And some other doc cleanup.
* Reduce diffs between FreeBSD and DragonFly Makefile
* Added the MAKE_VERSION global that could be useful in determining
if a given make(1) is feature-compatible with a set of makefiles.
When merged, this will be used to replace the ugly upgrade_checks
hacks in src/Makefile.
Version has the RYYYYMMDDX format, where R is from RELENG_<R> and
X allows for 10 distinguishable changes per day.
* make(I) appeared in PWB UNIX.
* Add MAKE_VERSION variables
* Don't do stupid things to avoid unused parameters, mark them __unused.
* Use %p to print a pointer, not %lx and a cast to (unsigned long). Yuck.
* Avoid classy use of a variable one time with a constant value.
* Bit-width fields should be of type 'int'.
Submitted-by: Max Okumoto <okumoto@home>
Matthew Dillon [Thu, 18 Nov 2004 01:42:26 +0000 (01:42 +0000)]
Do a cleanup pass on the mbuf allocator. Reorder the mmbfree cache tests
to improve the critical path. Use critical sections instead of spls for
protection.
Matthew Dillon [Wed, 17 Nov 2004 23:36:21 +0000 (23:36 +0000)]
Remove unused junk from the slab allocator.
Remove M_FAILSAFE and M_INTALLOC. M_FAILSAFE was a double check for
interrupt-time allocations but using it was problematic at best and as
a consequence it was never used. M_INTALLOC was a macro that used
M_FAILSAFE and was also never used. The standard M_ flags for interrupt
time allocations are M_INTNOWAIT and M_INTWAIT.
Jeffrey Hsu [Wed, 17 Nov 2004 21:50:46 +0000 (21:50 +0000)]
Properly propagate the FIN flag from the following to-be-coalesced segment.
Questionable use of logical AND caught by: Matt Dillon
Joerg Sonnenberger [Wed, 17 Nov 2004 21:04:05 +0000 (21:04 +0000)]
Normally we want to warn if the local IP address is used by a different
host. This isn't useful for 0.0.0.0, because it is used by dhclient
when no address is known.
Jeffrey Hsu [Wed, 17 Nov 2004 20:51:16 +0000 (20:51 +0000)]
Fix bug with wrong length being used when coalescing out-of-order segments.
Matthew Dillon [Wed, 17 Nov 2004 19:16:12 +0000 (19:16 +0000)]
Follow NOFSCHG if defined. (It's needed to be able to run make installworld
in a jail, in FreeBSD 5).
Submitted-by: Suleiman Souhlal <ssouhlal@FreeBSD.org>
Matthew Dillon [Wed, 17 Nov 2004 18:59:21 +0000 (18:59 +0000)]
Cave in and remove NULL checks for M_WAITOK mallocs. DragonFly's M_WAITOK
malloc will panic rather then return NULL, unless M_NULLOK is also specified,
so we don't actually have to check for NULL most of the time.
Submitted-by: Andrew Atrens <atrens@nortelnetworks.com>
Matthew Dillon [Wed, 17 Nov 2004 18:27:17 +0000 (18:27 +0000)]
Fix a bug in the checking of malloc()'s return value. It turns out to have
been masked by the fact that M_WAITOK does not return NULL anyway.
Submitted-by: Andrew Atrens <atrens@nortelnetworks.com>
Joerg Sonnenberger [Wed, 17 Nov 2004 12:27:59 +0000 (12:27 +0000)]
Use the YACC source for c-exp.y and f-exp.y, not the pre-built
BISON parse. This solves the *very* strange build problem with
-jX in buildworld, where make tries to build this files from
source using the default rules. Those rules are not save for
parallel builds.
Joerg Sonnenberger [Wed, 17 Nov 2004 10:09:44 +0000 (10:09 +0000)]
Always use the width field from the varent, not the original width.
This fixes the output of oversized fields messing the overall table
layout.
Reported-by: Peter Avalos <pavalos@theshell.com>
Matthew Dillon [Wed, 17 Nov 2004 02:18:17 +0000 (02:18 +0000)]
Temporarily change the net.inet.tcp.sack default from 1 to 0 after confirmed
reports of file corruption in downloads. This will be changed back to 1
after we figure out and fix the issue.
Corrupted-downloads-reported-by: walt <wa1ter@myrealbox.com>
Joerg Sonnenberger [Tue, 16 Nov 2004 22:21:15 +0000 (22:21 +0000)]
Replace spkrtest script with a shell version.
Obtained-from: FreeBSD
Joerg Sonnenberger [Tue, 16 Nov 2004 22:04:37 +0000 (22:04 +0000)]
Don't install the undocumented scriptdump Perl script.