dragonfly.git
13 years agodevfs - Change setattr code to use vop_helper fns
Alex Hornung [Tue, 29 Mar 2011 09:06:29 +0000 (10:06 +0100)]
devfs - Change setattr code to use vop_helper fns

* Change the devfs vop_setattr to use the vop_helper functions for chown
  and chmod.

* This gets rid of the previous roll-your-own solution and fixes several
  edge cases.

* It also fixes a warning thrown by xterm when closing it.

Reported-by: luxh
13 years agombuf - Factor common code out of m_getjcl() and m_getcl().
Joe Talbott [Wed, 9 Mar 2011 15:01:47 +0000 (10:01 -0500)]
mbuf - Factor common code out of m_getjcl() and m_getcl().

13 years agombuf - Fix m_getjcl()'s size argument's type.
Joe Talbott [Tue, 8 Mar 2011 19:31:11 +0000 (14:31 -0500)]
mbuf - Fix m_getjcl()'s size argument's type.

Use size_t in both the declaration and definition of m_getjcl().

Reported-By: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
13 years agowpi(4) - Use MJUMPAGESIZE mbuf clusters.
Joe Talbott [Fri, 4 Mar 2011 12:31:05 +0000 (07:31 -0500)]
wpi(4) - Use MJUMPAGESIZE mbuf clusters.

Based-On: FreeBSD

13 years agombuf - Add MJUMPAGESIZE mbuf cluster support.
Joe Talbott [Fri, 4 Mar 2011 12:28:29 +0000 (07:28 -0500)]
mbuf - Add MJUMPAGESIZE mbuf cluster support.

This is needed by Intel WiFi chipsets which require larger than usual
clusters.

Revert MCLSHIFT back to 11 to reduce mbuf cluster space usage and make
non-Intel Wifi NICs work without needing to adjust MCLSHIFT.

13 years agoSync zoneinfo database with tzdata2011d from elsie.nci.nih.gov
Sascha Wildner [Tue, 15 Mar 2011 02:29:17 +0000 (03:29 +0100)]
Sync zoneinfo database with tzdata2011d from elsie.nci.nih.gov

australasia:    8.22 -> 8.23
etcetera:       8.2  -> 8.3
europe:         8.27 -> 8.28
northamerica:   8.41 -> 8.42

* australasia: Samoa's DST will end on April 2, instead of April 3, as
    previously assumed. Thanks to Raymond Hughes for information on the
    change.

* etcetera: Remove obsolete material on angle brackets in the TZ
    environment variable.

* europe: Due to a nationwide exam on March 27, Turkey will change into
    summer time zone one day later.

* northamerica: Cuba will start DST on March 20, one week later than
    previously assumed. Thanks to Steffen Thorsen for the first report
    of the change.

13 years agoSync zoneinfo database with tzdata2011c from elsie.nci.nih.gov
Sascha Wildner [Mon, 7 Mar 2011 15:08:41 +0000 (16:08 +0100)]
Sync zoneinfo database with tzdata2011c from elsie.nci.nih.gov

leapseconds:    8.10 -> 8.11
northamerica:   8.40 -> 8.41
southamerica:   8.44 -> 8.45
zone.tab:       8.40 -> 8.41

* leapseconds: Update notice from IERS (no leap second at the end of
    June 2011).

* northamerica: Replace Juneau (Alaska) with Juneau, Sitka and
    Metlakatla.

* southamerica: Delay the end of the Chilean DST in 2011 until the
    first Sunday in April.

* zone.tab:  Replace Juneau (Alaska) with Juneau, Sitka and
    Metlakatla.

13 years agoacpi(4): Always compile the files dealing with ACPI_DEBUG into the module.
Sascha Wildner [Wed, 2 Feb 2011 18:04:16 +0000 (19:04 +0100)]
acpi(4): Always compile the files dealing with ACPI_DEBUG into the module.

Before this commit, one had to define ACPI_DEBUG as a make variable to
enable debugging support in the module, such as in:

$ make -DACPI_DEBUG buildkernel

Specifying ACPI_DEBUG in the kernel config alone did not enable it, but
our modules are supposed to honor kernel options. Also this was contrary
to what the manual page says.

So to make this work for ACPI_DEBUG too, we just put all the affected
source files into SRCS and always compile them. #ifdef's in these
source files will take care of enabling/disabling debugging support
so a module compiled without ACPI_DEBUG defined in the kernel or on the
command line will still not have support after this commit (I've checked
with nm(1)).

The only change for someone not using ACPI_DEBUG is a little bit of
additional buildkernel time.

FWIW, it is the same way in FreeBSD, too.

Reported-by: Andrea Magliano <masterblaster@tiscali.it>
13 years agoacpi(4): Fix a bug in acpi_cpu_cstate.c (we have to write, and not to read).
Sascha Wildner [Wed, 9 Feb 2011 16:25:06 +0000 (17:25 +0100)]
acpi(4): Fix a bug in acpi_cpu_cstate.c (we have to write, and not to read).

Introduced with 10f976749fd9ad2e8642ea80ce533f7416910a65. The commit message
said "Sync ACPI with FreeBSD 7.2", even though FreeBSD 7.2 doesn't seem to
have this code at all, so I'm not sure about what the idea behind that
change was. I'm guessing it is a typo, since newer FreeBSDs call
AcpiWriteBitRegister() here too.

Reported-by: Andrea Magliano <masterblaster@tiscali.it>
13 years agoopenssl: Fix CVE-2011-0014.
Peter Avalos [Wed, 9 Feb 2011 05:16:20 +0000 (19:16 -1000)]
openssl:  Fix CVE-2011-0014.

13 years agoSync zoneinfo database with tzdata2011b from elsie.nci.nih.gov
Sascha Wildner [Mon, 7 Feb 2011 19:06:33 +0000 (20:06 +0100)]
Sync zoneinfo database with tzdata2011b from elsie.nci.nih.gov

northamerica:   8.39 -> 8.40
zone.tab:       8.38 -> 8.40

