dragonfly.git
19 years agoImport GNU readline 5.0.
Joerg Sonnenberger [Sat, 23 Oct 2004 16:58:53 +0000 (16:58 +0000)]
Import GNU readline 5.0.

Submitted-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
19 years agoImport GNU readline 5.0. vendor/READLINE
Joerg Sonnenberger [Sat, 23 Oct 2004 16:58:53 +0000 (16:58 +0000)]
Import GNU readline 5.0.

Submitted-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
19 years agoFix the references to libz sources scattered over the tree, make them
Joerg Sonnenberger [Sat, 23 Oct 2004 15:58:18 +0000 (15:58 +0000)]
Fix the references to libz sources scattered over the tree, make them
include a Makefile fragment from lib/libz.

19 years agoAdd eui64.5.
Hidetoshi Shimokawa [Sat, 23 Oct 2004 15:36:43 +0000 (15:36 +0000)]
Add eui64.5.

19 years agoWelcome GNU bc to the Attic.
Joerg Sonnenberger [Sat, 23 Oct 2004 14:24:41 +0000 (14:24 +0000)]
Welcome GNU bc to the Attic.

19 years agoI have to specify SCRIPTSNAME too, otherwise bsd.prog.mk strips the extension.
Joerg Sonnenberger [Sat, 23 Oct 2004 14:14:46 +0000 (14:14 +0000)]
I have to specify SCRIPTSNAME too, otherwise bsd.prog.mk strips the extension.

19 years agoUse SCRIPTS instead of a beforeinstall target, it's cleaner.
Joerg Sonnenberger [Sat, 23 Oct 2004 14:07:31 +0000 (14:07 +0000)]
Use SCRIPTS instead of a beforeinstall target, it's cleaner.

19 years agoRemove the GCC 3.3 build system.
Joerg Sonnenberger [Sat, 23 Oct 2004 14:06:08 +0000 (14:06 +0000)]
Remove the GCC 3.3 build system.

19 years agoMerge from vendor branch ZLIB:
Joerg Sonnenberger [Sat, 23 Oct 2004 13:49:54 +0000 (13:49 +0000)]
Merge from vendor branch ZLIB:
Import zlib-1.2.2 using new-style contrib handling.

Important changes since 1.1.4 include:
- New and improved inflate code, which is about 20% faster.
- New and improved crc32(), which is about 50% faster.

19 years agoImport zlib-1.2.2 using new-style contrib handling.
Joerg Sonnenberger [Sat, 23 Oct 2004 13:49:54 +0000 (13:49 +0000)]
Import zlib-1.2.2 using new-style contrib handling.

Important changes since 1.1.4 include:
- New and improved inflate code, which is about 20% faster.
- New and improved crc32(), which is about 50% faster.

19 years agoImport zlib-1.2.2 using new-style contrib handling.
Joerg Sonnenberger [Sat, 23 Oct 2004 13:49:54 +0000 (13:49 +0000)]
Import zlib-1.2.2 using new-style contrib handling.

Important changes since 1.1.4 include:
- New and improved inflate code, which is about 20% faster.
- New and improved crc32(), which is about 50% faster.

19 years agostyle(9) cleanup.
Eirik Nygaard [Sat, 23 Oct 2004 13:33:36 +0000 (13:33 +0000)]
style(9) cleanup.
Submitted by: Ulf Lilleengen <lulf@kerneled.org>

19 years agoGCC 3.4 doesn't check for NULL format-strings for __attribute__((printf))
Joerg Sonnenberger [Sat, 23 Oct 2004 13:10:45 +0000 (13:10 +0000)]
GCC 3.4 doesn't check for NULL format-strings for __attribute__((printf))
by default. Therefore the __printflike macro has to include a nonnull
attribute too, which printf0like doesn't need. This makes the macros
work as expected again.

19 years agoAdd some more functions for -liberty and make the library WARNS=6 clean.
Joerg Sonnenberger [Sat, 23 Oct 2004 12:15:21 +0000 (12:15 +0000)]
Add some more functions for -liberty and make the library WARNS=6 clean.

As replacement of the missing documentation:
- buildargv, freeargv and dupargv help with managing argv lists as NULL
  terminated lists of strings
- hex_p and hex_value help with the detection and evaluation of hex digests,
  they might be replaced by an inline version later
- concat and reconcat can be used to concat an arbitrary number of strings
- xatexit, xexit and xstrerror just call the corresponding normal functions,
  they already provide the GNU functionality
- xcalloc, xmalloc, xmemdup, xrealloc and xstrdup work as expected but
  terminate the program if the memory allocation can not be fullfilled

19 years agoGenerate the BRANCH field from the current tag, use CURRENT if the current
Matthew Dillon [Fri, 22 Oct 2004 23:43:25 +0000 (23:43 +0000)]
Generate the BRANCH field from the current tag, use CURRENT if the current
tag is the HEAD.  This probably needs more work when we get to the next
release to strip the release portion of the tag since the release is already
generated (or perhaps we will auto-generate the release portion as well).

19 years agoFix bugs in the last commit. Some islink checks and a fd->fdval change was
Matthew Dillon [Fri, 22 Oct 2004 22:34:10 +0000 (22:34 +0000)]
Fix bugs in the last commit.  Some islink checks and a fd->fdval change was
missing causing failures with symlinks.

19 years agoThis is a really nice rewrite of rc.firewall that cleans it up and adds
Matthew Dillon [Fri, 22 Oct 2004 20:26:11 +0000 (20:26 +0000)]
This is a really nice rewrite of rc.firewall that cleans it up and adds
additional firewall_* rc.conf variables, with appropriate defaults, for
quick and easy rc-based firewall configuration.  More sophisticated
configurations should continue to use the ipfw.conf mechanism.

The default client firewall is now similar to the description in the
'man firewall' manual page, allowing certain basic services ports
through and those ICMP messages required for proper network and protocol
management.

