dragonfly.git
11 years agohptmv(4): Reduce si_iosize_max to 64KB.
Sascha Wildner [Thu, 2 Aug 2012 22:42:39 +0000 (00:42 +0200)]
hptmv(4): Reduce si_iosize_max to 64KB.

This fixes busdma panics we were getting with it.

busdma-clue-by: sephe

11 years agokernel/cam: Make si_iosize_max overridable by drivers.
Sascha Wildner [Thu, 2 Aug 2012 22:14:28 +0000 (00:14 +0200)]
kernel/cam: Make si_iosize_max overridable by drivers.

11 years agogcore(1): Make it work again.
Sascha Wildner [Sat, 28 Jul 2012 20:29:43 +0000 (22:29 +0200)]
gcore(1): Make it work again.

Two commits broke things:

64fce751acfda11e21846e900fc774e88f32f52e which changed us to no longer
claiming that we're FreeBSD in core files.

0b684e3f9af3abc5ded676c43a1a5a478b45325c which added another field to
/proc/<pid>/map (the vnode path for vn-backed vm objects).

Both changes need adjustments in gcore(1).

11 years agorc.d/netif: Require cleanvar.
Sascha Wildner [Tue, 24 Jul 2012 21:19:23 +0000 (23:19 +0200)]
rc.d/netif: Require cleanvar.

Before the ipfilter removal, netif required ipfilter, which required
ipmon, which required cleanvar. In other words, cleanvar was run before
netif.

With the ipfilter requirement removed from netif, cleanvar was now
ordered at some place after netif, which caused the PID file and
control socket of wpa_supplicant(8) (which is started by netif if an
ifconfig_xxx="WPA" line is found in /etc/rc.conf) to be removed from
/var/run by cleanvar after they were created.

This caused trouble for wpa_cli(8), which needs the socket.

Found-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
11 years agolapic: Allow lapic enumeration to fail
Sepherosa Ziehau [Fri, 20 Jul 2012 02:59:08 +0000 (10:59 +0800)]
lapic: Allow lapic enumeration to fail

It is mainly used to workaround for some old brain dead BIOS, which
will set BSP's LAPIC apic id to 255, but all MADT LAPIC entries are
valid

Reported-by: klanger on #dragonflybsd
11 years agoapic: APIC ID should not be 255, which is used for broadcast
Sepherosa Ziehau [Fri, 20 Jul 2012 02:31:04 +0000 (10:31 +0800)]
apic: APIC ID should not be 255, which is used for broadcast

11 years agoaic7xxx: fix a pointer sign warning
François Tigeot [Mon, 23 Jul 2012 07:29:25 +0000 (09:29 +0200)]
aic7xxx: fix a pointer sign warning

11 years agoSync zoneinfo database with tzdata2012d from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Fri, 20 Jul 2012 08:22:22 +0000 (10:22 +0200)]
Sync zoneinfo database with tzdata2012d from ftp://ftp.iana.org/tz/releases

* Removes the SCCS IDs

* africa: Morocco does not observe DST from Jul 20 03:00 to Aug 20 02:00.

11 years agoMerge remote-tracking branch 'crater/DragonFly_RELEASE_3_0' into rel3_0
Thomas Nikolajsen [Sat, 14 Jul 2012 09:08:13 +0000 (11:08 +0200)]
Merge remote-tracking branch 'crater/DragonFly_RELEASE_3_0' into rel3_0

11 years agokernel - Fix MP race in sysv semaphore code (2)
Matthew Dillon [Thu, 12 Jul 2012 02:50:13 +0000 (19:50 -0700)]
kernel - Fix MP race in sysv semaphore code (2)

* Add missing changes to proc.h

Reported-by: sephe
11 years agox86_64 FPU: Set 64-bit precision for fadd/fsub/fsqrt etc.
John Marino [Thu, 12 Jul 2012 11:15:12 +0000 (13:15 +0200)]
x86_64 FPU: Set 64-bit precision for fadd/fsub/fsqrt etc.

On AMD64, GCC and the ABI expects the x87 unit to be running in 80/64
mode rather than 64/53 mode seen on i386.  This corrects errors seen
in long double tests involving runtime calculations.  Previously, the
results of these runtime calculations would get rounded due to use
of 53-bit mantissas.

11 years agokernel - Fix MP race in sysv semaphore code
Matthew Dillon [Wed, 11 Jul 2012 22:29:55 +0000 (15:29 -0700)]
kernel - Fix MP race in sysv semaphore code

* Fix a serious MP race in the sysv semaphore code due to a lack of
  protection of the semu* global structures.

* The race occurs during semaphore allocation and deallocation vs ANY
  exiting process (even if it does not use semaphores), potentially
  leading to a live-lock in the semu_list scan code.

  The live-lock will prevent the cpu it occurs on from being able to
  switch to another kernel or user thread.  In the sample case it
  stopped pagedaemon from running, creating a backlog in the I/O
  subsystem which locked the computer up.

Reported-by: Peter Avalos
11 years agosysctl(8): Fix handling of uquad type sysctls (wrong variable was taken).
Sascha Wildner [Thu, 12 Jul 2012 11:11:37 +0000 (13:11 +0200)]
sysctl(8): Fix handling of uquad type sysctls (wrong variable was taken).

11 years agotwa(4)/twe(4): Move dev_ops_remove_minor() after destroy_dev().
Sascha Wildner [Sun, 8 Jul 2012 23:07:10 +0000 (01:07 +0200)]
twa(4)/twe(4): Move dev_ops_remove_minor() after destroy_dev().

Fixes crash on module unload.

11 years agotwa(4): Pass INTR_MPSAFE when setting up the interrupt.
Sascha Wildner [Sun, 8 Jul 2012 20:39:48 +0000 (22:39 +0200)]
twa(4): Pass INTR_MPSAFE when setting up the interrupt.