* northamerica: Add America/North_Dakota/Beulah (Mercer County,
    North Dakota, moved from Mountain to Central time at the
    end of DST in 2010). Also, use the actual version number
    rather than "%W%".

* zone.tab: Add America/North_Dakota/Beulah. Also, update
    Indonesian location names (with the old names retained in
    parentheses).

13 years agoUpdating pkgsrc target to pull 2010Q4.
Justin C. Sherrill [Sun, 6 Feb 2011 01:44:08 +0000 (17:44 -0800)]
Updating pkgsrc target to pull 2010Q4.

13 years agolibc - Fix bogus pthread_getspecific() return value due to bug in nmalloc
Matthew Dillon [Sun, 30 Jan 2011 21:44:11 +0000 (13:44 -0800)]
libc - Fix bogus pthread_getspecific() return value due to bug in nmalloc

* nmalloc was calling pthread_set_specific() prior to calling
  pthread_key_create(), causing it to use key 0 which might already
  have been allocated for other purposes.

* Reorder initializations in _nmalloc_thr_init() to solve the problem.

* This also solves certain application crashes (mail/milter-greylist).

Reported-by: Francois Tigeot <ftigeot@wolfpond.org>
13 years agoRevert "devfs: Populate si_umajor, too."
Sascha Wildner [Sat, 29 Jan 2011 07:26:26 +0000 (08:26 +0100)]
Revert "devfs: Populate si_umajor, too."

This reverts commit 2c2ab0446f99e9b6f7cae69d99b4491fdf60e6f3.

It was causing the read/write remount of the root filesystem
to fail upon booting. I'll investigate a better fix.

Reported-by: Rumko <rumcic@gmail.com>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1973>

13 years agofstat(1): Raise WARNS to 6 and fix all warnings.
Sascha Wildner [Fri, 28 Jan 2011 10:04:38 +0000 (11:04 +0100)]
fstat(1): Raise WARNS to 6 and fix all warnings.

13 years agofstat(1): Add devfs support.
Sascha Wildner [Fri, 28 Jan 2011 09:36:51 +0000 (10:36 +0100)]
fstat(1): Add devfs support.

13 years agodevfs: Populate si_umajor, too.
Sascha Wildner [Fri, 28 Jan 2011 08:55:18 +0000 (09:55 +0100)]
devfs: Populate si_umajor, too.

Pointed-out-by: alexh
13 years agoinstaller: Add /usr/pkg/etc to sources.conf.
Sascha Wildner [Thu, 27 Jan 2011 19:26:16 +0000 (20:26 +0100)]
installer: Add /usr/pkg/etc to sources.conf.

Previously, the installer did not copy this directory due to it being
on a separate (read/write) mount point and cpdup not crossing mount
point boundaries.

This should also fix (for newly installed systems) the XML catalog
problems various people were reporting.

A better solution would be to make the installer's installation
function to take this case into account.

Reported-by: Pierre Abbat <phma@phma.optus.ru>
13 years agokernel - Fix namecache memory exhaustion edge case
Matthew Dillon [Tue, 23 Nov 2010 07:24:25 +0000 (23:24 -0800)]
kernel - Fix namecache memory exhaustion edge case

* The namecache has traditionally relied on vnode limits to avoid
  blowing up its memory pool.  However, creating millions of hardlinks
  to the same vnode easily circumvents this assumption.

* Enhance the negative cache hysteresis code with a section for the
  positive cache that does the same thing, preventing the namecache
  from growing greater than 2x maxvnodes.

  This situation will not occur under normal operation, it is strictly
  for correctness.  The kernel should never panic on normal filesystem
  operations even if those operations are unrealistic.

* Tested w/HAMMER and a few million hardlinks to a single file.

Reported-by: Venkatesh Srinivas <me@acm.jhu.edu>
13 years agoSync zoneinfo database with tzdata2011a from elsie.nci.nih.gov
Sascha Wildner [Tue, 25 Jan 2011 01:34:41 +0000 (02:34 +0100)]
Sync zoneinfo database with tzdata2011a from elsie.nci.nih.gov

australasia:    8.20 -> 8.22
northamerica:   8.34 -> 8.39
Theory:         8.5  -> 8.6

* australasia: Simplification and gratuitous optimization of
    South Australia rules.

* northamerica: Changes to Hawaiian time history (from an article
    by Schmitt and Cox): abandoned local mean time in 1896 rather
    than 1900; used DST during World War II.

* Theory: Add section on scope of the database.

13 years agopthread.h: Fix prototypes.
Peter Avalos [Sat, 8 Jan 2011 01:36:38 +0000 (15:36 -1000)]
pthread.h: Fix prototypes.

We need to remove the condition of _POSIX_THREAD_PROCESS_SHARED for the
pshared prototypes.  Otherwise, programs have to include unistd.h (to
get the definition of _POSIX_THREAD_PROCESS_SHARED) before pthread.h.
This is not the way to do things.

This fixes at least kde4, and I'm sure there's others.

13 years ago<dev/netif/wi/if_wavelan_ieee.h>: Uncomment wi_req.
Sascha Wildner [Mon, 3 Jan 2011 06:39:17 +0000 (07:39 +0100)]
<dev/netif/wi/if_wavelan_ieee.h>: Uncomment wi_req.

This, in conjunction with a few patches I submitted to pkgsrc, will
eventually fix building the following packages:

net/gtk_wicontrol
net/wimon
net/wistumbler
net/wistumbler2
net/xfce4-wavelan-plugin (and thereby meta/xfce4-extras)

13 years agotmpfs - fix chgrp(), or chown() when one of uid/gid is to be unchanged
YONETANI Tomokazu [Mon, 22 Nov 2010 02:35:48 +0000 (11:35 +0900)]
tmpfs - fix chgrp(), or chown() when one of uid/gid is to be unchanged

uid/gid values from function arguments were being used instead of the ones
arranged by vop_helper_chown(), accidentally setting one of them to -1
(4294967295) instead of leaving it unchanged.