Submitted-by: Andreas Hauser <andy@splashground.de>
19 years agoThe old lookup() API is extremely complex. Even though it will be ripped out
Matthew Dillon [Fri, 22 Oct 2004 18:03:50 +0000 (18:03 +0000)]
The old lookup() API is extremely complex.  Even though it will be ripped out
soon, I'm documenting the procedure so I don't have to keep running through
it to figure out what is going on.  Do a better job describing the new
vgone() API (the old API required the vnode to be in a very weird state.
The new API requires the vnode to be VX locked and refd and returns with the
vnode in the same state).

19 years agoMake an existing vnode lock assertion a bit more verbose.
Matthew Dillon [Fri, 22 Oct 2004 18:00:26 +0000 (18:00 +0000)]
Make an existing vnode lock assertion a bit more verbose.

19 years agoFix a final bug in the vfs cache cleaning code. An incorrect assertion was
Matthew Dillon [Fri, 22 Oct 2004 17:59:59 +0000 (17:59 +0000)]
Fix a final bug in the vfs cache cleaning code.  An incorrect assertion was
causing occassional panics.

19 years agoCorrect use of the flags argument to the recvmsg system call.
Jeffrey Hsu [Fri, 22 Oct 2004 13:42:14 +0000 (13:42 +0000)]
Correct use of the flags argument to the recvmsg system call.

19 years agoSet the file modes for those rc files which are unconditionally replaced by
Matthew Dillon [Thu, 21 Oct 2004 18:49:51 +0000 (18:49 +0000)]
Set the file modes for those rc files which are unconditionally replaced by
'make upgrade' to be read-only to prevent accidental editing by the
sysop.  A sysop can of course decide to modify them anyway, but make upgrade
currently overwrites them so it isn't a good idea.

Issue-noticed-by: <justin@shiningsilence.com>
19 years agoChange the default handling for kernels built with debugging info (DEBUG=-g).
Matthew Dillon [Wed, 20 Oct 2004 23:03:05 +0000 (23:03 +0000)]
Change the default handling for kernels built with debugging info (DEBUG=-g).
Since GENERIC includes this make option, this applies to most kernels.

Previously, installed kernels were stripped of their debug information and
installed modules were not.  With this commit, the debug info is left intact
in the installed kernel and debug information is stripped from all backup
copies that are made (kernel.old, modules.old).  Developers using DEBUG=-g
(which is most) may actually see root disk space go down due to the stripping
of kernel.old and modules.old (-~30MB), even though /kernel will be +~13MB
larger.

Two new makeoptions are available for specification in your kernel config or
when you run the buildkernel/nativekernel/installkernel target to make.

INSTALLSTRIPPED=1

    The installed kernel and modules will be stripped of debug info.  This
    option effectively reverts you to the pre-commit state of things.

INSTALLSTRIPPEDMODULES=1

    The installed modules will be stripped of debug info.  The kernel will
    be left with debug info intact.

What this means is that developres will no longer have to stuff a debug
kernel off somewhere to use later instead of a crash, savecore will copy
a debuggable kernel into /var/crash instead of a stripped kernel, and
snapshot and release CD's will have debug kernels and working crash dumps
right out of the box.  The memory impact of the debug kernel is zero since
the debug info is not loaded, and the run-time impact of this change is
also zero.

The intention is multi-fold:

    * To make it easier for inexperienced users to provide meaningful debug
      info to developers when posting bug reports, especially during release
      cycles.

    * To not have to make copies of debug kernels for debugging purposes.
      Such copies often get out of sync with the actually running kernel
      and savecore does not know about them.

    * To make the debugging environment more uniform, less confusing, and
      easier to use.

19 years agoFix a boot panic with the amd device. We inherited some busdma code from
Matthew Dillon [Wed, 20 Oct 2004 18:12:54 +0000 (18:12 +0000)]
Fix a boot panic with the amd device.  We inherited some busdma code from
FreeBSD which now requires that bus_dmamap_create() be called, and the
amd device was not doing that.

Reported-by: "Robin P. Blanchard" <robin.blanchard@gactr.uga.edu>
19 years agoThe last commit failed to adjust the alignment like it said it did.
Matthew Dillon [Wed, 20 Oct 2004 09:17:22 +0000 (09:17 +0000)]
The last commit failed to adjust the alignment like it said it did.

Noticed-by: Hidetoshi Shimokawa <simokawa@freebsd.org>
19 years agoOld API compatibility: The directory vnode passed to VOP_LOOKUP() must be
Matthew Dillon [Wed, 20 Oct 2004 09:00:35 +0000 (09:00 +0000)]
Old API compatibility: The directory vnode passed to VOP_LOOKUP() must be
unlocked if this is not the last component of the path, unless we are looking
up '.' in which case it must be locked because the return vnode must be
locked.  (echo "kill" > /proc/<pid>/ctl was panicing the system).

Panic-reported-by: =?ISO-8859-1?Q?Christer_=D6berg?= <christer.oberg@ornsat.com>
19 years agoSeparate out the length checks from IP dispatch and also do them along
Jeffrey Hsu [Wed, 20 Oct 2004 05:00:36 +0000 (05:00 +0000)]
Separate out the length checks from IP dispatch and also do them along
the IPSEC path to the protocol processing routines.

Reported by:  Andrew Atrens <atrens@nortelnetworks.com>

19 years agoFix an assertion, vgone() now requires that the vnode be VX locked and refd.
Matthew Dillon [Tue, 19 Oct 2004 09:29:46 +0000 (09:29 +0000)]
Fix an assertion, vgone() now requires that the vnode be VX locked and refd.

Replace the pfshead based sequential linked list with a simple hash table,
otherwise linprocfs will bog down when the system has a huge number of
processes.

