dragonfly.git
9 years agonet/if_lagg: Fix compilation error caused by MFC v4.0.4
Markus Pfeiffer [Thu, 5 Mar 2015 22:30:23 +0000 (22:30 +0000)]
net/if_lagg: Fix compilation error caused by MFC

callout_init_lk does not exist in RELEASE, and hence we go
back to callout_init_mp. This is non-consequential, since the
callout function is empty at the moment anyway.

9 years agonet/if_lagg: Fix double-free issue
Markus Pfeiffer [Thu, 26 Feb 2015 15:24:45 +0000 (15:24 +0000)]
net/if_lagg: Fix double-free issue

9 years agonetif/if_lagg: Fix panic on MOD_UNLOAD
Markus Pfeiffer [Thu, 26 Feb 2015 12:39:16 +0000 (12:39 +0000)]
netif/if_lagg: Fix panic on MOD_UNLOAD

Remove one instance of if_clone_detach being called.

Reported-By: bycn82 <bycn82@gmail.com>
9 years agoinstaller: Remove some more initrd creation code.
Sascha Wildner [Tue, 3 Mar 2015 20:38:04 +0000 (21:38 +0100)]
installer: Remove some more initrd creation code.

After my revert, this original mkinitrd code (for encrypted setup
originally) came back. Since we can now rely on the ISO having an
initrd to be installed already, we can remove this too.

9 years agonrelease: Solve the initial initrd creation better.
Sascha Wildner [Tue, 3 Mar 2015 20:19:09 +0000 (21:19 +0100)]
nrelease: Solve the initial initrd creation better.

Hard links in cd9660, while not taking up more space in the ISO or on
the CD, all have distinct inode numbers, which causes them to be treated
like individual files when copying them somewhere. This caused the initrd
to overflow when we built it from the installer after booting from the
ISO.

This commit puts initrd creation into the nrelease process instead, making
use of mkinitrd(8)'s -c option which allows us to override the contents
directory to the ${ISOROOT}'s /usr/share/initrd.

Reported-by: opvalues
Dragonfly-bug: <https://bugs.dragonflybsd.org/issues/2798>

9 years agomkinitrd(8): Add a -c option to override the contents directory.
Sascha Wildner [Tue, 3 Mar 2015 20:11:39 +0000 (21:11 +0100)]
mkinitrd(8): Add a -c option to override the contents directory.

9 years agoRevert "installer: Create an initial initrd unconditionally."
Sascha Wildner [Tue, 3 Mar 2015 18:15:20 +0000 (19:15 +0100)]
Revert "installer: Create an initial initrd unconditionally."

This reverts commit 0c69777ed12f9dff4a80f46f9ef730837791cf33.

Due to shortcomings of the CD9660 filesystems, hardlinks end up
having different inode numbers on it, which leads to them being
treated like separate files when copying etc.

As a result, the initrd put together by mkinitrd from a CD9660
would end up being around 230MB large where it actually has to
be below 15MB.

We will solve this in nrelease instead, putting together the
initrd from the building machine.

9 years agonrelease: Remove an unneeded comma.
Sascha Wildner [Tue, 3 Mar 2015 17:28:56 +0000 (18:28 +0100)]
nrelease: Remove an unneeded comma.

9 years agomake.conf: WITH_NEW_XORG and WITH_KMS are no longer required
François Tigeot [Thu, 8 Jan 2015 17:34:13 +0000 (18:34 +0100)]
make.conf: WITH_NEW_XORG and WITH_KMS are no longer required

9 years agokernel/scsi: Fix sense information printing in bootverbose.
Sascha Wildner [Sat, 28 Feb 2015 19:55:30 +0000 (20:55 +0100)]
kernel/scsi: Fix sense information printing in bootverbose.

9 years agoudp: Disable direct detach, if multicast options are set.
Sepherosa Ziehau [Wed, 25 Feb 2015 03:17:35 +0000 (11:17 +0800)]
udp: Disable direct detach, if multicast options are set.

Add additional comment about disabling direct detach when setting
multicast options.

Submitted-by: Romick
DragonFly-bug: http://bugs.dragonflybsd.org/issues/2792

9 years agoprocfs - Properly return error codes for ioctl calls
Antonio Huete Jimenez [Thu, 5 Feb 2015 23:29:55 +0000 (00:29 +0100)]
procfs - Properly return error codes for ioctl calls

9 years agoRevert "hammer - Fix 'history' directive"
Antonio Huete Jimenez [Mon, 16 Feb 2015 15:02:59 +0000 (16:02 +0100)]
Revert "hammer - Fix 'history' directive"

This reverts commit 417cb1b104fd140d4e31775d8873ad473216f7e4 which
broke the behaviour described in the manpage.

Spotted-by: tkusumi
9 years agoif_bridge - Increase MAC cache maximum to 4096
Matthew Dillon [Tue, 3 Feb 2015 03:33:02 +0000 (19:33 -0800)]
if_bridge - Increase MAC cache maximum to 4096