13 years agoHAMMER VFS - Fix HAMMER_INODE_XDIRTY flags / state assertion
Matthew Dillon [Sun, 28 Nov 2010 06:40:13 +0000 (22:40 -0800)]
HAMMER VFS - Fix HAMMER_INODE_XDIRTY flags / state assertion

* The HAMMER_INODE_XDIRTY flag was not being immediately synchronized
  with the state of ip->rec_tree in one case and the delay could create
  a window of opportunity where an assertion would get hit.

* Remove the window of opportunity, the assertion no longer gets hit.

Reported-by: YONETANI Tomokazu <qhwt.dfly@les.ath.cx>
13 years agokernel - Fix MP race in signotify_remote()
Matthew Dillon [Sun, 28 Nov 2010 06:27:10 +0000 (22:27 -0800)]
kernel - Fix MP race in signotify_remote()

* In rare cases it is possible for a process to hop multiple cpus while
  a signal is trying to chase the process.  Adjust signotify_remote() to
  deal with the case.

13 years agokernel - Fix NFS stall and likely also x86-64 seg-fault issue
Matthew Dillon [Sun, 28 Nov 2010 06:20:04 +0000 (22:20 -0800)]
kernel - Fix NFS stall and likely also x86-64 seg-fault issue

* The nfs node hash code was not MPSAFE due to its use of a global
  hash table.  This could lead to a stall condition due to the
  global hash table losing track of its manual lock.  For now use a
  token to interlock hash table access and replace the manual lock
  with a lockmgr lock.

* This appears to have also fixed the long-standing random seg-fault
  issue with x86-64, where a buildworld loop would seg-fault every once
  in a while for no apparent reason.  /usr/src on my test box has always
  been NFS mounted but was never considered a possible contributor to
  the problem.

  If NFS loses track of related nfs nodes or races operations on underlying
  vnodes while expecting their storage to remain stable it is possible
  for a random vnode to become corrupt.  How this could translate to a
  completely random seg-fault is not entirely understood but I surmise
  the unrelated cc1's binary mmap could become corrupt.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk> (nfs issue)
13 years agokernel - Hold vm_token() for certain buf/bio/vm_page interactions
Matthew Dillon [Sun, 28 Nov 2010 06:28:52 +0000 (22:28 -0800)]
kernel - Hold vm_token() for certain buf/bio/vm_page interactions

* Hold the vm_token when messing around with page valid and dirty bits
  in buffer cache operations.  Such race conditions are possible but would
  be very rare.

* Fix inconsistent use of bio2.bio_offset when swapcache intercepts an
  I/O operation.  When this case occurs the normal filesystem VOP_STRATEGY
  function will not be called and any assumption that bio2.bio_offset
  will represent a block device offset will be invalid.

  To deal with this case swapcache will re-set bio_offset to NOOFFSET.
  Filesystems use this value to determine that no block device offset
  has been cached for a logical file block.

Reported-by: Jan Lentfer <Jan.Lentfer@web.de> (bio_offset issue)
13 years agoarcmsr(4): Fix up the device description a bit.
Sascha Wildner [Tue, 23 Nov 2010 11:41:36 +0000 (12:41 +0100)]
arcmsr(4): Fix up the device description a bit.

13 years agoprintf(1): Fix the printing of floats which I broke back in 2007.
Sascha Wildner [Tue, 23 Nov 2010 09:33:41 +0000 (10:33 +0100)]
printf(1): Fix the printing of floats which I broke back in 2007.

I forgot braces in f386bcf2683a4edef25828e3958ba5b087d702d2

13 years agoOpenSSL: Reduce diffs to vendor source.
Peter Avalos [Sat, 20 Nov 2010 19:50:41 +0000 (09:50 -1000)]
OpenSSL: Reduce diffs to vendor source.

13 years agoMake OpenSSL thread-safe.
Peter Avalos [Sat, 20 Nov 2010 07:41:06 +0000 (21:41 -1000)]
Make OpenSSL thread-safe.

13 years agokbdmap(1): Fix a segmentation fault with -r.
Sascha Wildner [Sun, 21 Nov 2010 13:23:02 +0000 (14:23 +0100)]
kbdmap(1): Fix a segmentation fault with -r.

Reported-by: Mikael Moghadam <binarybusiness@gmail.com>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1918>

13 years agobuild - Fix IP_DIVERT w/UP build error
Matthew Dillon [Sun, 21 Nov 2010 02:09:23 +0000 (18:09 -0800)]
build - Fix IP_DIVERT w/UP build error

Reported-by: Stephane Russell <srussell@prodigeinfo.com>
13 years agoHAMMER: Deactivate dedup in 2.8.
Sascha Wildner [Sat, 20 Nov 2010 16:36:09 +0000 (17:36 +0100)]
HAMMER: Deactivate dedup in 2.8.

It was MFC'd due to suboptimal commit separation, so disallow access
to the HAMMERIOC_DEDUP ioctl in 2.8.

Also clarify this in the message we print when hammer(8) encounters
a <v5 file system.

Submitted-by: Ilya Dryomov <idryomov@gmail.com>
13 years agoMove net.wlan.force_swcrypto out of IEEE80211_DEBUG.
Sascha Wildner [Mon, 15 Nov 2010 20:08:30 +0000 (21:08 +0100)]
Move net.wlan.force_swcrypto out of IEEE80211_DEBUG.

This fixes kernel builds that don't have IEEE80211_DEBUG in the config
(such as SOEKRIS).

13 years agodummy commit
Matthew Dillon [Thu, 18 Nov 2010 17:45:52 +0000 (09:45 -0800)]
dummy commit

13 years agokernel - Fix global counter used in lockf assertions
Matthew Dillon [Thu, 18 Nov 2010 17:20:23 +0000 (09:20 -0800)]
kernel - Fix global counter used in lockf assertions

* lockf elements can be accessed MP.

* This may fix the 'panic: assertion: lf_global_counter>=0 in lf_destroy_range'
  panic.