Assertion-Reported-by: Frank Denis <dragonfly@pureftpd.org>
19 years agoFix bugs in the limiting code for negative-hit namecache entries. The system
Matthew Dillon [Tue, 19 Oct 2004 05:55:34 +0000 (05:55 +0000)]
Fix bugs in the limiting code for negative-hit namecache entries.  The system
was allowing too many negative entries to build up.  Since these entries by
definition do not have associated vnodes the vnode code is not responsible
for limiting the number of negative entries.  Since vnodes associated
with non-leaf namecache entries are held, the build-up of negative entries
prevented directory vnodes from being recycled and caused vnlru_proc to fail.

To fix this we check for and cleanup negative entries in both the old API
cache_enter() and the new API cache_nlookup().  Rather then just removing one
when we exceed the limit we remove 10 and we create a 90%/100% hysteresis
to avoid a non-optimal following cleanup call on every cache lookup.

Reported-by: Pawel Biernacki <kaktus@DragonFlyBSD.pl>,
     Chris Pressey <cpressey@catseye.mine.nu>
Testing-by: same
19 years agoMFC FreeBSD if_em.c 1.48 and 1.49.
Matthew Dillon [Tue, 19 Oct 2004 05:47:52 +0000 (05:47 +0000)]
MFC FreeBSD if_em.c 1.48 and 1.49.

Remove an unnecessary bus_dmamap_create and destroy for the rx and tx
descriptor rings.  No bounce buffers are ever needed since bus_dmamem_alloc()
allocates the correct type of memory and never needs a bounce buffer.

Use an alignment of 1 instead of PAGE_SIZE for the rx and tx buffer tags.
Since the e1000 DMA engines hava no constraints on the alignment of buffer
transfers, there is no reason to tell busdma that there is.  This saves a
minimum of 1 malloc call per packet and avoids needless boucning.

Use BUS_DMA_WAITOK when allocating the receive descriptor ring.  It's really
silly to use BUS_DMA_NOWAIT here, it isn't all that much memory.

A simple cached NFS test did not result in any noticeable improvement in
cpu or packet efficiency but Scott's commit message indicated a significant
improvement in a larger FreeBSD machine setup, probably oweing more to the
locks eliminated in FreeBSD (which does not apply to DragonFly).

Suggested-by: David Rhodus
Obtained from: Sandvine, Inc.  via FreeBSD  if_em.c 1.48 and 1.49 (scottl)

19 years ago* pid should be pid_t not int
Eirik Nygaard [Mon, 18 Oct 2004 18:43:37 +0000 (18:43 +0000)]
* pid should be pid_t not int
* make static functions
* bump WARNS to 6
* constify some args

Submitted by: "Liam J. Foy" <liamfoy@sepulcrum.org>

19 years ago* static functions
Eirik Nygaard [Mon, 18 Oct 2004 18:42:01 +0000 (18:42 +0000)]
* static functions
* remove main prototype
* setmode returns void *
* getmode returns mode_t
* fix setmode if an error occurs. Previous code would print invalid file mode if
  malloc had failed and the file mode was correct.
* remove '?' case

Submitted by: "Liam J. Foy" <liamfoy@sepulcrum.org>

19 years ago * Fix spelling.
Eirik Nygaard [Mon, 18 Oct 2004 17:54:35 +0000 (17:54 +0000)]
 * Fix spelling.
 * Capitalize C. [1]

Suggested by: Sascha Wildner <saw@online.de> [1]

19 years agooops, forgot a mention. Last commit:
Matthew Dillon [Mon, 18 Oct 2004 17:38:52 +0000 (17:38 +0000)]
oops, forgot a mention.  Last commit:

Submitted-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de> (usage)
Frank Denis <dragonfly@pureftpd.org>  (synopsis)
Matt Dillon (rewrite 'dumb user')

19 years agoAdjust rm's usage and manual page synopsis to include the new -I option.
Matthew Dillon [Mon, 18 Oct 2004 17:35:13 +0000 (17:35 +0000)]
Adjust rm's usage and manual page synopsis to include the new -I option.
Take out the 'dumb user' mention, the option works well for power users and
sysops and not just newbies.

Submitted-by: Frank Denis <dragonfly@pureftpd.org> (usage, synopsis fixes)
Matt Dillon (dumb user fix)

19 years agoRemove duplicate comment.
Jeffrey Hsu [Sat, 16 Oct 2004 23:24:24 +0000 (23:24 +0000)]
Remove duplicate comment.

19 years agoFrom KAME freebsd4/sys/netinet/ip_input.c rev 1.42:
Jeffrey Hsu [Sat, 16 Oct 2004 23:20:00 +0000 (23:20 +0000)]
From KAME freebsd4/sys/netinet/ip_input.c rev 1.42:

  Set m->m_pkthdr.len for the saved mbuf (mcopy) to make
  ipsec4_getpolicybyaddr() successful.

Same as FreeBSD rev 1.273 fix to FreeBSD PR kern/42727.

19 years agolast commit removed the space before the comment at end of line,
YONETANI Tomokazu [Sat, 16 Oct 2004 16:58:32 +0000 (16:58 +0000)]
last commit removed the space before the comment at end of line,
adding garbage to MAKEDEV argument.

19 years agoFix a bug where sc_ctlp() is improperly called when the packet is passed up
Matthew Dillon [Sat, 16 Oct 2004 03:58:52 +0000 (03:58 +0000)]
Fix a bug where sc_ctlp() is improperly called when the packet is passed up
the protocol stack.  sc_ctlp() must be called exactly once for each packet
queued to the tty and ONLY when the packet is queued to the tty.  Otherwise
the tty's t_canq will start to fill up and the tty code will incorrectly
believe that there are packets pending when there might not be.

The characteristic of this bug was that pppd would stay in a 'R'un state
polling the tty for non-existant packets.

Reported-by: =?ISO-8859-1?Q?Cristi=E1n_H=2E_Garc=EDa_Whiting?= <cgw@cosimo.cl>,
Sarunas Vancevicius <vsarunas@eircom.net>