I removed it by mistake during porting.

While here, add some little fixes from FreeBSD.

Tested-with: 3ware 9650SE-2LP

11 years agosdpd(8): Fix a wrong sizeof.
Sascha Wildner [Fri, 6 Jul 2012 12:09:49 +0000 (14:09 +0200)]
sdpd(8): Fix a wrong sizeof.

11 years agokernel/sbuf: Add back a lost newline.
Sascha Wildner [Thu, 5 Jul 2012 19:16:18 +0000 (21:16 +0200)]
kernel/sbuf: Add back a lost newline.

11 years agosbuf_vprintf: ap is not consistent at second call of kvsnprintf. Use a copy
Mihai Carabas [Sun, 1 Jul 2012 19:18:25 +0000 (22:18 +0300)]
sbuf_vprintf: ap is not consistent at second call of kvsnprintf. Use a copy

11 years agoFix more wrong sizeof() usages, part 4/x
Sascha Wildner [Sat, 30 Jun 2012 08:44:33 +0000 (10:44 +0200)]
Fix more wrong sizeof() usages, part 4/x

We want struct sizes here, not pointer sizes.

Found-with: Coccinelle (http://coccinelle.lip6.fr/)

11 years agontfs - Set CNP_PDIRUNLOCK flag if we unlock the parent dir.
Antonio Huete Jimenez [Tue, 19 Jun 2012 22:05:41 +0000 (00:05 +0200)]
ntfs - Set CNP_PDIRUNLOCK flag if we unlock the parent dir.

If we unlocked the parent dir, we must specify it via CNP_PDIRUNLOCK
flag to avoid further vn_unlock attempts.

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2388

Reported by: swildner, Raimundo Santos

11 years agoFix more wrong sizeof() usages, part 3/x
Sascha Wildner [Thu, 21 Jun 2012 02:25:19 +0000 (04:25 +0200)]
Fix more wrong sizeof() usages, part 3/x

Some comments:

* The gzip fix speeds up uncompression of compress(1)'d files with gzip.
  A test here took 9s with the fix when it previously took 15s.

* Our OpenSSH is without J-PAKE support, hence the OpenSSH fix is only
  cosmetical.

Found-with: Coccinelle (http://coccinelle.lip6.fr/)

11 years agocryptdisks(8): Fix a wrong sizeof.
Sascha Wildner [Mon, 18 Jun 2012 06:35:20 +0000 (08:35 +0200)]
cryptdisks(8): Fix a wrong sizeof.

Use the size passed to the alloc_safe_mem() here.

Found-with: Coccinelle (http://coccinelle.lip6.fr/)

11 years agovkernel: revert two commits that break i386 vkernel
Markus Pfeiffer [Sun, 17 Jun 2012 19:38:49 +0000 (19:38 +0000)]
vkernel: revert two commits that break i386 vkernel

revert i386 parts of
  commit c55fa5eeab3eaf11e01222d6412b91dafdcd9e94
  commit 1a482e3fea833c34264b54d566ddd0f4276d8bcf
because it breaks build. This is still a kludge.

11 years agohammer(8): Fix a wrong sizeof.
Sascha Wildner [Sun, 17 Jun 2012 19:21:15 +0000 (21:21 +0200)]
hammer(8): Fix a wrong sizeof.

Use the size passed to the malloc() here.

Found-with: Coccinelle (http://coccinelle.lip6.fr/)

11 years agoFix more wrong sizeof() usages, part 2/x
Sascha Wildner [Sun, 17 Jun 2012 01:28:37 +0000 (03:28 +0200)]
Fix more wrong sizeof() usages, part 2/x

Take the size of the struct instead of the size of its address.

Found-with: Coccinelle (http://coccinelle.lip6.fr/)

11 years agosavecore(8): Use the buf's size and not char *'s size for reading the kernel.
Sascha Wildner [Sat, 16 Jun 2012 23:42:28 +0000 (01:42 +0200)]
savecore(8): Use the buf's size and not char *'s size for reading the kernel.

This speeds up the kernel saving part by a couple of seconds.

11 years agoFix more wrong sizeof() usages, part 1/x
Sascha Wildner [Sat, 16 Jun 2012 10:31:23 +0000 (12:31 +0200)]
Fix more wrong sizeof() usages, part 1/x

These cases should all be taking the size of the pointed to struct etc.,
instead of the pointer size.

Found-with: Coccinelle (http://coccinelle.lip6.fr/)

11 years agovkernel/vkernel64: fix a bug in cpu_regs.c
Markus Pfeiffer [Sat, 16 Jun 2012 11:20:58 +0000 (11:20 +0000)]
vkernel/vkernel64: fix a bug in cpu_regs.c

followup to the previous typo which was repeated in the handling
of old FreeBSD style arguments.

11 years agovkernel/vkernel64: fix a bug in cpu_regs.c
Markus Pfeiffer [Sat, 16 Jun 2012 10:52:43 +0000 (10:52 +0000)]
vkernel/vkernel64: fix a bug in cpu_regs.c

the sendsig function incorrectlty delivered tf_err in the
si_addr field of siginfo leading to weird behaviour.

11 years agotimed(8): Add missing braces.
Sascha Wildner [Thu, 14 Jun 2012 17:29:07 +0000 (19:29 +0200)]
timed(8): Add missing braces.

11 years agoarcmsr(4): To check for sense data, use sense_len.
Sascha Wildner [Sat, 9 Jun 2012 07:56:39 +0000 (09:56 +0200)]
arcmsr(4): To check for sense data, use sense_len.

Checking the address of a variable or field is going to be always true.

11 years agore: Fix size of the bcopy when extracting ethernet address
Sepherosa Ziehau [Mon, 11 Jun 2012 08:30:49 +0000 (16:30 +0800)]
re: Fix size of the bcopy when extracting ethernet address

Reported-by: swildner@
11 years agokernel/ufs: Bring in a fix to ufsdirhash_hash() from FreeBSD.
Sascha Wildner [Sun, 10 Jun 2012 02:31:33 +0000 (04:31 +0200)]
kernel/ufs: Bring in a fix to ufsdirhash_hash() from FreeBSD.

"When looking for some extra data to include in the hash, use the
 address of the dirhash, rather than the first sizeof(struct dirhash *)
 bytes of the structure (which, thankfully, seem to be constant)."

While here, fix some typos in the comment.

In-discussion-with: thesjg, vsrinivas

11 years agoFix two wrong sizeof() usages.
Sascha Wildner [Sat, 9 Jun 2012 09:04:18 +0000 (11:04 +0200)]
Fix two wrong sizeof() usages.

It should be taking the size of the variable the pointer points to,
instead of the size of the pointer itself.

11 years agoFix for password truncation when using crypt(3) with DES
Aggelos Economopoulos [Wed, 30 May 2012 14:03:21 +0000 (16:03 +0200)]
Fix for password truncation when using crypt(3) with DES

Passwords containing a 0x80 byte (UTF-8 encoded ones, ASCII and
ISO-8859-* not affected) would get truncated as if a '\0' byte
had been encountered. This could result in some very weak passwords.

Reported-by: Rubin Xu, Joseph Bonneau, Donting Yu (CVE-2012-2143)
11 years agokernel/linux: Fix a wrong cast (introduced in e54488bb).
Sascha Wildner [Wed, 23 May 2012 19:28:32 +0000 (21:28 +0200)]
kernel/linux: Fix a wrong cast (introduced in e54488bb).

11 years agotcp: Ignore TCP_NOPUSH socketopt by default
Sepherosa Ziehau [Thu, 17 May 2012 09:58:41 +0000 (17:58 +0800)]
tcp: Ignore TCP_NOPUSH socketopt by default

For ill optimized programs which misuses this sockopt will cause
unpredicted length of network stalling, if the total sending size
is not TCP sending segment size aligned.

sysctl node net.inet.tcp.disable_nopush controls whether TCP_NOPUSH
will take effect or not

I am not going to fight agaist the stupid programs in the wild.

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2368

This is actually _not_ a bug on our side.

11 years agoUpdate to OpenSSL-1.0.0j.
Peter Avalos [Sun, 13 May 2012 20:22:28 +0000 (13:22 -0700)]
Update to OpenSSL-1.0.0j.

This diverges from master, but I thought it was important to get the
latest updates to the 1.0.0 version that's still in
DragonFly_RELEASE_3_0.

      o Fix DTLS record length checking bug CVE-2012-2333
      o Fix for ASN1 overflow bug CVE-2012-2110
      o Fix for CMS/PKCS#7 MMA CVE-2012-0884
      o Corrected fix for CVE-2011-4619
      o Various DTLS fixes.

11 years agomake upgrade: Now that we have devfs, don't try to remove any /dev/*
Sascha Wildner [Fri, 4 May 2012 19:15:54 +0000 (21:15 +0200)]
make upgrade: Now that we have devfs, don't try to remove any /dev/*

11 years agodevelopment.7: Fix the git documentation URL.
Sascha Wildner [Mon, 7 May 2012 13:02:20 +0000 (15:02 +0200)]
development.7: Fix the git documentation URL.

Reported-by: Joachim de Groot <jdegroot@web.de>
11 years agoHAMMER VFS - Only set B_CLUSTEROK on 64K buffers
Matthew Dillon [Mon, 30 Apr 2012 22:48:32 +0000 (15:48 -0700)]
HAMMER VFS - Only set B_CLUSTEROK on 64K buffers

* Only set B_CLUSETEROK on 64K buffers.  This should fix a fairly rare
  panic related to buffer size mismatches due to the bufdaemon crossing
  the 16K/64K buffer size boundary when clustering buffers.

11 years agokernel - Fix degenerate cluster_write() cases
Matthew Dillon [Mon, 30 Apr 2012 22:44:53 +0000 (15:44 -0700)]
kernel - Fix degenerate cluster_write() cases

* cluster_write() should bdwrite() as a fallback, not bawrite().

  Note that cluster_awrite() always bawrite()'s or equivalent.  The
  DragonFly API split the functions out, so cluster_write() can now
  almost always bdwrite() for the non-clustered case.

* Solves some serious performance and real-time disk space usage issues
  when HAMMER1 was updated to use the cluster calls.  The disk space
  would be recovered by the daily cleanup but the extra writes could
  end up being quite excessive, 25:1 unnecessary writes vs necessary
  writes.

Reported-by: multiple, testing by tuxillo
11 years agokill zombies if the parent set SIG_IGN on SIGCHLD
Matthias Rampke [Tue, 17 Apr 2012 21:33:16 +0000 (23:33 +0200)]
kill zombies if the parent set SIG_IGN on SIGCHLD

fix for http://bugs.dragonflybsd.org/issues/2349

Conflicts:

sys/sys/param.h

11 years agokernel -- ffs: Soft updates locking fixes
Venkatesh Srinivas [Sun, 22 Apr 2012 03:05:06 +0000 (20:05 -0700)]
kernel -- ffs: Soft updates locking fixes

1) Do not take mplock in bioops callbacks; the lock was no longer synchronizing
   against mainline code.

2) Do not hold softdep lock around bwillinode()

3) Take softdep lock in softdep_process_worklist bioops callback. This callback
   was previously using the mplock for synchronization (insufficiently!)

4) Modify process_worklist_item to expect the softdep lock to be held on
   entry and release it at appropriate times.

Prevents a panic seen when running fsstress on a UFS+softdep fs, where fsync
finds a null buffer on vnode trees. This arose from a front-end/back-end
race in softdep_process_worklist.

11 years agoHAMMER VFS - Fix assertion with multi-volume setup
Matthew Dillon [Sun, 1 Apr 2012 01:35:33 +0000 (18:35 -0700)]
HAMMER VFS - Fix assertion with multi-volume setup

* The RB compare code for hammer_io was extracting the volume number
  from the wrong place, creating a situation where duplicate hammer_io's
  would sometimes be inserted in the RB tree (causing an assertion + panic).

* Pull the volume number from a different field.

Reported-by: Mark Saad <nonesuch@longcount.org>
11 years agokernel -- vm_pageout: Handle pages w/ NULL vm_objects on the act/in pageqs.
Venkatesh Srinivas [Sat, 21 Apr 2012 18:40:41 +0000 (11:40 -0700)]
kernel -- vm_pageout: Handle pages w/ NULL vm_objects on the act/in pageqs.

vm_page_unwire could end up putting pages w/ NULL object fields onto the
active or inactive page queues. Allow the active/inactive scans to deal with
these pages rather than panic-ing. This pages can be disposed of normally.

Closes-bug: 2338
Suggested-by: dillon
Reported-by: sephe, JustinS
11 years agomake upgrade: Don't remove /var/heimdal.
Sascha Wildner [Sat, 28 Apr 2012 11:41:10 +0000 (13:41 +0200)]
make upgrade: Don't remove /var/heimdal.

pkgsrc's heimdal package will create it, too.

11 years agomsgport: Implement dropmsg for spin port
Sepherosa Ziehau [Sat, 28 Apr 2012 01:45:54 +0000 (09:45 +0800)]
msgport: Implement dropmsg for spin port

DragonFly-bug: http://bugs.dragonflybsd.org/issues/2354

12 years agopthread_join(3): If the target thread is detached, return EINVAL.
Sascha Wildner [Sat, 21 Apr 2012 10:17:07 +0000 (12:17 +0200)]
pthread_join(3): If the target thread is detached, return EINVAL.

We were returning ESRCH previously, which is wrong, as it indicates
that the thread could not be found. Fix this in both libthread_xu
and libc_r.

See http://pubs.opengroup.org/onlinepubs/009695399/functions/pthread_join.html

----->8-----
[ESRCH]
    No thread could be found corresponding to that specified by the
    given thread ID.

...

[EINVAL]
    The value specified by thread does not refer to a joinable thread.
-----8<-----

12 years agompt(4): Pass INTR_MPSAFE when setting up the interrupt.
Sascha Wildner [Tue, 17 Apr 2012 16:03:15 +0000 (18:03 +0200)]
mpt(4): Pass INTR_MPSAFE when setting up the interrupt.

It's a porting mistake I did back then.

12 years agokernel - Do not use M_USE_INTERRUPT_RESERVE for M_NOWAIT
Matthew Dillon [Sun, 1 Apr 2012 01:33:59 +0000 (18:33 -0700)]
kernel - Do not use M_USE_INTERRUPT_RESERVE for M_NOWAIT

* Redefine M_NOWAIT to not use M_USE_INTERRUPT_RESERVE.  This can result
  in mbuf exhaustion during bursts of mbuf allocations and cause kernel
  kvm expansion to assert and panic.

Reported-by: sephe
12 years agokernel - Fix signal masking race assertion panic w/vkernel
Matthew Dillon [Sun, 1 Apr 2012 01:30:13 +0000 (18:30 -0700)]
kernel - Fix signal masking race assertion panic w/vkernel

* sigsuspend() and pselect() record the old signal mask in order to
  allow an interrupting signal to run its handler before the old mask
  is restored.

* When multiple threads are present a race can ensue where another thread
  changes the signal handler after sigsuspend() or pselect() have interrupted,
  but before they are able to process the signal.

* If the signal is no longer enabled the old signal mask is not restored
  on system call return, resulting in an assertion and panic.

* Fix the problem by checking the flag and restoring the old signal mask
  on return (rather than asserting when the flag is found to be non-zero
  on return).

Reported-by: Venkatesh Srinivas
12 years agopst(4): Add a missing contigfree().
Sascha Wildner [Mon, 9 Apr 2012 02:37:14 +0000 (04:37 +0200)]
pst(4): Add a missing contigfree().

12 years agomps(4): Add a missing kfree().
Sascha Wildner [Mon, 9 Apr 2012 01:31:45 +0000 (03:31 +0200)]
mps(4): Add a missing kfree().

12 years agokernel: Fix building with USERCONFIG but without VISUAL_USERCONFIG.
Sascha Wildner [Sat, 7 Apr 2012 11:15:38 +0000 (13:15 +0200)]
kernel: Fix building with USERCONFIG but without VISUAL_USERCONFIG.

Reported-by: v_2e on users@
12 years agokernel/ufs: Fix compilation without INVARIANTS.
Sascha Wildner [Thu, 5 Apr 2012 17:10:51 +0000 (19:10 +0200)]
kernel/ufs: Fix compilation without INVARIANTS.

12 years agokernel -- ffs: Do not dereference NULL inodes in ffs_sync_scan1.
Venkatesh Srinivas [Fri, 30 Mar 2012 06:33:08 +0000 (23:33 -0700)]
kernel -- ffs: Do not dereference NULL inodes in ffs_sync_scan1.

ffs_sync_scan1 is a fast callback from vmntvnodescan; it is not called
with vnodes locked. It is possible for an ffs_reclaim to have reclaimed
the vnode in question, NULL-ing out ip, without having removed the vnode
from the per-mount list. If we see a NULL inode, return failure from the
fast callback.

12 years agokernel -- FFS: Take softdep lock in softdep_disk_io_initiation.
Venkatesh Srinivas [Mon, 2 Apr 2012 17:02:25 +0000 (10:02 -0700)]
kernel -- FFS: Take softdep lock in softdep_disk_io_initiation.

softdep_disk_io_initiation was using the mplock rather than the softdep
lock to protect the softdep work queue and items on it. Take the softdep
lock and allow it to be taken recursively, so that io_start bioops can
call into other parts of softdep. Prevents softdep completion callback
from racing softdep_disk_io_initiation, remaining panics of 2291.

Eventually the MPLOCK in the bio_ops callback can go away, but that will
require more testing.

Closes-bug: 2291

12 years agokernel -- ffs: Replace softupdates critical section locks with lockmgr.
Venkatesh Srinivas [Wed, 28 Mar 2012 18:09:15 +0000 (11:09 -0700)]
kernel -- ffs: Replace softupdates critical section locks  with lockmgr.

ffs softupdates was using a combination of critical sections and the mplock
to construct its acquire_lock/free_lock/interlocked_sleep primitives.

The softupdates I/O completion callback had a few points where it could block,
causing it to lose the mplock and any critical sections it held. When it did
so, front-end softupdates code would try to grab the lock but panic on seeing
the I/O completion callback in progress. This was not a problem in older
systems, as splx() would prevent the I/O callback from starting while
softdep code was executing.

This patch converts to using hard locks (lockmgr), which are held even while
a thread is blocked.

getdirtybuf(), locking a dirty buffer via BUF_LOCK, was changed to not
deadlock against the I/O completion path; specifically it drops the softdep
lock when its non-blocking attempt to lock a dirty buffer fails. One caller
of getdirtybuf() also required changes to retry locking buffers.

Closes-bug: 2291
Partially-from: FreeBSD r140709
Reported-by: tuxillo, marino, Rumko, vsrinivas
Discussed-with: dillon

12 years agoSync zoneinfo database with tzdata2012c from munnari.oz.au
Sascha Wildner [Mon, 2 Apr 2012 08:21:42 +0000 (10:21 +0200)]
Sync zoneinfo database with tzdata2012c from munnari.oz.au

africa:         8.33 -> 8.35
asia:           8.70 -> 8.73
northamerica:   8.53 -> 8.54

* africa: Morocco 2012 DST from last Sunday in April through last
    Sunday in September.

* asia: Change start of DST in Syria to last Friday in March in
    2012 and (as a guess) forward. Starts and (guessed) ends of
    DST in West Bank and Gaza for 2012. Also add a missing HTML
    directive at the top of the file.

* northamerica: Start and end of DST in Haiti in 2012 according
    to US rules.

12 years agokernel - MFC missing removal of bremfree() call
Matthew Dillon [Sun, 1 Apr 2012 01:18:01 +0000 (18:18 -0700)]
kernel - MFC missing removal of bremfree() call

* buf_daemon*() -> flushbufqueues() had an improper bremfree().

Reported-by: tuxillo
12 years agopcn(4): Add missing braces.
Sascha Wildner [Sat, 31 Mar 2012 02:10:59 +0000 (04:10 +0200)]
pcn(4): Add missing braces.

12 years agolgue(4): Add missing braces and fix indentation.
Sascha Wildner [Sat, 31 Mar 2012 01:46:53 +0000 (03:46 +0200)]
lgue(4): Add missing braces and fix indentation.

It was returning too early in some cases.

While here, add an error message.

12 years agohptiop(4): Add missing braces.
Sascha Wildner [Sat, 31 Mar 2012 01:26:52 +0000 (03:26 +0200)]
hptiop(4): Add missing braces.

12 years agortld: Add a special case in do_dlsym() for TLS stored symbols.
Sascha Wildner [Fri, 2 Mar 2012 09:15:56 +0000 (10:15 +0100)]
rtld: Add a special case in do_dlsym() for TLS stored symbols.

Submitted-by: Markus Pfeiffer <markus.pfeiffer@morphism.de>
Conflicts:

libexec/rtld-elf/rtld.c

12 years agorwhod(8): Prevent clobbering the neighboring field by a wrong cast.
Sascha Wildner [Fri, 30 Mar 2012 16:36:50 +0000 (18:36 +0200)]
rwhod(8): Prevent clobbering the neighboring field by a wrong cast.

The time stamps in the rwhod(8) network datagram and, based on that,
/var/rwho/whod.* spool files are typed as 32bit int and cannot accept
a 64bit time_t.

The old code clobbered the first bytes of the adjacent "hostname"
field, yielding empty hostnames in local rwho(1) and ruptime(1) output.
(Outgoing datagrams to other hosts were not affected.)

Re-code to let the compiler do the proper coercion (well, until 2038).

Submitted-by: Martin Neitzel
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2339>

12 years agokernel - Cluster fixes + Enable clustering for HAMMER1
Matthew Dillon [Thu, 22 Mar 2012 23:45:55 +0000 (16:45 -0700)]
kernel - Cluster fixes + Enable clustering for HAMMER1

* Add cluster_awrite(), which replaces vfs_bio_awrite() and has the same
  basic semantics as bawrite().

* Remove vfs_bio_awrite(), which had an odd API that required the buffer
  to be locked but not removed from its queues.

* Make cluster operations work on disk device buffers as well as on
  regular files.

* Add a blkflags argument to getcacheblk(), allowing GETBLK_NOWAIT to
  be passed to it.

* Enhance cluster_wbuild() to support cluster_awrite() by having it take
  an optional bp to incorporate into the cluster.  The caller disposes of
  the bp by calling bawrite() if the cluster_wbuild() code could not use it.

* Certain adjustments to cluster_write() and related code in checking against
  the file EOF to not break when variable block sizes are used.

* Fix a bug in calls made to buf_checkwrite().  The caller is required to
  initiate the I/O if the function returns good (0).  HAMMER1 uses this
  save side effects and blows up if the I/O is then not initiated.

* Enable clustering in HAMMER1 for both data and meta-data.

12 years agokernel - Fix improper BUF_UNLOCK() with spinlock held
Matthew Dillon [Wed, 28 Mar 2012 02:10:14 +0000 (19:10 -0700)]
kernel - Fix improper BUF_UNLOCK() with spinlock held

* Fix improper BUF_UNLOCK()s in the buf daemon threads.  Use a
  marker and rearrange the code to release the spinlock before
  executing BUF_UNLOCK().

12 years agokernel - Improve NFS server error responses when an inode goes away
Matthew Dillon [Fri, 23 Mar 2012 20:38:29 +0000 (13:38 -0700)]
kernel - Improve NFS server error responses when an inode goes away

* When an inode goes away and FHTOVP fails return ESTALE instead of
  what the VFS returned.

* Greatly improves the re-acquisition of files on NFS clients which have
  been ripped out by the server or other clients.

12 years agokernel - Fix improper unlock/relock sequence in HAMMER
Matthew Dillon [Fri, 23 Mar 2012 20:36:27 +0000 (13:36 -0700)]
kernel - Fix improper unlock/relock sequence in HAMMER

* VOP_FSYNC() can be called during a vnode inactivation or reclaim.
  In this case the vnode lock absolutely cannot be released or it
  can create a window of opportunity for another thread that results
  in a panic.

* Fixes a NFS server crash when multiple clients are trying to
  delete/create/write the same file at the same time.

12 years agokernel - Fix bug in SILI, remove debugging in AHCI
Matthew Dillon [Fri, 23 Mar 2012 16:06:57 +0000 (09:06 -0700)]
kernel - Fix bug in SILI, remove debugging in AHCI

* Fix the same unlock/lock sequence bug in the SILI driver that was
  fixed in the AHCI driver.

* Remove a flag that was being added to the service set in AHCI for
  debugging purposes.

12 years agokernel - Fix another AHCI bug
Matthew Dillon [Fri, 23 Mar 2012 08:47:48 +0000 (01:47 -0700)]
kernel - Fix another AHCI bug

* Remove the unlock/lock sequences around the xpt_done() calls.  These
  temporary unlocks create a gap which can allow another interrupt to
  squeeze in and interfere with the interrupt thread that is already
  running, resulting in corruption.

  This bug occurs under very heavy loads, and typically required multiple
  concurrent ops to a SSD to trigger.

* Add additional assertions to catch issues and reorder one of the
  chiploads.

* This is a bit non-optimal, be on the lookout for deadlocks in case it
  turns out that holding the lock is a bad idea.

12 years agokernel - Fix mount refs interactions and umount races
Matthew Dillon [Fri, 23 Mar 2012 04:37:25 +0000 (21:37 -0700)]
kernel - Fix mount refs interactions and umount races

* It is possible for a umount to race other operations on active mount
  point, causing one or the other to deadlock.

* vfs_busy()/vfs_unbusy() now incr/decr mp->mnt_refs.

* cache_findmount() now increments mp->mnt_refs, and add a new API
  function cache_dropmount() which decrements it.

12 years agokernel - Fix three AHCI bugs
Matthew Dillon [Fri, 23 Mar 2012 04:31:31 +0000 (21:31 -0700)]
kernel - Fix three AHCI bugs

* This fixes spurious timeouts which occur on SMP boxes with faster devices
  (such as SSDs or more recent hard drives)

* The global interrupt status register appears to be latched on some parts
  rather than wire-or.  Clearing it after signaling the port threads or
  processing the interrupt can cause interrupts to be lost.

* In cases where it is actually wire-or we may get a double-interrupt,
  but stability is more important here.

* Fix the port signaling code.  The mask was being cleared with the
  port interlock released.  It has to be cleared when the interlock is
  held.

* Reorder the per-port interrupt status register clearing code in two
  places to execute before processing the operation rather than after,
  which may fix another source of lost interrupts.

12 years agokernel - Add workaround for errata #721 on AMD cpus (found by Matt Dillon)
Matthew Dillon [Fri, 23 Mar 2012 22:49:54 +0000 (15:49 -0700)]
kernel - Add workaround for errata #721 on AMD cpus (found by Matt Dillon)

* Official reference for errata 721:

    http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf

* This is the cpu bug found by Matthew Dillon, present on all K10 cores
  (so far).  AMD has indicated that the bug is not present on Bulldozer
  cpus.

* The MSR workaround is now reported and programmed during kernel boot.

* No discernable difference in performance was detected running GCC
  with and without the MSR adjustment.

* Verified to have fixed our test case w/GCC.  It no longer seg-faults.

12 years agolibc - Do not allow a stuck syslogd to screw up the entire system
Matthew Dillon [Sat, 24 Mar 2012 00:33:51 +0000 (17:33 -0700)]
libc - Do not allow a stuck syslogd to screw up the entire system

* If syslogd gets stuck the socket buffer will still full forever.
  Only try writing a limited number of times before giving up.

12 years agokernel: msdosfs -- Use -1 rather than 32-bit 0xffffffff in mount().
Venkatesh Srinivas [Mon, 26 Mar 2012 15:59:02 +0000 (08:59 -0700)]
kernel: msdosfs -- Use -1 rather than 32-bit 0xffffffff in mount().

Corrects bug mounting 8GB msdosfs filesystem on x86-64.

Submitted-by: G. Isenmann
12 years agotcp/sack: Prevent invalid SACK option from being processed
Sepherosa Ziehau [Mon, 26 Mar 2012 03:36:53 +0000 (11:36 +0800)]
tcp/sack: Prevent invalid SACK option from being processed

If the received SACK blocks contain one invalid SACK block,
discard the whole SACK blocks.

12 years agompt(4): Fix an issue that caused the driver to attach to mfi(4) cards. v3.0.2
Sascha Wildner [Tue, 20 Mar 2012 20:19:25 +0000 (21:19 +0100)]
mpt(4): Fix an issue that caused the driver to attach to mfi(4) cards.

FreeBSD's commit message (r232411) explains it:

Fix a problem that was causing the mpt(4) driver to attach to MegaRAID
cards that should be handled by the mfi(4) driver.

The root of the problem is that the mpt(4) driver was masking off the
bottom bit of the PCI device ID when deciding which cards to attach to.

It appears that a number of the mpt(4) Fibre Channel cards had a LAN
variant whose PCI device ID was just one bit off from the FC card's device
ID.  The FC cards were even and the LAN cards were odd.

The problem was that this pattern wasn't carried over on the SAS and
parallel SCSI mpt(4) cards.  Luckily the SAS and parallel SCSI PCI device
IDs were either even numbers, or they would get masked to a supported
adjacent PCI device ID, and everything worked well.

Now LSI is using some of the odd-numbered PCI device IDs between the 3Gb
SAS device IDs for their new MegaRAID cards.  This is causing the mpt(4)
driver to attach to the RAID cards instead of the mfi(4) driver.

The solution is to stop masking off the bottom bit of the device ID, and
explicitly list the PCI device IDs of all supported cards.

This change should be a no-op for mpt(4) hardware.  The only intended
functional change is that for the 929X, the is_fc variable gets set.  It
wasn't being set previously, but needs to be because the 929X is a Fibre
Channel card.

12 years agoboot - Fix overflow in CD I/O code
Matthew Dillon [Fri, 16 Mar 2012 00:36:02 +0000 (17:36 -0700)]
boot - Fix overflow in CD I/O code

* Fix an overflow in cdb2devb():
from ((bno) * ISO_DEFAULT_BLOCK_SIZE / DEV_BSIZE)
to   ((bno) * (ISO_DEFAULT_BLOCK_SIZE / DEV_BSIZE))

* Adjust several fields from signed -> unsigned

12 years agoioapic: By default, disable I/O APIC if we are booting on a virtual machine
Sepherosa Ziehau [Wed, 14 Mar 2012 03:18:44 +0000 (11:18 +0800)]
ioapic: By default, disable I/O APIC if we are booting on a virtual machine

I/O APIC causes too much trouble on virtual machines; simply disable
I/O APIC for virtual machines by default.

You could always explicitly enable I/O APIC on virtual machines by
setting tunable hw.ioapic_enable to 1

Thank swildner@ for hint on virtual machine detection method.

Reported-by: many
12 years agospacialreg: Add CPUID2_VMM according to AMD's CPUID specification
Sepherosa Ziehau [Wed, 14 Mar 2012 03:18:00 +0000 (11:18 +0800)]
spacialreg: Add CPUID2_VMM according to AMD's CPUID specification

12 years agoMerged thread-specific cleanup patch from FreeBSD.
Aycan iRiCAN [Tue, 13 Mar 2012 20:48:27 +0000 (22:48 +0200)]
Merged thread-specific cleanup patch from FreeBSD.

  See: http://lists.freebsd.org/pipermail/freebsd-threads/2009-June/004563.html

12 years agorc.conf.5: Fix the wlan setup example.
Sascha Wildner [Sun, 11 Mar 2012 18:05:08 +0000 (19:05 +0100)]
rc.conf.5: Fix the wlan setup example.

Submitted-by: Johannes Hofmann <johannes.hofmann@gmx.de>
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2330>

12 years ago<sys/cdefs.h>: For C++, unhide our interfaces via __{BEGIN,END}_DECLS.
Sascha Wildner [Sun, 11 Mar 2012 12:50:29 +0000 (13:50 +0100)]
<sys/cdefs.h>: For C++, unhide our interfaces via __{BEGIN,END}_DECLS.

This follows up on a previous (pthread specific) commit by alexh
(e7322b09faff75b1298e9bfe444633425d173536) that used a per-proto
macro. Revert this commit, too. In principle, we do it like NetBSD
now.

See http://gcc.gnu.org/wiki/Visibility in the GCC wiki for details
on the issue.

This solution was suggested by Martin Husemann in a thread about
xulrunner building issues:

http://mail-index.netbsd.org/tech-pkg/2012/03/11/msg008680.html

Reported-and-tested-by: marino and others
12 years agosvc_vc_create(3): Initialize xprt with NULL.
Sascha Wildner [Sat, 10 Mar 2012 08:27:36 +0000 (09:27 +0100)]
svc_vc_create(3): Initialize xprt with NULL.

In the (corner-)case of being out of memory, this prevents free() to be
called on an uninitialized xprt below the cleanup_svc_vc_create: label.

12 years agokernel: fixup accidental whitespace shift in vm_fault_copy_entry commit
Chris Turner [Fri, 9 Mar 2012 21:31:19 +0000 (21:31 +0000)]
kernel: fixup accidental whitespace shift in vm_fault_copy_entry commit

was resulting in cherry-pick conflicts in MFC branch

12 years agokernel: reorganize new holds in vm_fault_copy_entry
Chris Turner [Fri, 9 Mar 2012 20:57:42 +0000 (20:57 +0000)]
kernel: reorganize new holds in vm_fault_copy_entry

Move holds outside of the pagecopy loop to reduce locking overhead.

Suggested-by: dillon
12 years agokernel: add missing holds/drops to vm_fault_copy_entry
Chris Turner [Fri, 9 Mar 2012 20:34:46 +0000 (20:34 +0000)]
kernel: add missing holds/drops to vm_fault_copy_entry

Add missing holds/drops to vm_fault_copy_entry that were triggering
assertions in vm_page_alloc/vm_page_lookup when when a process
holding locked memory is forked.

Fixes: https://bugs.dragonflybsd.org/issues/2320
Reviewed-by: vsrinavas
X-Nahmean-Status: word

12 years agosetnetpath(3): Fix a double free().
Sascha Wildner [Fri, 9 Mar 2012 17:29:51 +0000 (18:29 +0100)]
setnetpath(3): Fix a double free().

np_sessionp is free()'d after the failed: label.

12 years agoHAMMER VFS: Conditionalize debug message
Matthew Dillon [Fri, 9 Mar 2012 06:04:10 +0000 (22:04 -0800)]
HAMMER VFS: Conditionalize debug message

* Conditionalize an annoying debug kprintf on hammer_debug_inode.

12 years agokernel: Add a few forgotten crit_exit()s and fix a wrong crit_enter().
Sascha Wildner [Wed, 7 Mar 2012 18:19:33 +0000 (19:19 +0100)]
kernel: Add a few forgotten crit_exit()s and fix a wrong crit_enter().

12 years agoInstaller: one more place where inform() called without a format string
YONETANI Tomokazu [Wed, 7 Mar 2012 15:01:15 +0000 (00:01 +0900)]
Installer: one more place where inform() called without a format string

Noticed-by: swildner@
12 years agoInstaller: fix a (possible) crash in show_ifconfig()
YONETANI Tomokazu [Wed, 7 Mar 2012 15:01:15 +0000 (00:01 +0900)]
Installer: fix a (possible) crash in show_ifconfig()

inform() expects a printf-like format string as the second argument,
so you should always supply one instead of a random string by itself.

DragonFly-bug: <http://bugs.dragonflybsd.org/issues/1596>

12 years agoncurses: Fix an almost 7 year old typo in the profiling libtinfo's name.
Sascha Wildner [Mon, 5 Mar 2012 10:49:27 +0000 (11:49 +0100)]
ncurses: Fix an almost 7 year old typo in the profiling libtinfo's name.

It was introduced in c4c23d9061b6eb2a3456620a48b84583b00fe0ce.

12 years agogcc44: Remove a wrong define for the profiled math library's name.
Sascha Wildner [Mon, 5 Mar 2012 10:04:30 +0000 (11:04 +0100)]
gcc44: Remove a wrong define for the profiled math library's name.

This caused compiling with -pg to fail for C++:

zoot# c++ -pg -o t t.c
/usr/libexec/binutils222/elf/ld.bfd: cannot find -lm_p

Our libraries for profiling don't have different names than the normal
ones. They just are in a different directory (/usr/lib/profile), which
is cared for.

Reported-by: Pierre Abbat <phma@phma.optus.nu>
Dragonfly-bug: <http://bugs.dragonflybsd.org/issues/2325>

12 years agoSync zoneinfo database with tzdata2012b from munnari.oz.au
Sascha Wildner [Fri, 2 Mar 2012 09:25:53 +0000 (10:25 +0100)]
Sync zoneinfo database with tzdata2012b from munnari.oz.au

northamerica:   8.52 -> 8.53

* northamerica: Summer time in Cuba has been delayed 3 weeks (now
    starts April 1 rather than March 11). Since Mar 11 (the old
    start date, as listed in 2012a) is just a little over a week
    away, this change is urgent.

Also bump zone.tab's version for a fix that was not in 2012a but
which I already added.

12 years agoSync zoneinfo database with tzdata2012a from munnari.oz.au
Sascha Wildner [Thu, 1 Mar 2012 14:41:05 +0000 (15:41 +0100)]
Sync zoneinfo database with tzdata2012a from munnari.oz.au

antarctica:     8.9  -> 8.10
asia:           8.69 -> 8.70
australasia:    8.29 -> 8.30
europe:         8.40 -> 8.41
leapseconds:    8.11 -> 8.13
northamerica:   8.51 -> 8.52
README:         8.3  -> 8.4
southamerica:   8.52 -> 8.53
zone.tab:       8.52 -> 8.54

* antarctica: Current best known timezone info for various Antarctic
    bases for the winter of 2012.

* asia: Armenia has abolished summer time.

* australasia: Tokelau copied Samoa and swapped sides of the
    International Date Line last December (affects current timestams).

* europe: Updated URL for UK timezone history.

* leapseconds: Bulletin C43 incorporated (a leap Second will occur
    2012-06-30 at 23:59:60 UTC). Bulletin C42 was also incorporated
    (but never released) - it said nothing very interesting (no leap
    second 2011-12-31).

* northamerica: New zone America/Creston created for an area in
    British Columbia that was previously (and apparently incorrectly)
    considered identical to Dawson Creek. Also, some corrections to
    1918 summer time end dates in several Canadian zones.

* README: Updated to reflect the current home of the mailing list and
    files.

* southamerica: Chile has extended Summer time in the 2011/2 summer.
    Future years (2013->) are assumed revert to "normal" for now. The
    Falkland Islands now have it permanently (continuing the 2011
    experiment). This "permanently" is a guess, it apparently is
    certain for 2012 (as certain as these things ever are) and
    considered likely into the future.

* zone.tab: New America/Creston zone added, and a typo in the entry
    for Europe/Samara corrected.

12 years agolibthread_xu/libc_r: Improve the check for EINVAL in sem_* functions.
Sascha Wildner [Tue, 28 Feb 2012 22:44:29 +0000 (23:44 +0100)]
libthread_xu/libc_r: Improve the check for EINVAL in sem_* functions.

Before referencing *sem->... in the check, do not just test if sem is
NULL but also if *sem is NULL.

Reported-by: Max Herrgard <herrgard@gmail.com>
12 years agouguru(4): Fix a panic when detaching (e.g., on kldunload).
Sascha Wildner [Mon, 27 Feb 2012 19:52:26 +0000 (20:52 +0100)]
uguru(4): Fix a panic when detaching (e.g., on kldunload).

Reported-by: Max Herrgard <herrgard@gmail.com>