Reported-by: Peter Avalos <peter@theshell.com>
13 years agoTemporarily bump the mbuf cluster size
Alex Hornung [Thu, 11 Nov 2010 16:21:10 +0000 (16:21 +0000)]
Temporarily bump the mbuf cluster size

* This solves issues with wpi. Once there is a different solution this
  can be reverted.

Suggested-by: Matthew Dillon (dillon@)
13 years agokernel - Add sysctl to bypass wifi chipset hardware crypto
Matthew Dillon [Sun, 14 Nov 2010 16:02:48 +0000 (08:02 -0800)]
kernel - Add sysctl to bypass wifi chipset hardware crypto

* Add sysctl net.wlan.force_swcrypto, default disabled.  If set to 1
  prior to attaching wlan to the underlying wireless interface this
  will force software crypto to be used and bypass the hardware
  crypto implemented by the wireless chipset.

* Currently we know there is at least one serious issue with the
  Atheros 9280 when used with WEP2 (shows up as RSN in list scan) + WPS,
  and possibly other combinations.  The wrong transmit key winds up
  being used for broadcast packets, including ARP.

* This sysctl works around the problem.  If your wpa_supplicant is able
  to connect to a network but you are unable to dhclient / use the
  network you might be hitting this problem and setting the sysctl to
  1 may fix it.

  Note that the sysctl must be set prior to attaching the wlan to the
  underlying wireless driver, so it is typically best to do it at boot
  time or near the top of whatever script you use.

Inspired-by: 2-days of connectivity issues at NYCBSDCON.
13 years agokernel - add kern.sysbeep_enable feature
Matthew Dillon [Sun, 14 Nov 2010 15:03:41 +0000 (07:03 -0800)]
kernel - add kern.sysbeep_enable feature

* Add a sysctl kern.sysbeep_enable (default on).  Setting this to 0
  will disable the system beep / bell.

* Useful when messing with a laptop in a conference, those beeps can
  get really annoying.

13 years agoHAMMER - Check if supplied conf file exists
Stathis Kamperis [Sat, 13 Nov 2010 16:40:48 +0000 (18:40 +0200)]
HAMMER - Check if supplied conf file exists

Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1911>

13 years agohammer.8: Add some words about HAMMER version 5 and about upgrading to it.
Sascha Wildner [Sat, 13 Nov 2010 12:59:18 +0000 (13:59 +0100)]
hammer.8: Add some words about HAMMER version 5 and about upgrading to it.

Submitted-by: Ilya Dryomov <idryomov@gmail.com>
13 years agokernel - Make sure invalidated pages are unmapped in rare situation.
Matthew Dillon [Thu, 11 Nov 2010 18:15:46 +0000 (10:15 -0800)]
kernel - Make sure invalidated pages are unmapped in rare situation.

* vfs_vmio_release() was ignoring pages busied by other MP users while
  releasing VM pages associated with the buffer cache.  This could
  potentially lead to invalida pages remaining memory mapped.

* Ensure that the released pages found to be in this state are still
  unmapped.

13 years agokernel - Close possible hole in hammer inval code
Matthew Dillon [Thu, 11 Nov 2010 18:12:59 +0000 (10:12 -0800)]
kernel - Close possible hole in hammer inval code

* Do not use FINDBLK_TEST, instead have findblk() return a locked buffer
  cache buffer and deal with it from there.  While the original code
  should have been ok (it would getblk() the buffer cache in either case),
  it depended on certain MP race characteristics that might not hold so
  don't take any chances.

* This does not fix any known issues but removes some uncertainty.

13 years agoHAMMER utility - Handle pruning when only snapshot meta-data present
Matthew Dillon [Wed, 10 Nov 2010 20:12:45 +0000 (12:12 -0800)]
HAMMER utility - Handle pruning when only snapshot meta-data present

* If only snapshot meta-data is present and no snapshot softlinks are found
  hammer prune (and hammer cleanup) previous exited with an error.  This case
  can occur when creating manual snapshot softlinks and/or trying to prune
  a slave PFS.

* In fact this is incorrect.  If meta-data is present we can prune based
  on that.

13 years agoHAMMER - Add hammer dedup directive and support
Matthew Dillon [Sun, 7 Nov 2010 18:03:03 +0000 (10:03 -0800)]
HAMMER - Add hammer dedup directive and support

* Adjust the utility to exit with an appropriate error if an
  attempt is made to dedup a filesystem which has not been upgraded
  to version 5.

13 years agoHAMMER - Add hammer dedup directive and support
Matthew Dillon [Sun, 7 Nov 2010 17:46:15 +0000 (09:46 -0800)]
HAMMER - Add hammer dedup directive and support

* Minor adjustments to fix compile errors on 64-bit systems
  (printf %lld -> %jd and use intmax_t casts).

13 years agoHAMMER - Add hammer dedup filesystem version dump
Matthew Dillon [Sun, 7 Nov 2010 17:43:08 +0000 (09:43 -0800)]
HAMMER - Add hammer dedup filesystem version dump

* Require a version 5 filesystem for dedup operation.  Upgrading can be done
  in-place.  All this does is make the layer2 bytes_free field a signed
  value instead of unsigned, allowing it to go negative.

  This allows dedup to use the field to account for multiple references to
  the same block of data, causing the field to (likely) go negative.

13 years agoHAMMER - Add hammer dedup directive and support
Matthew Dillon [Sun, 7 Nov 2010 17:29:39 +0000 (09:29 -0800)]
HAMMER - Add hammer dedup directive and support

* Implements all the logic required to dedup a HAMMER filesystem.

* There is one remaining issue and that is the reblocker's propensity to
  undo de-dup's hard work in certain cases.

* Code bounty for hammer_dedup

Submitted-by: Ilya Dryomov <idryomov@gmail.com>
13 years agolibutil - Add humanize_unsigned()
Matthew Dillon [Sun, 7 Nov 2010 17:20:11 +0000 (09:20 -0800)]
libutil - Add humanize_unsigned()