19 years agoImplement hotchar support for ucom.
Matthew Dillon [Sat, 16 Oct 2004 03:20:52 +0000 (03:20 +0000)]
Implement hotchar support for ucom.

Fix a problem where ucomstop() was calling ucomstopread() and completely
halting the receive pipe.  No, ucomstop() with FREAD is only supposed to
*flush* the receive pipe, not halt it!  It turns out that ppp doesn't flush
but pppd does.

Bug-Reports-By: Rahul Siddharthan <rsidd@online.fr>
19 years agoUpdate includes now that the Fast IPSec code has moved to netproto/ipsec.
Jeffrey Hsu [Fri, 15 Oct 2004 22:59:10 +0000 (22:59 +0000)]
Update includes now that the Fast IPSec code has moved to netproto/ipsec.

Submitted by:  Pawel Biernacki <kaktus@dragonflybsd.pl>

19 years agoChange DFD to DFB since it sounds more correct for DragonFly BSD.
Scott Ullrich [Fri, 15 Oct 2004 15:11:05 +0000 (15:11 +0000)]
Change DFD to DFB since it sounds more correct for DragonFly BSD.

Pointed-out-by: Jeroen Ruigrok/asmodai

19 years agoCreate a softlink from /kernel to /kernel.BOOTP on the CD. Mount
Matthew Dillon [Fri, 15 Oct 2004 02:43:51 +0000 (02:43 +0000)]
Create a softlink from /kernel to /kernel.BOOTP on the CD.  Mount
/usr/local/etc with MFS.  Note that pxebooted loader code now loads up
different config files (e.g. loader-bootp.conf instead of loader.conf,
kernel.BOOTP instead of kernel)..

This will facilitate upcoming installer work which will allow a CD-booted
machine to simply export the CD and act as a dhcp/tftp/nfs server for
pxeboot clients.

In-conversation-with: Scott Ullrich <geekgod@geekgod.com>

19 years agoAdd devices da4-da15 and ad4-ad7 to MAKEDEVs 'all' for convenience. Plug-in
Matthew Dillon [Fri, 15 Oct 2004 02:38:35 +0000 (02:38 +0000)]
Add devices da4-da15 and ad4-ad7 to MAKEDEVs 'all' for convenience.  Plug-in
and built-in USB attached storage uses the CAM layer and is visible starting
at device 'da8'.  Such storage is now quite common.  SATA controllers are also
becoming quite common and look like IDE drives, with numbering beginning
at ad4 (the legacy IDE controller usually eats ad0-ad3).

19 years ago*** empty log message ***
Matthew Dillon [Thu, 14 Oct 2004 20:57:41 +0000 (20:57 +0000)]
*** empty log message ***

19 years agoAugment vnodeinfo to retrieve and display the number of resident pages in
Matthew Dillon [Thu, 14 Oct 2004 20:54:11 +0000 (20:54 +0000)]
Augment vnodeinfo to retrieve and display the number of resident pages in
attached VM objects.

19 years agoThe forth code is a real mess, things are repeated all over the place.
Matthew Dillon [Thu, 14 Oct 2004 18:36:00 +0000 (18:36 +0000)]
The forth code is a real mess, things are repeated all over the place.
Add another missing conditional for loader-bootp.conf.

19 years agoAdd the "nv" interface, and enable it in the bootp case since the netif/nv
Matthew Dillon [Thu, 14 Oct 2004 18:33:29 +0000 (18:33 +0000)]
Add the "nv" interface, and enable it in the bootp case since the netif/nv
module cannot be directly compiled into a kernel.

19 years agoRemove the 'ether' module dependancy, it is not defined anywhere and will
Matthew Dillon [Thu, 14 Oct 2004 18:31:02 +0000 (18:31 +0000)]
Remove the 'ether' module dependancy, it is not defined anywhere and will
prevent the loader from pre-loading the modules in question.

Do not partially initialize the related struct sockaddr_in when a
non-existant or "0.0.0.0" pxe related kenv is found.  In particular, if
the gateway is not specified by the DHCP server we avoid attempting to add
a bad default route (which results in a panic) later on.

19 years agoUpdate the BSD Family tree chart to include DragonFly.
Scott Ullrich [Thu, 14 Oct 2004 15:04:47 +0000 (15:04 +0000)]
Update the BSD Family tree chart to include DragonFly.

Submitted-by: andre_AT_digirati.com.br (Andre Nathan)

19 years agoCorrect non-matching comment.
Jeroen Ruigrok/asmodai [Thu, 14 Oct 2004 11:50:24 +0000 (11:50 +0000)]
Correct non-matching comment.

This is not root's crontab, which is actually /var/cron/tabs/root, but it is
the systemwide crontab.

19 years agoFinal cleanup. After giving up on trying to avoid having two loader*.conf
Matthew Dillon [Thu, 14 Oct 2004 09:47:47 +0000 (09:47 +0000)]
Final cleanup.  After giving up on trying to avoid having two loader*.conf
files, move the kernel= variable back into the (now separate) files for
bootp and normal boots.

19 years agoAdd /boot/defaults/loader-bootp.conf, a separate default configuration
Matthew Dillon [Thu, 14 Oct 2004 09:41:01 +0000 (09:41 +0000)]
Add /boot/defaults/loader-bootp.conf, a separate default configuration
file for bootp boots.  It's basically the same as defaults/loader.conf
but with auxillary config file names extended with -bootp.  Changes are
as follows:

bootfile="kernel.BOOTP"
userconfig_script_name="/boot/kernel-bootp.conf"
loader_conf_files="/boot/device.hints /boot/loader-bootp.conf /boot/loader-bootp.conf.local"
nextboot_conf="/boot/nextboot-bootp.conf"