* Increase the default maximum number of records the bridge can keep track
  of from 100 to 4096, which is more contemporary with what hardware
  bridges deal with.

9 years agoif_bridge - Fix issue where source MAC is not recorded.
Matthew Dillon [Tue, 3 Feb 2015 03:28:32 +0000 (19:28 -0800)]
if_bridge - Fix issue where source MAC is not recorded.

* The bridge has to record which interface the source MAC came from
  so transmissions back to that MAC can be unicast.  Otherwise transmissions
  will be broadcast to all bridge elements.

  The receive packet path case where a packet is sent to the bridge's own
  MAC address (terminating on the bridge host) from one of the member
  interfaces was not recording the MAC, resulting in duplicate packets
  (most obvious when testing with 'ping').

* Fix the code path in question so the MAC is properly recorded.

9 years agoSync zoneinfo database with tzdata2015a from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Sat, 31 Jan 2015 23:38:08 +0000 (00:38 +0100)]
Sync zoneinfo database with tzdata2015a from ftp://ftp.iana.org/tz/releases

Changes affecting future time stamps

* The Mexican state of Quintana Roo, represented by America/Cancun,
    will shift from Central Time with DST to Eastern Time without DST
    on 2015-02-01 at 02:00.  (Thanks to Steffen Thorsen and Gwillim Law.)

* Chile will not change clocks in April or thereafter; its new standard time
    will be its old daylight saving time.  This affects America/Santiago,
    Pacific/Easter, and Antarctica/Palmer.  (Thanks to Juan Correa.)

* New leap second 2015-06-30 23:59:60 UTC as per IERS Bulletin C 49.
    (Thanks to Tim Parenti.)

Changes affecting past time stamps

* Iceland observed DST in 1919 and 1921, and its 1939 fallback
    transition was Oct. 29, not Nov. 29.  Remove incorrect data from
    Shanks about time in Iceland between 1837 and 1908.

* Some more zones have been turned into links, when they differed
    from existing zones only for older time stamps.  As usual,
    these changes affect UTC offsets in pre-1970 time stamps only.
    The affected zones are: Asia/Aden, Asia/Bahrain, Asia/Kuwait,
    and Asia/Muscat.

Changes affecting commentary

* The leapseconds file commentary now mentions the expiration date.
    (Problem reported by Martin Burnicki.)

* Update Mexican Library of Congress URL.

9 years agohammer - cleanup arg names in procedural prototypes - PR 2770 v4.0.3
Matthew Dillon [Sat, 17 Jan 2015 21:00:13 +0000 (13:00 -0800)]
hammer - cleanup arg names in procedural prototypes - PR 2770

* Cleanup procedural prototypes to match code.

Submitted-by: tkusumi PR/2770.
9 years agohammer - bring-in cleanup from PR 2771 and 2772
Matthew Dillon [Sat, 17 Jan 2015 20:46:01 +0000 (12:46 -0800)]
hammer - bring-in cleanup from PR 2771 and 2772

* Bring in a macro/inline cleanup that makes the code
  a bit more clear.

Submitted-by: tkusumi
9 years agosys/vfs/hammer: fix comments
Tomohiro Kusumi [Mon, 5 Jan 2015 10:03:25 +0000 (19:03 +0900)]
sys/vfs/hammer: fix comments

This patch fixes typo in comments. On-memory record structure hammer_record
is being removed from on-memory RB-Tree, not on-disk B-Tree.

9 years agosbin/hammer: fix output of hammer blockmap command
Tomohiro Kusumi [Thu, 27 Nov 2014 18:40:53 +0000 (03:40 +0900)]
sbin/hammer: fix output of hammer blockmap command

- Correctly name the zone being dumped.

Closes: #2740

9 years agosbin/hammer: fix counter-intuitive output of hammer show command
Tomohiro Kusumi [Tue, 30 Dec 2014 23:16:28 +0000 (08:16 +0900)]
sbin/hammer: fix counter-intuitive output of hammer show command

- Change 'hammer show' ELM output to match the comparison order in the
  RB tree cmp functions.

Closes: #2755

9 years agosys/vfs/hammer: cleanup using existing macro
Tomohiro Kusumi [Fri, 26 Dec 2014 20:38:02 +0000 (05:38 +0900)]
sys/vfs/hammer: cleanup using existing macro

- This patch is a cleanup with no change to behavior of
  hammer_ip_check_directory_empty().
- Using existing macro as well as a new macro HAMMER_RECTYPE_ENTRY_START
  (in the same fashion as HAMMER_RECTYPE_CLEAN_START) makes it easier to
  understand what this function is doing (just like other functions that
  use both key_beg/key_end do).

Closes: #2752