* Add a humanize_unsigned() function as a companion to humanize_number()
  which does a much better job on large unsigned 64-bit quantities.

Submitted-by: Ilya Dryomov <idryomov@gmail.com>
13 years agoUpdate build for OpenSSL-1.0.0b import.
Peter Avalos [Thu, 18 Nov 2010 05:57:01 +0000 (19:57 -1000)]
Update build for OpenSSL-1.0.0b import.

13 years agoMerge branch 'vendor/OPENSSL' into DragonFly_RELEASE_2_8
Peter Avalos [Thu, 18 Nov 2010 06:51:07 +0000 (20:51 -1000)]
Merge branch 'vendor/OPENSSL' into DragonFly_RELEASE_2_8

13 years agoImport OpenSSL-1.0.0b.
Peter Avalos [Thu, 18 Nov 2010 05:41:45 +0000 (19:41 -1000)]
Import OpenSSL-1.0.0b.

This primarily fixes CVE-2010-3864 and CVE-2010-2939.

13 years agoencrypted_root.sh: Fix a typo.
Sascha Wildner [Wed, 3 Nov 2010 20:30:03 +0000 (21:30 +0100)]
encrypted_root.sh: Fix a typo.

13 years agonetwork - Add initializer for ifnet.if_groups.
Joe Talbott [Wed, 3 Nov 2010 18:29:47 +0000 (14:29 -0400)]
network - Add initializer for ifnet.if_groups.

Prevents a NULL pointer dereference when pfsync is compiled into the
kernel.

Reported-By: mat on Efnet#dragonflybsd
Tested-By: mat on Efnet#dragonflybsd
13 years agolibstand - Fix CD9660 name matching code
Matthew Dillon [Tue, 2 Nov 2010 20:58:15 +0000 (13:58 -0700)]
libstand - Fix CD9660 name matching code

* The code inherited from FBsd did not properly deal with matching
  path elements after a '.'.  For example "kernel.FUBAR_XYZ" would match
  "kernel.FUBAR" on the CD.

* Fixed.

13 years agokernel - Reenable acpi sleep states
Matthew Dillon [Tue, 2 Nov 2010 20:36:46 +0000 (13:36 -0700)]
kernel - Reenable acpi sleep states

* Reenable acpi sleep state handling by default, by setting
  machdep.cpu_idle_hlt to 2 by default.

13 years agokernel - Attempt to fix lost rpc issue with NFS timeout/retry
Matthew Dillon [Tue, 2 Nov 2010 19:55:17 +0000 (12:55 -0700)]
kernel - Attempt to fix lost rpc issue with NFS timeout/retry

* An edge case in the timeout/retry code failed to pick up on
  async RPCs which are replied to while the timeout code has the
  rpc locked for retry.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
13 years agonetwork - Fix missing tailq initializer for if_creategroup() API
Matthew Dillon [Tue, 2 Nov 2010 17:12:14 +0000 (10:12 -0700)]
network - Fix missing tailq initializer for if_creategroup() API

* The ifg_head list was missing its initializer, causing calls to
  if_creategroup() (e.g. by pf/pfsync) to panic the box.

13 years agonetwork - Fix netstat output missing entries
Matthew Dillon [Tue, 2 Nov 2010 05:08:35 +0000 (22:08 -0700)]
network - Fix netstat output missing entries

* netstat was missing entries due to the kernel pcb listing sysctl
  code doing a bogus generation count test which did not take into
  account pcb's which move between cpus due to e.g. a bind() operation.

Reported-by: Thomas Nikolajsen <thomas.nikolajsen@mail.dk>
13 years agoMerge branch 'DragonFly_RELEASE_2_8' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Tue, 2 Nov 2010 05:11:59 +0000 (22:11 -0700)]
Merge branch 'DragonFly_RELEASE_2_8' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into DragonFly_RELEASE_2_8

13 years agodevfs - fix some issues with rules
Alex Hornung [Mon, 1 Nov 2010 20:38:14 +0000 (20:38 +0000)]
devfs - fix some issues with rules

* devfs_rule_alloc was still assuming that the rule_type and rule_cmd are not
  bit fields, but they now are.

* return error in a number of places when a null pointer or nil-length string
  is passed in.

Dragonfly-bug: http://bugs.dragonflybsd.org/issue1885
Reported-by: 'fanch'
13 years agoSync zoneinfo database with tzdata2010o from elsie.nci.nih.gov
Sascha Wildner [Mon, 1 Nov 2010 16:32:13 +0000 (17:32 +0100)]
Sync zoneinfo database with tzdata2010o from elsie.nci.nih.gov

australasia:    8.19 -> 8.20

* Fiji ends DST in 2011 on March 6 and not on March 27.

13 years agokernel - Fix access chceck in tmpfs that prevented chroot's into it
Matthew Dillon [Mon, 1 Nov 2010 16:29:31 +0000 (09:29 -0700)]
kernel - Fix access chceck in tmpfs that prevented chroot's into it

* Fix broken code which caused access() calls into tmpfs to assume
  write permission was being requested when it was not.

Submitted-by: Rumko <rumcic@gmail.com>
13 years agokernel - Do not back out critical section for exchange_scr() call
Matthew Dillon [Mon, 1 Nov 2010 02:38:46 +0000 (19:38 -0700)]
kernel - Do not back out critical section for exchange_scr() call

* The critical section may be protecting a spinlock and cannot be safely
  backed out when calling exchange_scr().

* Fixes a panic.

Reported-by: rob
13 years agokernel - Fix serious issue w/ smp_invltlb(), plus other issues (3)
Matthew Dillon [Sun, 31 Oct 2010 15:52:00 +0000 (08:52 -0700)]
kernel - Fix serious issue w/ smp_invltlb(), plus other issues (3)