19 years agoWhen pxebooted loader is detected not only change the kernel name, but
Matthew Dillon [Thu, 14 Oct 2004 09:06:21 +0000 (09:06 +0000)]
When pxebooted loader is detected not only change the kernel name, but
also use loader-bootp.conf instead of loader.conf, so a different set
of kernel options can be specified foor pxe booted kernels.

19 years agoInitialize the 'kernel' environment variable from loader.4th
Matthew Dillon [Thu, 14 Oct 2004 08:44:34 +0000 (08:44 +0000)]
Initialize the 'kernel' environment variable from loader.4th
instead of loader.conf.  loader.4th will set the kernel name to
'kernel' for normal boots, 'kernel.BOOTP' for PXE boots.  This allows
us to distinguish between BOOTP kernels and normal kernels and,
in particular, this will allow both to be shipped on the CD.

19 years agoDo not use non-blocking malloc()'s in the busdma support code. A lot of
Matthew Dillon [Thu, 14 Oct 2004 03:05:54 +0000 (03:05 +0000)]
Do not use non-blocking malloc()'s in the busdma support code.  A lot of
drivers basically expect these functions to work, so they must work.   It
was originally believed that the ATA code might be effected but it turns out
our ATA code does not (yet) use busdma.  However, other disk drivers such
as TWE *do* use it.  Note that most drivers appear to use the busdma
allocation functions at driver initialization rather then at run time.

19 years agoAvoid redefined symbol warning when libcaps uses thread.h with its own
Matthew Dillon [Wed, 13 Oct 2004 19:51:31 +0000 (19:51 +0000)]
Avoid redefined symbol warning when libcaps uses thread.h with its own
stack specification.

Submitted-by: Eirik Nygaard <eirikn@kerneled.com>
19 years agoForgot to add for last commit:
Matthew Dillon [Wed, 13 Oct 2004 19:48:12 +0000 (19:48 +0000)]
Forgot to add for last commit:

Taken-from: OpenBSD ar_io.c/1.36.

19 years agoMake a chdir failure fatal rather then just a warning, otherwise pax could
Matthew Dillon [Wed, 13 Oct 2004 19:47:38 +0000 (19:47 +0000)]
Make a chdir failure fatal rather then just a warning, otherwise pax could
end up overwriting files unexpectedly.

Submitted-by: Robert Nagy <robert@bsd.hu>
19 years agotest commit@ list 2/2
Matthew Dillon [Wed, 13 Oct 2004 19:43:07 +0000 (19:43 +0000)]
test commit@ list 2/2

19 years agotest commits@ list 1/2
Matthew Dillon [Wed, 13 Oct 2004 19:41:20 +0000 (19:41 +0000)]
test commits@ list 1/2

19 years agoAdd two more header in the !_KERNEL case so libcaps knows about
Eirik Nygaard [Wed, 13 Oct 2004 18:42:34 +0000 (18:42 +0000)]
Add two more header in the !_KERNEL case so libcaps knows about
clear_lwkt_resched.

19 years agoTry to close an occassional VM page related panic that is believed to occur
Matthew Dillon [Tue, 12 Oct 2004 19:29:34 +0000 (19:29 +0000)]
Try to close an occassional VM page related panic that is believed to occur
due to the VM page queues or free lists being indirectly manipulated by
interrupts that are not protected by splvm().  Do this by replacing splvm()'s
with critical sections in a number of places.

Note: some of this work bled over into the "VFS messaging/interfacing work
stage 8/99" commit.

19 years agoVFS messaging/interfacing work stage 8/99: Major reworking of the vnode
Matthew Dillon [Tue, 12 Oct 2004 19:21:16 +0000 (19:21 +0000)]
VFS messaging/interfacing work stage 8/99: Major reworking of the vnode
interlock and other miscellanious things.  This patch also fixes FS
corruption due to prior vfs work in head.  In particular, prior to this
patch the namecache locking could introduce blocking conditions that
confuse the old vnode deactivation and reclamation code paths.  With
this patch there appear to be no serious problems even after two days
of continuous testing.

* VX lock all VOP_CLOSE operations.
* Fix two NFS issues.  There was an incorrect assertion (found by
  David Rhodus), and the nfs_rename() code was not properly
  purging the target file from the cache, resulting in Stale file
  handle errors during, e.g. a buildworld with an NFS-mounted /usr/obj.
* Fix a TTY session issue.  Programs which open("/dev/tty" ,...) and
  then run the TIOCNOTTY ioctl were causing the system to lose track
  of the open count, preventing the tty from properly detaching.
  This is actually a very old BSD bug, but it came out of the woodwork
  in DragonFly because I am now attempting to track device opens
  explicitly.
* Gets rid of the vnode interlock.  The lockmgr interlock remains.
* Introduced VX locks, which are mandatory vp->v_lock based locks.
* Rewrites the locking semantics for deactivation and reclamation.
  (A ref'd VX lock'd vnode is now required for vgone(), VOP_INACTIVE,
  and VOP_RECLAIM).  New guarentees emplaced with regard to vnode
  ripouts.
* Recodes the mountlist scanning routines to close timing races.
* Recodes getnewvnode to close timing races (it now returns a
  VX locked and refd vnode rather then a refd but unlocked vnode).
* Recodes VOP_REVOKE- a locked vnode is now mandatory.
* Recodes all VFS inode hash routines to close timing holes.
* Removes cache_leaf_test() - vnodes representing intermediate
  directories are now held so the leaf test should no longer be
  necessary.
* Splits the over-large vfs_subr.c into three additional source
  files, broken down by major function (locking, mount related,
  filesystem syncer).

* Changes splvm() protection to a critical-section in a number of
  places (bleedover from another patch set which is also about to be
  committed).

Known issues not yet resolved:

* Possible vnode/namecache deadlocks.
* While most filesystems now use vp->v_lock, I haven't done a final
  pass to make vp->v_lock mandatory and to clean up the few remaining
  inode based locks (nwfs I think and other obscure filesystems).
* NullFS gets confused when you hit a mount point in the underlying
  filesystem.