9 years agosys/vfs/hammer: fix off-by-one error in hammer volume-add ioctl
Tomohiro Kusumi [Sun, 18 Jan 2015 18:26:47 +0000 (03:26 +0900)]
sys/vfs/hammer: fix off-by-one error in hammer volume-add ioctl

- This patch should fix off-by-one error regarding maximum volume number.
- Correct how hammer_ioc_volume_add() tests current # of volumes before
  it adds a new volume.

Closes: #2773

9 years agosbin/hammer: remove obsolete "spike" code from hammer show command
Tomohiro Kusumi [Wed, 7 Jan 2015 12:45:43 +0000 (21:45 +0900)]
sbin/hammer: remove obsolete "spike" code from hammer show command

- Remove spike related code from print_btree_node() as it is no longer
  relevant since commit 47197d.
- Not calling print_btree_node() twice makes 'show' directive more
  efficient.

Closes: #2761

9 years agosys/vfs/hammer: fix comments regarding obsolete "spike" code
Tomohiro Kusumi [Thu, 8 Jan 2015 12:29:12 +0000 (21:29 +0900)]
sys/vfs/hammer: fix comments regarding obsolete "spike" code

- This patch fixes comments regarding "spike" code that only existed in
  early days of hammer development.
- The spike comments have been left unchanged even after the code was
  removed in 47197d71536907482d2d215e222600eed3aedc0e.

Closes: #2764

9 years agosbin/hammer: fix potential memory leak
Tomohiro Kusumi [Mon, 12 Jan 2015 16:37:09 +0000 (01:37 +0900)]
sbin/hammer: fix potential memory leak

- This patch properly frees calloc/malloced memory.

Closes: #2766

9 years agosys/vfs/hammer: make btree_search() climb up btree slightly faster
Tomohiro Kusumi [Thu, 8 Jan 2015 15:13:59 +0000 (00:13 +0900)]
sys/vfs/hammer: make btree_search() climb up btree slightly faster

- This cleanup patch lets cursor climb up deep/fat btree slightly faster
  (lightweight), if not slower.
- Remove a duplicate check that traces back to a moment where there was
  btree_node_is_almost_full() and the differentiation was needed.

Closes: #2765

9 years agohammer - Fix timeout for 'dedup' directive
Antonio Huete Jimenez [Thu, 8 Jan 2015 11:30:05 +0000 (12:30 +0100)]
hammer - Fix timeout for 'dedup' directive

- 'hammer dedup' did not stop on timeout set by -t option.
- As the deduplication itself works by comparing one reference
  base element against a candidate base element, hammer(8) collects
  all the elements to be deduplicated and actually perform the needed
  ioctl() calls to make it happen. This is why the SIGALRM code has to
  be handled from within hammer(8).

Reported by: ftigeot
DragonFly-bug: <http://bugs.dragonflybsd.org/issues/2759>

9 years agovkernel - Forward SIGTERM to the child vkernel process.
Antonio Huete Jimenez [Mon, 29 Dec 2014 14:42:47 +0000 (15:42 +0100)]
vkernel - Forward SIGTERM to the child vkernel process.

- Fixes a problem that occurred when sending SIGTERM to the
  parent vkernel process. It died and left child running in
  the background instead of initiating the shutdown.

9 years agosavecore - Fix a resource leak
Antonio Huete Jimenez [Thu, 18 Dec 2014 23:20:24 +0000 (00:20 +0100)]
savecore - Fix a resource leak

- Detected by cppcheck

9 years agolibc/regex - Fix a memory leak
Antonio Huete Jimenez [Thu, 18 Dec 2014 22:17:30 +0000 (23:17 +0100)]
libc/regex - Fix a memory leak

- Detected by cppcheck

9 years agolibc/db - Fix a resource leak
Antonio Huete Jimenez [Thu, 18 Dec 2014 22:01:13 +0000 (23:01 +0100)]
libc/db - Fix a resource leak

- Detected by cppcheck

9 years agolibc - Initialise ret before use
Antonio Huete Jimenez [Thu, 18 Dec 2014 21:41:45 +0000 (22:41 +0100)]
libc - Initialise ret before use

9 years agohammer - Fix 'history' directive
Antonio Huete Jimenez [Tue, 9 Dec 2014 00:10:27 +0000 (01:10 +0100)]
hammer - Fix 'history' directive

- Directive options '@offset,len' work now as they are
  supposed to.