* splz() and doreti on both i386 and x86_64 were leaving interrupts
  disabled through calls to e.g. sched_ithd() and IPI function callbacks.

  As before this can lead to a deadlock if these functions call
  smp_invltlb() or some other cpu calls smp_invltlb() while these
  functions are spinning on a full IPIQ.

* sti in appropriate places to fix the problem.

13 years agoloader(8): adjustment & man update
Thomas Nikolajsen [Sat, 30 Oct 2010 07:09:52 +0000 (09:09 +0200)]
loader(8): adjustment & man update

 * add/enhance info on if*/else*/endif
 * add info on default_kernel variable
 * include more variables in kenv_vars, including autoboot_delay,
   to make setting them in loader.conf work
 * remove a few unused variables

13 years agokernel - Fix longstanding VM long-duration stall issues (2)
Matthew Dillon [Sat, 30 Oct 2010 05:46:29 +0000 (22:46 -0700)]
kernel - Fix longstanding VM long-duration stall issues (2)

* Refactor the pageout daemon's hysteresis, in particular the
  free page queue had no real hysteressis and could cause excessive
  pagedaemon wakeups.

  Use a calculation that maintains a free page queue about half the
  size of the minimum cache queue, giving us pretty good pipelining
  when a system is under constant memory pressure.

* Add a sysctl for monitoring ppwakeups (wakeups of processes waiting
  for memory).

13 years agokernel - Fix longstanding VM long-duration stall issues
Matthew Dillon [Sat, 30 Oct 2010 03:58:00 +0000 (20:58 -0700)]
kernel - Fix longstanding VM long-duration stall issues

* The pageout daemon was using the wrong wakeup metrics and essentially
  would not start cleaning out pages until after processes began to
  enter vmwait/vmrate or otherwise begin to stall due to low free memory.

* Fix the metric and also double-check every 5 seconds when the pagedaemon
  statistics wakeup occurs.

* vm.v_free_min + vm.v_cache_min may now be used to tune when the
  pagedaemon is woken up.

13 years agodummy commit so a 2.8 commitid is at the top for tagging. v2.8.2
Matthew Dillon [Fri, 29 Oct 2010 06:27:32 +0000 (23:27 -0700)]
dummy commit so a 2.8 commitid is at the top for tagging.

13 years agonata - properly teardown interrupts on ENXIO
Matthew Dillon [Fri, 29 Oct 2010 06:23:48 +0000 (23:23 -0700)]
nata - properly teardown interrupts on ENXIO

* When a ata controller cannot be attached (e.g. due to AHCI having
  already taken its resources) be sure to teardown and release any
  resources that had been obtained.

* This fixes a panic on certain motherboards (e.g. gigabyte / phenomX6)
  where the ata controller ENXIO'd but left interrupt handlers setup.
  An interrupt would then occur, access stale memory, and blow the machine
  up.

13 years agoboot - Multiple changes to try to make cdboot work with more bioses
Matthew Dillon [Fri, 29 Oct 2010 04:33:15 +0000 (21:33 -0700)]
boot - Multiple changes to try to make cdboot work with more bioses

* Go back to single sector read.  This seems to help gigabyte bioses
  (phenom x 6).  Multi-sector reads tend to cause reads to fail with
  a timeout for reasons unknown.

* Enable interrupts on start.

* (non operator) replace jcxz.  It's a bit unclear whether this is an
  issue or not but some assemblers do not generate the correct prefix
  for jcxz.

* Report read timeouts and delay 1 second before retrying.  At the
  very least this allows timeouts to be reported distinctly.

13 years agonullfs - Add 'noexec' flag support.
Antonio Huete Jimenez [Mon, 25 Oct 2010 15:04:37 +0000 (17:04 +0200)]
nullfs - Add 'noexec' flag support.

* Make possible to mount a null-mount with 'noexec' option.

* If the underlying filesystem is mounted as 'noexec' and no options
were given at mount-time, the null mount will automatically
have 'noexec'.

Pointed-out-by: @dillon
13 years agonrelease gui - add xterm resources
Matthew Dillon [Thu, 28 Oct 2010 21:31:29 +0000 (14:31 -0700)]
nrelease gui - add xterm resources

* Add some resources for xterms

13 years agokernel - Fix serious issue w/ smp_invltlb(), plus other issues (2)
Matthew Dillon [Thu, 28 Oct 2010 19:36:32 +0000 (12:36 -0700)]
kernel - Fix serious issue w/ smp_invltlb(), plus other issues (2)

It looks like there are a number of additional cases where kernel threads
can wind up running with interrupts physically disabled, which can create
serious problems for smp_invltlb().

It is not entirely clear how these deadlocks occur since the IPI code does
a forced "STI" if it would otherwise loop, but there are several other
hard loops that do not:  lwkt_switch looping on a vm_token, spin locks,
and probably a few other places.

We want interrupts to be enabled in all cases where these sorts of loops
occur in order to be able to service Xinvltlb via smp_invltlb() as well
as to prevent the LAPIC interrupt queue from filling up and livelocking
something that it shouldn't.

* lwkt_preempt() must save, zero, and restore gd->gd_intr_nesting_level
  when issuing a preemption.  Otherwise it will improperly panic on
  an assertion if the preempting interrupt thread code tries to switch out.
  It is perfectly acceptable for the preempting thread to block (it just
  switches back to the thread that got preempted).

  Why the assertion was not occuring before I do not know but it is
  probably related to threads getting stuck in 'cli' mode.  The additional
  changes below appear to significantly increase the number of interrupt
  thread preemptions which succeed (lwkt.preempt_{hit,miss} counters).

* STI prior to running ithread_fast_handler() from all IDTVECs related
  to device interrupts.

* STI in Xcpustop, Xipiq, and Xtimer.  These functions can call more
  complex C code and doing so with interrupts disabled may prevent
  Xinvltlb (via smp_invltlb()) from being executed, deadlocking the
  system.

* Reorder a mfence().  Probably not needed but do it anyway.