* Only UFS and NFS have been well tested
* NFS is not properly timing out namecache entries, causing changes made
  on the server to not be properly detected on the client if the client
  already has a negative-cache hit for the filename in question.

Testing-by: David Rhodus <sdrhodus@gmail.com>,
    Peter Kadau <peter.kadau@tuebingen.mpg.de>,
    walt <wa1ter@myrealbox.com>,
    others

19 years agoMake a DFly buildworld work on a FreeBSD-4.x system again by fixing
Matthew Dillon [Mon, 11 Oct 2004 21:36:48 +0000 (21:36 +0000)]
Make a DFly buildworld work on a FreeBSD-4.x system again by fixing
assumptions made by the new patch code during the buildworld/bootstrap
build stage.  + slip the DragonFly_Stable tag for the fix.

Work-by: Joerg Sonnenberger and Matt Dillon
19 years agoAdd a missing agp_generic_detach() call if a bad initial aperture size
Matthew Dillon [Sun, 10 Oct 2004 18:59:02 +0000 (18:59 +0000)]
Add a missing agp_generic_detach() call if a bad initial aperture size
is detected.

Submitted-by: "Markie" <mark.cullen@dsl.pipex.com>
19 years agoFix a USB stuttering key issue.
Matthew Dillon [Sun, 10 Oct 2004 18:34:44 +0000 (18:34 +0000)]
Fix a USB stuttering key issue.

Dragonfly-Sleuthing-by: Roland Hammerle <romendo@yahoo.com>
FreeBSD-PR: kern/57273 [ plasma <plasma@freebsd.sinica.edu.tw> ]
    kern/63171 [ Brian Candler <B.Candler@pobox.com> ]

19 years agoBring in a fix from NetBSD for hid_report_size(). This fixes a detection
Matthew Dillon [Fri, 8 Oct 2004 21:14:45 +0000 (21:14 +0000)]
Bring in a fix from NetBSD for hid_report_size().  This fixes a detection
issue with the Logitech USB Keyboard/Mouse.

Reported-by: Roland Hammerle <romendo@yahoo.com>
FreeBSD-PR: kern/63837

19 years agoAdd the standard DragonFly copyright.
Matthew Dillon [Fri, 8 Oct 2004 18:32:58 +0000 (18:32 +0000)]
Add the standard DragonFly copyright.

19 years agoAdd conditionals so vnodeinfo compiles for both old and new api kernels.
Matthew Dillon [Fri, 8 Oct 2004 18:31:24 +0000 (18:31 +0000)]
Add conditionals so vnodeinfo compiles for both old and new api kernels.

19 years agoConditionalize the flag->string conversions so pstat compiles for both the
Matthew Dillon [Fri, 8 Oct 2004 09:53:02 +0000 (09:53 +0000)]
Conditionalize the flag->string conversions so pstat compiles for both the
stable and head kernels, and for upcoming work as well.

19 years agoVFS messaging/interfacing work stage 7h/99: More firming up of stage 7.
Matthew Dillon [Thu, 7 Oct 2004 20:18:33 +0000 (20:18 +0000)]
VFS messaging/interfacing work stage 7h/99: More firming up of stage 7.

Fix a vnode leak due to a missed change when the cache_lookup() semantics
were modified.  Hold the parent namecache record in naccess() when checking
for write perms on a directory.

Reported-by: walt <wa1ter@myrealbox.com>
19 years agoAdd sr_YU.ISO8859-2/5.
Jeroen Ruigrok/asmodai [Thu, 7 Oct 2004 13:32:37 +0000 (13:32 +0000)]
Add sr_YU.ISO8859-2/5.

Taken from: Toni Andjelkovic / FreeBSD

19 years agoFix the -N and M options for ncptrace.
Matthew Dillon [Thu, 7 Oct 2004 10:15:06 +0000 (10:15 +0000)]
Fix the -N and M options for ncptrace.

19 years agoVFS messaging/interfacing work stage 7g/99: More firming up of stage 7.
Matthew Dillon [Thu, 7 Oct 2004 10:03:06 +0000 (10:03 +0000)]
VFS messaging/interfacing work stage 7g/99: More firming up of stage 7.

Fix a serious bug in cache_lookup().  The original lookup code could get
away with returning an unreferenced vnode but the new code's cache_hold()/
cache_drop() and related functions can interact badly with an unreferenced
vnode.  So make cache_lookup() return a referenced vnode.

Detect and handle locking races in cache_nlookup() and cache_lookup().

Change cache_zap() to require a locked namecache record so it doesn't
rip data out from under cache_lookup()/cache_nlookup()/cache_resolve().

19 years agoVFS messaging/interfacing work stage 7f/99: More firming up of stage 7.
Matthew Dillon [Thu, 7 Oct 2004 04:20:28 +0000 (04:20 +0000)]
VFS messaging/interfacing work stage 7f/99: More firming up of stage 7.

unlink, rmdir, rename, and whiteout removal functions use NAMEI_DELETE
namei() lookups.  With the old API this zap'd the namecache entry before
the system actually runs the operation.  If the operation fails we can be
left with a broken namecache hierarchy which is not allowed in the new API.

Change old API cache_lookup() semantics to *NOT* zap the namecache entry and
add explicit zaps after calls to VOP_UNLINK(), VOP_RMDIR(), etc. to replace
the functionality.

rename() attempts to issue a NAMEI_RENAME lookup which zaps the target, but
the same problem occurs if the target is preexisting and being overwritten.
A similar solution is employed for renames.

19 years agoThe last commit was improperly documented as being VFS related. It was
Matthew Dillon [Thu, 7 Oct 2004 01:33:31 +0000 (01:33 +0000)]
The last commit was improperly documented as being VFS related.  It was
in related to the tty/clist fixes for USB keyboards.