9 years agokernel/ath: Add missing braces (FreeBSD's r277290).
Sascha Wildner [Sat, 17 Jan 2015 08:05:56 +0000 (09:05 +0100)]
kernel/ath: Add missing braces (FreeBSD's r277290).

9 years agoopenssl: Adjust manual pages for 1.0.1l.
Sascha Wildner [Thu, 15 Jan 2015 20:25:46 +0000 (21:25 +0100)]
openssl: Adjust manual pages for 1.0.1l.

9 years agoMerge branch 'vendor/OPENSSL' into rel4_0
Sascha Wildner [Thu, 15 Jan 2015 21:19:46 +0000 (22:19 +0100)]
Merge branch 'vendor/OPENSSL' into rel4_0

9 years agoImport OpenSSL-1.0.1l.
Sascha Wildner [Thu, 15 Jan 2015 20:22:00 +0000 (21:22 +0100)]
Import OpenSSL-1.0.1l.

* Fixes for CVE-2014-3571, CVE-2015-0206, CVE-2014-3569, CVE-2014-3572,
  CVE-2015-0204, CVE-2015-0205, CVE-2014-8275 and CVE-2014-3570.

* Ensure that the session ID context of an SSL is updated when its
  SSL_CTX is updated via SSL_set_SSL_CTX.

* Do not resume sessions on the server if the negotiated protocol
  version does not match the session's version.

* Tighten handling of the ChangeCipherSpec (CCS) message.

* Tighten client-side session ticket handling during renegotiation.

Also, while here, remove the doc/ subdirectory on the vendor branch.
We don't need to distribute it in contrib/.

9 years agolibedit: Install and use the correct <histedit.h>.
Sascha Wildner [Thu, 15 Jan 2015 10:15:19 +0000 (11:15 +0100)]
libedit: Install and use the correct <histedit.h>.

Ever since libedit was moved to contrib/ back in May 2012 (c22639f2f9ab7)
we were still installing the previous <histedit.h> from /usr/src/include.

9 years agokernel: Hide the intrmask_t typedef from userspace with #ifdef _KERNEL.
Imre Vadasz [Tue, 13 Jan 2015 21:26:32 +0000 (22:26 +0100)]
kernel: Hide the intrmask_t typedef from userspace with #ifdef _KERNEL.

9 years agokernel: Remove stray SYSCTL_XUNLOCK from sysctl_sysctl_debug_dump_node().
Imre Vadasz [Thu, 8 Jan 2015 22:53:22 +0000 (23:53 +0100)]
kernel: Remove stray SYSCTL_XUNLOCK from sysctl_sysctl_debug_dump_node().

9 years agokernel/acpi: Add missing ACPI_LOCK_INIT in acpi_thermal.
Imre Vadasz [Thu, 8 Jan 2015 21:04:02 +0000 (22:04 +0100)]
kernel/acpi: Add missing ACPI_LOCK_INIT in acpi_thermal.

9 years agodrm - Fix deadlock in ttm pager
Matthew Dillon [Sat, 10 Jan 2015 17:35:24 +0000 (09:35 -0800)]
drm - Fix deadlock in ttm pager

* Fix a deadlock which most often occurs via the ttm (radeon) VM pager.
  A similar path is also used by i915 (all intel).

* Basically removes an unnecessary lock in the paging path which was creating
  the deadlock.

Reported-by: ivadasz, ftigeot
9 years agokernel - Fix a major (pageable) memory leak v4.0.2
Matthew Dillon [Wed, 31 Dec 2014 22:32:45 +0000 (14:32 -0800)]
kernel - Fix a major (pageable) memory leak

* MFC 15553805ce from master.  Only MFC the actual one-line fix, do not
  MFC all the debug code and other stuff.

* This fixes a memory leak which can cause a system to run out of swap
  space relatively easily.

9 years agohammer(8): Fix closing brace indent in 'show' output.
Sascha Wildner [Sat, 27 Dec 2014 00:53:35 +0000 (01:53 +0100)]
hammer(8): Fix closing brace indent in 'show' output.

Commit 39e88285cb81d7847bb54a08e0f50a61be890e08 extended the bad
indication to two chars ("B " or "BM") but forgot to adjust the
indent of the closing brace.

9 years agokernel/netmap: Switch sysctls over to dev.netmap like in FreeBSD.
Sascha Wildner [Mon, 22 Dec 2014 20:12:27 +0000 (21:12 +0100)]
kernel/netmap: Switch sysctls over to dev.netmap like in FreeBSD.

9 years agoAdd dev.* sysctl hierarchy to 4.0.
Sascha Wildner [Mon, 22 Dec 2014 20:17:44 +0000 (21:17 +0100)]
Add dev.* sysctl hierarchy to 4.0.

9 years agokernel: Don't confuse kmalloc() and mbuf flags.
Sascha Wildner [Mon, 22 Dec 2014 11:49:03 +0000 (12:49 +0100)]
kernel: Don't confuse kmalloc() and mbuf flags.

9 years ago<sys/file2.h>: Correct include guard check.
Sascha Wildner [Sun, 21 Dec 2014 18:28:26 +0000 (19:28 +0100)]
<sys/file2.h>: Correct include guard check.

9 years agotwa(4): Fix a crash with TWA_DEBUG >= 3.
Sascha Wildner [Mon, 15 Dec 2014 22:34:16 +0000 (23:34 +0100)]
twa(4): Fix a crash with TWA_DEBUG >= 3.

tw_osli_dbg_dprintf() uses device_printf(sc->bus_dev, ...) so we can't
use it before sc->bus_dev is actually set.

9 years agousb4bsd/if_rum: Add missing locking around rum_start_locked().
Imre Vadasz [Mon, 8 Dec 2014 15:01:24 +0000 (16:01 +0100)]
usb4bsd/if_rum: Add missing locking around rum_start_locked().

9 years agonamecache: Remove a diagnostic message
François Tigeot [Thu, 4 Dec 2014 14:22:11 +0000 (15:22 +0100)]
namecache: Remove a diagnostic message

It only scares users these days.

9 years agodevd(8): Fix asus.conf installation.
Sascha Wildner [Thu, 4 Dec 2014 18:27:47 +0000 (19:27 +0100)]
devd(8): Fix asus.conf installation.

9 years agolink_elf: Work around a GCC optimization bug. Fixes ddb stack traces.
Imre Vadasz [Sat, 29 Nov 2014 20:28:53 +0000 (21:28 +0100)]
link_elf: Work around a GCC optimization bug. Fixes ddb stack traces.

Taken-from: FreeBSD r102348

9 years agovkernel64 - Fix pmap panic
Matthew Dillon [Fri, 28 Nov 2014 06:57:36 +0000 (22:57 -0800)]
vkernel64 - Fix pmap panic

* Fix a pmap panic complaining about the pm_active cpumask not being zero
  when the pmap is released/destroyed.

* The vkernel64 swtch code was improperly setting the active bits from
  the gd_other_cpus field instead of the gd_cpumask field, which wound
  up setting lots of bits instead of the one bit we wanted to set.

* Long-known bug was difficult to reproduce consistently enough to
  locate until Robert found a quick way.

Reproduced-by: Robert Garrett
9 years agokernel/acpi: Add missing ACPI_SERIAL_INIT calls for lock initialization.
Imre Vadasz [Wed, 26 Nov 2014 13:37:52 +0000 (14:37 +0100)]
kernel/acpi: Add missing ACPI_SERIAL_INIT calls for lock initialization.

9 years agoMerge branch 'DragonFly_RELEASE_4_0' of ssh://crater.dragonflybsd.org/repository...
Matthew Dillon [Tue, 25 Nov 2014 18:58:53 +0000 (10:58 -0800)]
Merge branch 'DragonFly_RELEASE_4_0' of ssh://crater.dragonflybsd.org/repository/git/dragonfly into DragonFly_RELEASE_4_0

9 years agokernel - Fix panic on upmap/kpmap read via procfs.
Matthew Dillon [Tue, 25 Nov 2014 18:57:13 +0000 (10:57 -0800)]
kernel - Fix panic on upmap/kpmap read via procfs.

* Fix a panic when upmap/kpmap is accessed via procfs.

Reported-by: Joris Giovannangeli
9 years ago loader: Fix typos in help.common v4.0.1
Thomas Nikolajsen [Mon, 24 Nov 2014 21:39:34 +0000 (22:39 +0100)]
loader: Fix typos in help.common

    - ahci(4) doesn't use .0 for disable hint
    - fix slice name in example

9 years ago loader: Fix XHCI description in help.common
Thomas Nikolajsen [Mon, 24 Nov 2014 21:37:10 +0000 (22:37 +0100)]
loader: Fix XHCI description in help.common

9 years agotools - A bunch of bugfixes for hammer-backup.sh
Antonio Huete Jimenez [Wed, 19 Nov 2014 16:05:15 +0000 (17:05 +0100)]
tools - A bunch of bugfixes for hammer-backup.sh

  - Fix a problem when trying to backup / PFS
  - Return errors on checksum failure. This can be used by other
    scripts to verify the files are not corrupt.
  - Force absolute paths to specify which PFS to backup
  - Fix a problem with incremental non-compressed backups
  - Set a memory limit to xz to avoid massive memory usage

9 years agohammer - Better trailing '/' handling on PFS paths
Antonio Huete Jimenez [Tue, 18 Nov 2014 13:15:49 +0000 (14:15 +0100)]
hammer - Better trailing '/' handling on PFS paths

- Remove all trailing slashes from PFS paths to make sure
  there are no problems when performing operations on them.

9 years agoudp: Fix parameter order of udp_addrcpu()
Sepherosa Ziehau [Sun, 23 Nov 2014 21:32:08 +0000 (05:32 +0800)]
udp: Fix parameter order of udp_addrcpu()

9 years agoRemove obsolete ieee80211_amrr.9 manual page.
Sascha Wildner [Thu, 30 Oct 2014 15:19:37 +0000 (16:19 +0100)]
Remove obsolete ieee80211_amrr.9 manual page.

9 years agorc.8: Mention 'reload', which is enabled frequently to kill -HUP daemons.
Sascha Wildner [Wed, 29 Oct 2014 18:08:59 +0000 (19:08 +0100)]
rc.8: Mention 'reload', which is enabled frequently to kill -HUP daemons.

Reported-by: Matteo Cypriani <mcy@lm7.fr>
9 years agoboot/loader: Autoload XHCI support (xhci.ko).
Sascha Wildner [Wed, 12 Nov 2014 21:39:47 +0000 (22:39 +0100)]
boot/loader: Autoload XHCI support (xhci.ko).

This should help with issues people were having when trying to
boot a DragonFly USB IMG from a thumb drive plugged into a
USB 3 port.

9 years agousbdi.9: Some small fixes.
Sascha Wildner [Tue, 18 Nov 2014 22:33:00 +0000 (23:33 +0100)]
usbdi.9: Some small fixes.

9 years agomsk.4: Document that MSI is turned off by default.
Sascha Wildner [Thu, 20 Nov 2014 19:09:34 +0000 (20:09 +0100)]
msk.4: Document that MSI is turned off by default.

9 years ago-h (human-readable counters) for netstat
Antonio Nikishaev [Sun, 23 Nov 2014 11:23:33 +0000 (15:23 +0400)]
-h (human-readable counters) for netstat

9 years agovirtio_pci: Use device_probe_and_attach(), instead of DEVICE_ATTACH().
Imre Vadasz [Sat, 22 Nov 2014 08:29:49 +0000 (09:29 +0100)]
virtio_pci: Use device_probe_and_attach(), instead of DEVICE_ATTACH().

* By directly calling DEVICE_ATTACH(), we didn't get automatically created
  sysctl nodes (added in 8e4d13764bdfc916c23fb22158c65e486dce631c), and
  we didn't get automatic dmesg messages on child driver attachement
  (e.g. "vtblk0: <VirtIO Block Adapter> on virtio_pci1") .

* Since we have no direct equivalent to FreeBSD's device_attach(), use
  device_probe_and_attach(). This means we do a vtpci_set_status() cycle
  even if no matching driver is found.

9 years agorc.subr: Add required_modules processing.
Peter Avalos [Sun, 31 Aug 2014 14:33:15 +0000 (07:33 -0700)]
rc.subr: Add required_modules processing.

This will kldload appropriate modules, needed by some dports (e.g.
openvpn).

Obtained-from:   FreeBSD

9 years agotop: fix per status process count reporting
Joris Giovannangeli [Wed, 19 Nov 2014 11:41:32 +0000 (12:41 +0100)]
top: fix per status process count reporting

9 years agoWorld: Remove the X11BASE variable
François Tigeot [Sun, 23 Nov 2014 15:32:59 +0000 (16:32 +0100)]
World: Remove the X11BASE variable

Requested-by: marino
9 years agoOpenSSH: Correctly set xauth's path (2/2)
François Tigeot [Sun, 23 Nov 2014 11:41:12 +0000 (12:41 +0100)]
OpenSSH: Correctly set xauth's path (2/2)

X11BASE is used internally by dports and setting it globally
can be dangerous.
Only define this variable in the OpenSSH makefiles.

9 years agoservice(8): Sync with FreeBSD.
Robin Hahling [Sat, 22 Nov 2014 11:47:38 +0000 (12:47 +0100)]
service(8): Sync with FreeBSD.

9 years agoservice(8): Fix error message being displayed when invoking service
Robin Hahling [Sat, 22 Nov 2014 12:41:09 +0000 (13:41 +0100)]
service(8): Fix error message being displayed when invoking service

service(8) has been imported from FreeBSD. However, DragonFly rc(8) does
not have 'nojail', thus this would have no effect on the call to
rcorder(8).

9 years agorc.subr: Add function to find scripts in local_startup directories
Robin Hahling [Sat, 22 Nov 2014 12:08:11 +0000 (13:08 +0100)]
rc.subr: Add function to find scripts in local_startup directories

* Add 'find_local_scripts()' function which is useful for
service(8).

* Fix reference to function in service.sh. This fixes two issues in
  service(8) for which 'service -e' and 'service -l' would simply fail
  to list local startup scripts.

'find_local_scripts()' has been imported from FreeBSD, where it is
called 'find_local_scripts_new()'.

9 years agoOpenSSH: Correctly set xauth's path
François Tigeot [Sun, 23 Nov 2014 10:11:42 +0000 (11:11 +0100)]
OpenSSH: Correctly set xauth's path

Revision 111f4c913a18de9586649cc1a374240679ec903a saw the removal
of X11BASE from the tree.

Howewer, it is still required by ssh(1) and sshd(8) to set the
default location of xauth(1).

Put it back but change the value to /usr/local following the change
from pkgsrc to dports.

9 years agodhclient: Fix a busy loop
Markus Pfeiffer [Thu, 20 Nov 2014 19:55:32 +0000 (19:55 +0000)]
dhclient: Fix a busy loop

The ifi->linkstat variable seemed to be not updated after the poll
returns in dispatch.c. This might only be a hack, but it makes the
busylooping go away.

9 years agosound/pcm - Attempt to fix 'play interrupt timeout, channel dead' error
Matthew Dillon [Thu, 20 Nov 2014 18:58:14 +0000 (10:58 -0800)]
sound/pcm - Attempt to fix 'play interrupt timeout, channel dead' error

* Fix the timeout calculation to properly calculate the buffering
  timeout.

* Adjusted code taken from bug 2067 submission.

PR: 2067

9 years agodrm: Use lockmgr locks with Linux wait queues
François Tigeot [Tue, 18 Nov 2014 21:18:03 +0000 (22:18 +0100)]
drm: Use lockmgr locks with Linux wait queues

* On Linux, it is possible to grab a second spinlock in an already
  spinlock-protected code section.

* The wait_event() macro is used in such a situation in the i915 driver.
  One of the event checks itself tries to grab a second lock. What's more,
  this second lock is a lockmgr lock in the DragonFly kernel. This results
  in the following situation:

    spinlock
    lockmgr LK_EXCLUSIVE
    spinunlock

* Unfortunately if the lockmgr lock can't be acquired, the thread is put
  to sleep and a thread sleeping with a spinlock held leads to a general
  system freeze or a kernel panic.

* For that reason, we can't use a spinlock in Linux wait queues. Change
  the internal wait_queue_head_t lock to a lockmgr lock.

Thanks go to Imre Vadász for spotting this horrible issue.

9 years agodrm: Make wait_event_interruptible interruptible and fix its return value.
Imre Vadasz [Sat, 15 Nov 2014 15:59:06 +0000 (16:59 +0100)]
drm: Make wait_event_interruptible interruptible and fix its return value.

* __wait_event_common now works like wait_event_interruptible_timeout does
  in Linux.

* wait_event_interruptible uses different return values than the other
  wait_event variants.

* translate -ERESTARTSYS to -EINTR in two obvious places in radeon_gem.c,
  before returning from an ioctl handler.

9 years agodrm: Use the ERESTARTSYS error code
François Tigeot [Sun, 16 Nov 2014 22:14:17 +0000 (23:14 +0100)]
drm: Use the ERESTARTSYS error code

* Linux kernel functions can return -ERESTARTSYS in some cases, a
  negative value indicating an error (typically -512)

* Howewer, ERESTARTSYS was previously as ERESTART, itself defined
  as -1 in *BSD kernels

* The -ERESTARTSYS return value thus was positive on the DragonFly
  kernel, potentially breaking various drm error checks.

* Fix this issue by defining ERESTARTSYS separately

Thanks-to: Imre Vadasz for discovering the original problem

9 years agodrm: Add linux/mm.h
François Tigeot [Sun, 16 Nov 2014 21:20:18 +0000 (22:20 +0100)]
drm: Add linux/mm.h

Obtained-from: FreeBSD's OFED framework

9 years agonewsyslog(8): use the size of the file instead of the blocks...
Robin Hahling [Sun, 16 Nov 2014 10:13:01 +0000 (11:13 +0100)]
newsyslog(8): use the size of the file instead of the blocks...

... it takes on disk, as advertised in newsyslog.conf(5).

Taken-from: FreeBSD

9 years agodrm/radeon: Replace some custom code by Linux wait queues
François Tigeot [Sun, 16 Nov 2014 17:29:44 +0000 (18:29 +0100)]
drm/radeon: Replace some custom code by Linux wait queues

9 years agodrm/ttm: Fix ttm_bo_wait_unreserved()
François Tigeot [Sun, 16 Nov 2014 17:09:45 +0000 (18:09 +0100)]
drm/ttm: Fix ttm_bo_wait_unreserved()

By using the wait event API and code from Linux 3.8.13

The old implementation of this function had a tendency to wrongly
go to an uninterruptible sleep state.

9 years agokernel/ndis - Fix flag usage in a macro.
Antonio Huete Jimenez [Fri, 14 Nov 2014 22:26:06 +0000 (23:26 +0100)]
kernel/ndis - Fix flag usage in a macro.

- For identifying system processes, Use P_SYSTEM for
  AT_PASSIVE_LEVEL() macro.

9 years agokernel - Rename unused flag.
Antonio Huete Jimenez [Fri, 14 Nov 2014 22:17:40 +0000 (23:17 +0100)]
kernel - Rename unused flag.

- This flag used to identify whether a process was a system one.
  Currently, we can use P_SYSTEM flag for that.

9 years agopkill - Fix a problem identifying system threads.
Antonio Huete Jimenez [Fri, 14 Nov 2014 21:51:52 +0000 (22:51 +0100)]
pkill - Fix a problem identifying system threads.

- As of commit 65a0e3d68b951f39cc39be7808e11e9de908d9fc the test to
  check whether a process is a system one or not was replaced by a
  wrong one. Restore that behaviour so that they are excluded by pkill(1).

9 years agoSync zoneinfo database with tzdata2014j from ftp://ftp.iana.org/tz/releases v4.0.0 v4.0.0rc3
Sascha Wildner [Wed, 12 Nov 2014 20:20:21 +0000 (21:20 +0100)]
Sync zoneinfo database with tzdata2014j from ftp://ftp.iana.org/tz/releases

* Turks & Caicos' switch from US eastern time to UTC-4 year-round
    did not occur on 2014-11-02 at 02:00.  It's currently scheduled
    for 2015-11-01 at 02:00.  (Thanks to Chris Walton.)

* Many corrections to pre-1989 time stamps of Asia/Seoul and
    Asia/Pyongyang.

* Change various zones into links where they differ only in pre-1970
    time stamps.

* Miscenallenous commentary adjustments.

9 years agojls - Fix seg-fault and formatting
Matthew Dillon [Wed, 12 Nov 2014 02:24:08 +0000 (18:24 -0800)]
jls - Fix seg-fault and formatting

* Fix seg-fault when no IPs are configured for a jail.

* Improve formatting, increase path to 15 characters.

9 years agokernel - Add reapctl() system call for managing sub-processes (5) -> procctl
Matthew Dillon [Tue, 11 Nov 2014 19:17:01 +0000 (11:17 -0800)]
kernel - Add reapctl() system call for managing sub-processes (5) -> procctl

* Last commit was incomplete.  reaper_get() must be used to obtain
  the reaper in the RFNOWAIT case.

9 years agokernel - Add reapctl() system call for managing sub-processes (4) -> procctl
Matthew Dillon [Tue, 11 Nov 2014 18:49:10 +0000 (10:49 -0800)]
kernel - Add reapctl() system call for managing sub-processes (4) -> procctl

* Reparent to the correct reaper in the fork/RFNOWAIT case.

9 years agokernel - Add reapctl() system call for managing sub-processes (3) -> procctl() v4.0.0rc2
Matthew Dillon [Tue, 11 Nov 2014 06:37:47 +0000 (22:37 -0800)]
kernel - Add reapctl() system call for managing sub-processes (3) -> procctl()

* After discussions, rename reapctl() -> procctl() and adjust
  the API to be compatible with FreeBSD.

* bapt will implement the same exact feature in FreeBSD via procctl().

9 years agokernel - Add reapctl() system call for managing sub-processes (2)
Matthew Dillon [Mon, 10 Nov 2014 04:10:37 +0000 (20:10 -0800)]
kernel - Add reapctl() system call for managing sub-processes (2)

* subtract 1 from refs returned in status, so they roughly match the
  number of processes which are direct children of the caller.

* Load udata.status.pid_head even if we have not acquired reaping control.
  This can be useful information either way.

9 years agokernel - Add reapctl() system call for managing sub-processes
Matthew Dillon [Mon, 10 Nov 2014 04:03:02 +0000 (20:03 -0800)]
kernel - Add reapctl() system call for managing sub-processes

* Add reapctl().  This system call allows the current process to become
  the designated reaper for all sub-processes that are directly or indirectly
  forked under it, even if they detach.

  Instead of reparenting to init, related sub-processes will reparent to
  up the tree to the nearest process with reaping management enabled.

* The system call can be run by any user.  Multiple processes in the
  running topology can be reap masters for the processes under them,
  include sub-processes being reap-masters for processes under them,
  recursively.

* The system call provides an easy way to ensure that all processes under
  the current process, when it is a reap master, to be killed.  The first
  child pid under management can be queried, killed, waited upon, and the
  service monitor then simply loops until no children remain.

  Normally this information might not be available or require a 'ps' style
  (expensive) run to obtain.  This way it can be done trivially and
  dependably via reapctl().

9 years agodev/drm: Implement kqueue support; Wake up blocking reads
Imre Vadasz [Fri, 7 Nov 2014 19:49:37 +0000 (20:49 +0100)]
dev/drm: Implement kqueue support; Wake up blocking reads

* Add a call to drm_event_wakeup() in drm/radeon.

* Flesh out the stubbed kqueue support.

* Blocking reads were not woken up because of a typo in the wakeup call.

9 years agousb4bsd/if_urndis: Add a missing KKASSERT().
Sascha Wildner [Thu, 6 Nov 2014 21:35:39 +0000 (22:35 +0100)]
usb4bsd/if_urndis: Add a missing KKASSERT().

While here, remove an unused URNDIS_LOCK_ASSERT() parameter.

9 years agourndis.4: No ifmedia support in this driver.
Sascha Wildner [Thu, 6 Nov 2014 18:59:34 +0000 (19:59 +0100)]
urndis.4: No ifmedia support in this driver.