13 years agokernel - Fix serious issue w/ smp_invltlb(), plus other issues.
Matthew Dillon [Thu, 28 Oct 2010 06:55:58 +0000 (23:55 -0700)]
kernel - Fix serious issue w/ smp_invltlb(), plus other issues.

* smp_invltlb() was running asynchronously when it really needs to run
  synchronously.  Generally speaking the asynchronous ipi did in fact work
  pretty well but it still presents a 1uS window of opportunity which
  bypasses normal write ordering safeties.

  Run smp_invltlb() synchronously.

* Fixing the above lea to the discovery of an ACPI issue.  The ACPI
  cpu idle halt code, at least on the gigabyte phenom x 6 I've been
  testing with, can cause IPIs to be lost.  Not just delayed, straight
  out lost.  Gone.  Poof.  It doesn't matter whether the IPI is a
  broadcast IPI or a directed IPI, it can still get lost.

  This was particularly noticeable when I fixed smp_invltlb() and my
  test box started locking up due to a random cpu sometimes not receiving
  the Xinvltlb IPI, and it is quite possible that this issue was also
  responsible for the random seg-faults we would sometimes get on 64-bit
  boxes.

  For now the acpi halt code has been disabled.  It can be enabled with
  sysctl machdep.cpu_idle_hlt=2 if you want to risk it.

* Use doreti_syscall_ret and doreti_iret in several cases that were
  previously popping the interrupt frame and iret'ing manually.  This
  is operationally equivalent.

* Add a missing "sti" in the idle loop.  Usually the cpu_idle_hook()
  deals with this but there are some alternative paths which might not,
  potentially causing interrupts to be delayed unnecessarily.
  At worst the idle thread has an extra sti in it.

* Add v_smpinvltlb to struct vmmeter, plus some reserved slots for
  future expansion.

* Adjust vmstat -s to report smpinvltlb's.

13 years agoMerge branch 'DragonFly_RELEASE_2_8' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Thu, 28 Oct 2010 21:16:58 +0000 (14:16 -0700)]
Merge branch 'DragonFly_RELEASE_2_8' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into DragonFly_RELEASE_2_8

13 years agonrelease: Add two options (dri and inet6) to the default mk.conf we supply.
Sascha Wildner [Thu, 28 Oct 2010 20:19:12 +0000 (22:19 +0200)]
nrelease: Add two options (dri and inet6) to the default mk.conf we supply.

We use them for building the packages that go to the LiveCD.

However, we don't add PKG_OPTIONS.scmgit=-scmgit-gui (used for the LiveCD's
scmgit to save space). So people who want to continue using git without X11
support will need to tweak mk.conf like before.

13 years agonrelease/installer: Rename the UP/SMP kernel directories on the LiveCD.
Sascha Wildner [Thu, 28 Oct 2010 19:43:27 +0000 (21:43 +0200)]
nrelease/installer: Rename the UP/SMP kernel directories on the LiveCD.

Changed from UP -> kernel.UP and from SMP -> kernel.SMP.

Requested-by: dillon
13 years agoinstaller: Install the kernel used to install the system to /boot/kernel.
Sascha Wildner [Wed, 27 Oct 2010 07:08:48 +0000 (09:08 +0200)]
installer: Install the kernel used to install the system to /boot/kernel.

We assume that the kernel the user booted the LiveCD/image with for
installing his system will be the kernel he wants to boot the system
from, too.

13 years agonrelease: Fix an annoying bug that was preventing the ISOs from booting UP.
Sascha Wildner [Wed, 27 Oct 2010 07:07:13 +0000 (09:07 +0200)]
nrelease: Fix an annoying bug that was preventing the ISOs from booting UP.

It seems our CD9660 support in libstand at least has some problems with
directory names containing dots. This prevented the LiveCD to properly
boot the UP kernel. Don't ask me about how it ended up using the SMP
kernel in this case, but that's what it did, making the UP boot
impossible. My guess is it has something to do with the order in which
stuff had been added to the ISO. But that's pure speculation. I'm not
even sure about the dot part. It might as well be directory name length.
In any case, UP boot from the LiveCD was broken.

To fix all this, install the UP kernel to /boot/UP and the SMP kernel to
/boot/SMP on the LiveCD and images. They will be picked up by the
installer from there by a separate commit.

While here, remove some non-functional code from dloader.menu. We can't
easily build i386/x86_64 dual boot ISOs at the moment (for this we would
need cross-building pkgsrc).

Thanks to sjg for bringing me on the right track.

13 years agoinstaller: Add __printflike()s and fix resulting format warnings.
Sascha Wildner [Wed, 27 Oct 2010 04:56:42 +0000 (06:56 +0200)]
installer: Add __printflike()s and fix resulting format warnings.

13 years agonrelease: Add a missing semicolon.
Sascha Wildner [Wed, 27 Oct 2010 01:45:43 +0000 (03:45 +0200)]
nrelease: Add a missing semicolon.

13 years agonrelease: Remove unused variable.
Sascha Wildner [Tue, 26 Oct 2010 18:29:18 +0000 (20:29 +0200)]
nrelease: Remove unused variable.

13 years agodloader: Fix error messages.
Sascha Wildner [Tue, 26 Oct 2010 17:20:39 +0000 (19:20 +0200)]
dloader: Fix error messages.

13 years agozic(8): Sync with tzcode2010n from elsie.nci.nih.gov
Sascha Wildner [Tue, 26 Oct 2010 13:24:31 +0000 (15:24 +0200)]
zic(8): Sync with tzcode2010n from elsie.nci.nih.gov

* Conditionally output extra types with most-recently-used offsets last
  (for use by systems with pre-2011 versions of localtime.c, helping to
  ensure that globals "altzone" and "timezone" get set correctly).

* Fix generation of POSIX strings for zones with rules using
  "weekday<=n" forms of dates (thanks to Lei Liu for finding the
  problem). Also, limit output for non-POSIX-specificable zones defined
  to follow the same rules every year. (Note that no zones of either of
  the above types appear in the distribution; these changes cater to
  add-on zones).