19 years agoFix a bug in the tty clist code. The clist code was only protecting itself
Matthew Dillon [Thu, 7 Oct 2004 01:32:04 +0000 (01:32 +0000)]
Fix a bug in the tty clist code.  The clist code was only protecting itself
with spltty() but the keyboard code uses clists too, and USB interrupts
(for USB keyboards) aren't protected by spltty().   Generally convert the
spl's to critical sections to solve the problem.

19 years agoVFS messaging/interfacing work stage 8a/99: Sync other filesystems to stage 7
Matthew Dillon [Thu, 7 Oct 2004 01:13:21 +0000 (01:13 +0000)]
VFS messaging/interfacing work stage 8a/99: Sync other filesystems to stage 7

Make vop_noresolve() a global rather then static function.

Make NULLFS work again (fix some vnode leaks and make it compatible with
the new vop_resolve API function).

19 years agoAdd vnodeinfo - a program which scans each mount's vnode list and dumps
Matthew Dillon [Thu, 7 Oct 2004 00:05:03 +0000 (00:05 +0000)]
Add vnodeinfo - a program which scans each mount's vnode list and dumps
mount and vnode information, plus scans the vnode_free_list and dumps it
as well.

Give ncptrace the ability to specify a kernel and core file.

19 years agoVFS messaging/interfacing work stage 7e/99: More firming up of stage 7.
Matthew Dillon [Wed, 6 Oct 2004 23:03:50 +0000 (23:03 +0000)]
VFS messaging/interfacing work stage 7e/99: More firming up of stage 7.
[commit files missed in the last vfs commit]

19 years agoFix locations of PF helpers.
Joerg Sonnenberger [Wed, 6 Oct 2004 17:03:49 +0000 (17:03 +0000)]
Fix locations of PF helpers.

Submitted-by: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>
19 years agoIf we get an EOF in check2(), terminate the yes/no question loop rather
Matthew Dillon [Wed, 6 Oct 2004 06:58:53 +0000 (06:58 +0000)]
If we get an EOF in check2(), terminate the yes/no question loop rather
then looping forever.

19 years agoLast commit inspired by: Giorgos Keramidas <keramida@freebsd.org>, who
Matthew Dillon [Wed, 6 Oct 2004 06:45:04 +0000 (06:45 +0000)]
Last commit inspired by: Giorgos Keramidas <keramida@freebsd.org>, who
correctly identified a generic and serious problem that occurs when one
introduces a newbie user to UNIX for the first time and that user tries
to user 'rm'.  It's been a problem for, oh, 22+ years, it's about time
it got fixed!

19 years agoalias rm to rm -I by default in interactive shells. rm -I is a safer, more
Matthew Dillon [Wed, 6 Oct 2004 06:31:39 +0000 (06:31 +0000)]
alias rm to rm -I by default in interactive shells.  rm -I is a safer, more
friendly rm that will not let you shoot yourself in the foot yet which is
not as annoying as rm -i. [ Experienced sysops can always remove the aliases ].

This only effects fresh installs.

19 years agoDo not run getty on ttyd0 by default. The installer's version of ttys already
Matthew Dillon [Wed, 6 Oct 2004 06:24:11 +0000 (06:24 +0000)]
Do not run getty on ttyd0 by default.  The installer's version of ttys already
turns this off but we might as well do it in the master copy too.

19 years agoAdd the -I option to rm. This option asks for confirmation just once if
Matthew Dillon [Wed, 6 Oct 2004 06:16:43 +0000 (06:16 +0000)]
Add the -I option to rm.  This option asks for confirmation just once if
recursively removing directories or if more then 3 files are listed in the
command line.  It is designed as a better safety net for new users then
the far more annoying -i.

After: reading the bikeshed on the freebsd groups and thinking up a better way.