13 years agolibc/stdtime: Sync localtime.c with tzcode2010n from elsie.nci.nih.gov
Sascha Wildner [Tue, 26 Oct 2010 13:20:01 +0000 (15:20 +0200)]
libc/stdtime: Sync localtime.c with tzcode2010n from elsie.nci.nih.gov

* Change to set timezone and altzone based on time types with greatest
  transition times (for the benefit of Asia/Seoul).

* Initialize ttinfo structures filled by tzparse (thanks to Ravindra
  for reporting a valgrind warning).

13 years agoSync zoneinfo database with tzdata2010n from elsie.nci.nih.gov
Sascha Wildner [Tue, 26 Oct 2010 13:14:11 +0000 (15:14 +0200)]
Sync zoneinfo database with tzdata2010n from elsie.nci.nih.gov

Theory:         8.4  -> 8.5
asia:           8.61 -> 8.62
australasia:    8.18 -> 8.19
factory:        8.2  -> n/a
zone.tab:       8.37 -> 8.38

* Remove the 'factory' file and references to it. It is no longer needed.

* asia: No DST in Hong Kong in 1977 (thanks to Jesper Norgaard for
    finding the problem).

* australasia: Change end of DST in Samoa in 2011 from 2011-04-03 0:00 to
    2011-04-03 1:00 (thanks to Raymond Hughes for a reference).

* zone.tab: Remove obsolete association of Vostok Station with South
    Magnetic Pole; add association with Lake Vostok (thanks to
    Petr Machata for finding the problem).

13 years agonrelease - gui - Change window manager, cpdup additional directories
Matthew Dillon [Mon, 25 Oct 2010 23:33:01 +0000 (16:33 -0700)]
nrelease - gui - Change window manager, cpdup additional directories

* Change to fvwm2

* Autostart two xterms and clocks

* Add simple button bar with two buttons 'xterm' and 'firefox'.

* Installer now also installs /usr/src and /usr/pkgsrc from the stick.

13 years agonrelease - Provide default /etc/X11, better rc.conf
Matthew Dillon [Mon, 25 Oct 2010 22:12:06 +0000 (15:12 -0700)]
nrelease - Provide default /etc/X11, better rc.conf

* Don't make users agonize over /etc/X11, provide one even if we aren't
  the gui.  Also provide it in /etc.hdd so it gets installed onto the
  HD.

* This also fixes the problem where the gui install was failing to install
  /etc/X11 onto the HD.

* The normal and gui installs were not installing reasonable rc.conf
  defaults.  Do so.

13 years agonrelease - gui build adjustments
Matthew Dillon [Mon, 25 Oct 2010 20:46:13 +0000 (13:46 -0700)]
nrelease - gui build adjustments

* Remove packages that failed to build.  Unfortunately rxvt was one of them.
  Note that I did some manual build hacks to other packages to build
  which aren't committed to pkgsrc.

* Fix size calculation for usb disk img.

* Adjust fluxbox menu firefox3->firefox and urxvt->xterm.

13 years agobuild - define struct in6_addr in arpa/inet.h
Matthew Dillon [Mon, 25 Oct 2010 18:35:44 +0000 (11:35 -0700)]
build - define struct in6_addr in arpa/inet.h

* Use the same mechanic used for struct in_addr to define in6_addr in
  arpa/inet.h, conditionalizing the define in in6.h.

* This helps w/pkgsrc builds.

13 years agodummy commit so a 2.8 commitid is at the top for tagging. v2.8.1
Matthew Dillon [Mon, 25 Oct 2010 02:37:25 +0000 (19:37 -0700)]
dummy commit so a 2.8 commitid is at the top for tagging.

13 years agonrelease - installer - Use different emergency interrupt mechanic
Matthew Dillon [Mon, 25 Oct 2010 02:35:16 +0000 (19:35 -0700)]
nrelease - installer - Use different emergency interrupt mechanic

* Use a tuneable instead of a sysctl.

13 years agoehci - add missing dependency on usb driver
YONETANI Tomokazu [Mon, 25 Oct 2010 01:51:35 +0000 (10:51 +0900)]
ehci - add missing dependency on usb driver

13 years agodocs - update tuning(7)
Matthew Dillon [Mon, 25 Oct 2010 01:23:45 +0000 (18:23 -0700)]
docs - update tuning(7)

* Get rid of a ton of old cruft that no longer applies and replace with
  more applicable information.

13 years agoFix typo in argv handling.
Antonio Huete Jimenez [Sun, 24 Oct 2010 22:59:45 +0000 (00:59 +0200)]
Fix typo in argv handling.

13 years agokernel - Temporarily back-out smp_invltlb() changes
Matthew Dillon [Sun, 24 Oct 2010 22:29:00 +0000 (15:29 -0700)]
kernel - Temporarily back-out smp_invltlb() changes

* These changes are deadlocking i386 kernels, and it is too close to
  the release so back them out for the release.  The issue will be
  fixed another way post-release.

13 years agokernel - Fix bug in the emergency interrupt polling thread
Matthew Dillon [Sun, 24 Oct 2010 22:27:14 +0000 (15:27 -0700)]
kernel - Fix bug in the emergency interrupt polling thread

* This thread is only active when kern.emergency_intr_enable is non-zero

* Get the next intr handler before processing the current one, since the
  act of processing the current handler may remove it.

* In the emergency interrupt polling thread do not stall if we cannot get
  the serializer for the interrupt.  just skip the handler and we'll try
  again next time.

13 years agosysctl.conf - Enable emergency interrupt polling at a low rate by default
Matthew Dillon [Sun, 24 Oct 2010 18:29:22 +0000 (11:29 -0700)]
sysctl.conf - Enable emergency interrupt polling at a low rate by default

* Set kern.emergency_intr_enable=1 in the ISO/IMG sysctl.conf for
  newly installed kernels.  The idea is so people can get things working
  more quickly and worry about performance afterwords.

* This commit actually got into the previous commit accidently so I am
  posting a following commit so we get a proper comment associated with it.