19 years agoUpdate ncptrace.c to handle DragonFly_Stable and HEAD.
Matthew Dillon [Wed, 6 Oct 2004 05:13:20 +0000 (05:13 +0000)]
Update ncptrace.c to handle DragonFly_Stable and HEAD.
Add ttyinfo.c (does a sanity check on the kernel's clist data)

19 years agoRegister ips device with devstat subsystem so that {io,sys,vm}stat
YONETANI Tomokazu [Wed, 6 Oct 2004 02:12:31 +0000 (02:12 +0000)]
Register ips device with devstat subsystem so that {io,sys,vm}stat
show statistics for ServeRAID device.

Requested-by: Toma Bor¹ônar
19 years agoVFS messaging/interfacing work stage 7e/99: More firming up of stage 7.
Matthew Dillon [Tue, 5 Oct 2004 07:57:41 +0000 (07:57 +0000)]
VFS messaging/interfacing work stage 7e/99: More firming up of stage 7.

Fix the linux emulation code for [l]stat(), it was not properly
disposing of the nlookupdata structure.

Fix chroot()'s use of the new api, it was horribly broken.

Cleanup cache_alloc().  Rewrite __getcwd() and vn_fullpath() to use newapi
namecache data.  Cleanup nlookup().  Fix bugs in nlookup() related to
stacked mount points.  Fix a bug related to VFS_ROOT() mount errors.

Linux-bugs-reported-by: Bartek Stalewski, walt
19 years agoVFS messaging/interfacing work stage 7d/99: More firming up of stage 7.
Matthew Dillon [Tue, 5 Oct 2004 03:24:35 +0000 (03:24 +0000)]
VFS messaging/interfacing work stage 7d/99: More firming up of stage 7.

Additional work to deal with old-api/new-api issues.  Cut more stuff
out of the old-api's cache_enter() routine to deal with deadlocks, at
the cost of some performance loss (temporary until the VFS's start using
the new APIs).  Change UFS and NFS to not purge whole directories in
*_rename() and *_rmdir().

Add some minor breakage to the API which will not be fixed until the VFS's
get new rename implementations - renaming a directory in which a process
has chdir'd will create problems for that process.  This doesn't happen
normally anyway so this temporary breakage should not cause any significant
problems.

Bug-reports-by: walt, Sascha Wildner, others
19 years agoVFS messaging/interfacing work stage 7c/99: More firming up of stage 7.
Matthew Dillon [Mon, 4 Oct 2004 09:20:43 +0000 (09:20 +0000)]
VFS messaging/interfacing work stage 7c/99: More firming up of stage 7.

Make a minor change to cache_alloc()'s semantics by having it returned a
ref'd locked ncp.  Make the same change to cache_allocroot().

Fix a bug in the resolver that could deadlock a namecache and vnode lock by
unlocking the namecache node before locking the vnode.  This hack is only
needed until the old API has been removed.

Get rid of the old API compat code that tried to create dummy ncp's for
directory vnodes that did not have one and then merge old and new, it got
too messy.  The idea was to be able to cache things in the middle of the
topology and then hook the topology up later when we knew the path.

Instead, the old API simply does not enter things into the namecache
if the parent directory vnode has not namecache structure associated
with it.  This maintains the unbroken topology that we want to guarentee
at the cost of the old API functions potentially not caching as much
information.  [ since kern_open(), [f]chdir(), and [f]stat() execute the
new API the loss of efficiency in the old API should not be noticeable ].

When cache_enter() re-enters the same vnode, it was zaping the old namecache
structure unnecessarily and causing problems with directories.  It no longer
does this.

NFS CHANGE: get rid of the va_ctime vs n_ctime test.  This test was supposed
to detect server-side directory changes and purge the directory, but half the
time it purged the directory anyway.  The new API requires that the directory
topology remain intact so only purge if the directory is found not to exist.
This change may have to be revisited later.

NOTE: cache_nlookup() is sensitive to the directory topology when traversing
".." directories.  If a directory in the middle of the topology is purged
it can cause the new API lookup to fail with EXDEV.

Bug-reports-by: drhodus, various other people.
19 years agoOnly include opt_vmpage.h if _KERNEL is defined.
Matthew Dillon [Mon, 4 Oct 2004 09:05:26 +0000 (09:05 +0000)]
Only include opt_vmpage.h if _KERNEL is defined.

19 years agoAdd a debugging utility which dumps that kernel's namecache topology.
Matthew Dillon [Sun, 3 Oct 2004 06:12:34 +0000 (06:12 +0000)]
Add a debugging utility which dumps that kernel's namecache topology.

19 years agoMake patch's -b option match the old patch's -b option, at least for now,
Matthew Dillon [Sat, 2 Oct 2004 05:52:06 +0000 (05:52 +0000)]
Make patch's -b option match the old patch's -b option, at least for now,
so ports don't break so badly.

Patch-by: Sascha Wildner <saw@online.de>
19 years agoVFS messaging/interfacing work stage 7b/99: More firming up of stage 7.
Matthew Dillon [Sat, 2 Oct 2004 03:18:28 +0000 (03:18 +0000)]
VFS messaging/interfacing work stage 7b/99: More firming up of stage 7.

(1) Enhance cache_resolve() to go up the directory chain as far as necessary
    to resolve the chain.  Previously I wimped out and returned an error.

(2) Be sure not to use the parent of a mount point to obtain the vnode
    operations vector for a child of a mount point (which resides on a
    different filesystem!).

Generally speaking the namecache directory chain should contain resolved
vnodes due to the fact that the vnode associated with a namecache entry is
held if any children exist, preventing the vnode from being recycled.
However, the NFS client code as originally written wimps out and does
wholesale namecache flushing of directories when it isn't sure about the
state of things (which is quite often, especially when you are rm'ing
files), and this breaks that assumption and causes some intermediate NFS
directory nodes to revert back into an 'unresolved' state.  This will
eventually be fixed, but not right now.

Add a nc_mount pointer to the namecache structure.  For the moment this is
only used to get at the mount point associated with a NCF_MOUNTPT namecache
node (whether resolved or unresolved), making it easier for us to resolve
the vnode.  But eventually it will be used as the basis for obtaining the
v_ops for (new stlye) VOP calls on an unresolved namecache node, saving us
a few indirections so I don't consider it a hack.

Bugs-and-cores-by: drhodus
19 years agoEnforce directory creation ordering for subdirectories to fix a make -j
Matthew Dillon [Sat, 2 Oct 2004 03:08:07 +0000 (03:08 +0000)]
Enforce directory creation ordering for subdirectories to fix a make -j
problem.

19 years agoUnsetting an undefined variable or function is not an error.
Matthew Dillon [Fri, 1 Oct 2004 20:38:40 +0000 (20:38 +0000)]
Unsetting an undefined variable or function is not an error.

Submitted-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
Take-from: FreeBSD

19 years agoRemove ATTY.
Matthew Dillon [Fri, 1 Oct 2004 20:30:25 +0000 (20:30 +0000)]
Remove ATTY.

Taken-from: FreeBSD

19 years agoVFS messaging/interfacing work stage 7a/99: Firm up stage 7 a bit by
Matthew Dillon [Fri, 1 Oct 2004 07:08:23 +0000 (07:08 +0000)]
VFS messaging/interfacing work stage 7a/99:  Firm up stage 7 a bit by
automatically vhold()ing any vnodes associated with a locked namecache
record.  This will prevent the vnode from being recycled (which would
unexpectedly cause the namecache entry to revert to an unresolved state
even while it is locked).

Previously only vnodes associated with namecache records with children
were being held (in order to guarentee that the vnode associated with the
parent directory of a locked leaf namecache record would stick around without
having to lock the parent directory's namecache record).

The point here being that we want to have to only lock and pass a single
namecache record to definitively identify an object in the namespace,
rather then the combination of directory and leaf nodes (and other junk)
that the old API required.  For example, the old RENAME API required 6
arguments (fdvp, fvp, fcnp, tdvp, tvp, tcnp) while the new one will only
require two arguments (fncp, tncp).