]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoResolve a LOR after r246616. Protect control requests using the USB device
hselasky [Wed, 13 Feb 2013 12:35:17 +0000 (12:35 +0000)]
Resolve a LOR after r246616. Protect control requests using the USB device
enumeration lock. Make sure all callers of usbd_enum_lock() check the return
value. Remove the control transfer specific lock. Bump the FreeBSD version
number, hence external USB modules may need to be recompiled due to a USB
device structure change.

MFC after: 1 week

11 years agoAdd new USB ID to FTDI driver.
hselasky [Wed, 13 Feb 2013 08:28:27 +0000 (08:28 +0000)]
Add new USB ID to FTDI driver.

MFC after: 1 week
PR: kern/175893
Submitted by: Tomek

11 years agoAdd specific supported revision of D-Link DWA-140 rev B1, B2.
hselasky [Wed, 13 Feb 2013 08:20:29 +0000 (08:20 +0000)]
Add specific supported revision of D-Link DWA-140 rev B1, B2.

Submitted by: PseudoCylon
MFC after: 1 week

11 years agoFix my email.
glebius [Wed, 13 Feb 2013 07:32:09 +0000 (07:32 +0000)]
Fix my email.

11 years agoAdd myself as a ports committer and my mentor relationship.
pclin [Wed, 13 Feb 2013 05:44:35 +0000 (05:44 +0000)]
Add myself as a ports committer and my mentor relationship.

Approved by: swills (mentor)

11 years agoPull out the if_transmit() work and revert back to ath_start().
adrian [Wed, 13 Feb 2013 05:32:19 +0000 (05:32 +0000)]
Pull out the if_transmit() work and revert back to ath_start().

My changed had some rather significant behavioural changes to throughput.
The two issues I noticed:

* With if_start and the ifnet mbuf queue, any temporary latency
  would get eaten up by some mbufs being queued.  With ath_transmit()
  queuing things to ath_buf's, I'd only get 512 TX buffers before I
  couldn't queue any further frames.

* There's also some non-zero latency involved with TX being pushed
  into a taskqueue via direct dispatch.  Any time the scheduler didn't
  immediately schedule the ath TX task would cause extra latency.
  Various 1ge/10ge drivers implement both direct dispatch (if the TX
  lock can be acquired) and deferred task transmission (if the TX lock
  can't be acquired), with frames being pushed into a drbd queue.
  I'll have to do this at some point, but until I figure out how to
  deal with 802.11 fragments, I'll have to wait a while longer.

So what I saw:

* lots of extra latency, specially under load - if the taskqueue
  wasn't immediately scheduled, things went pear shaped;

* any extra latency would result in TX ath_buf's taking their sweet time
  being replenished, so any further calls to ath_transmit() would drop
  mbufs.

* .. yes, there's no explicit backpressure here - things are just dropped.
  Eek.

With this, the general performance has gone up, but those subtle if_start()
related race conditions are back.  For some reason, this is doubly-obvious
with the AR5416 NIC and I don't quite understand why yet.

There's an unrelated issue with AR5416 performance in STA mode (it's
fine in AP mode when bridging frames, weirdly..) that requires a little
further investigation.  Specifically - it works fine on a Lenovo T40
(single core CPU) running a March 2012 9-STABLE kernel, but a Lenovo T60
(dual core) running an early November 2012 kernel behaves very poorly.
The same hardware with an AR9160 or AR9280 behaves perfectly.

11 years agoIntroduce PLATFORMMETHOD_END and use it.
rpaulo [Wed, 13 Feb 2013 02:21:45 +0000 (02:21 +0000)]
Introduce PLATFORMMETHOD_END and use it.

11 years ago- Make actually printing path of AF_LOCAL socket types.
zont [Tue, 12 Feb 2013 19:10:54 +0000 (19:10 +0000)]
- Make actually printing path of AF_LOCAL socket types.

MFC after: 1 week

11 years ago- Use correct size of copying different socket structures.
zont [Tue, 12 Feb 2013 18:48:11 +0000 (18:48 +0000)]
- Use correct size of copying different socket structures.

MFC after: 1 week

11 years agoEliminate the PC_CURTHREAD symbol and load the current thread's
marcel [Tue, 12 Feb 2013 17:38:35 +0000 (17:38 +0000)]
Eliminate the PC_CURTHREAD symbol and load the current thread's
thread structure pointer atomically from r13 (the pcpu pointer)
for the current CPU/core.
Add a CTASSERT in machdep.c to make sure that pc_curthread is in
fact the first field in struct pcpu.

The only non-atomic operations left were those related to process-
space operations, such as casuword, subyte, suword16, fubyte,
fuword16, copyin, copyout and their variations.

The casuword function has been re-structured more complete than
the others. This way we have an example of a better bundling
without introducing a lot of risk when we get it wrong. The
other functions can be rebundled in separate commits and with
the appropriate testing.

11 years agoEliminate padding by moving 'narg' next to 'code'. Both are 32-bit
marcel [Tue, 12 Feb 2013 17:24:41 +0000 (17:24 +0000)]
Eliminate padding by moving 'narg' next to 'code'. Both are 32-bit
entities in the syscall_args structure that otherwise has 64-bit
only fields.

11 years agoReform the busdma API so that new types may be added without modifying
kib [Tue, 12 Feb 2013 16:57:20 +0000 (16:57 +0000)]
Reform the busdma API so that new types may be added without modifying
every architecture's busdma_machdep.c.  It is done by unifying the
bus_dmamap_load_buffer() routines so that they may be called from MI
code.  The MD busdma is then given a chance to do any final processing
in the complete() callback.

The cam changes unify the bus_dmamap_load* handling in cam drivers.

The arm and mips implementations are updated to track virtual
addresses for sync().  Previously this was done in a type specific
way.  Now it is done in a generic way by recording the list of
virtuals in the map.

Submitted by: jeff (sponsored by EMC/Isilon)
Reviewed by: kan (previous version), scottl,
mjacob (isp(4), no objections for target mode changes)
Discussed with:      ian (arm changes)
Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris),
amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)

11 years agoNow that we actually use more memory descriptors, make sure to dump
marcel [Tue, 12 Feb 2013 16:51:43 +0000 (16:51 +0000)]
Now that we actually use more memory descriptors, make sure to dump
them as well.

11 years agoo Bring in sync decoding the first nfssvc(2) parameter (flags) with
pluknet [Tue, 12 Feb 2013 13:01:34 +0000 (13:01 +0000)]
o Bring in sync decoding the first nfssvc(2) parameter (flags) with
the current definitions location.
o Respect numbers in NFSSVC_* (e.g. NFSSVC_V4ROOTEXPORT).

MFC after: 1 week

11 years agoSubstitute '#ifdef ALIGNED_POINTER' with '#ifndef __NO_STRICT_ALIGNMENT',
glebius [Tue, 12 Feb 2013 11:24:37 +0000 (11:24 +0000)]
Substitute '#ifdef ALIGNED_POINTER' with '#ifndef __NO_STRICT_ALIGNMENT',
since the former is defined everywhere. This cuts off some code not
necessary on non strict aligment arches.

Reviewed by: adrian
Sponsored by: Nginx, Inc.

11 years agoRemove debug output
gonzo [Tue, 12 Feb 2013 07:27:40 +0000 (07:27 +0000)]
Remove debug output

11 years agoWhen clang builds libc it may insert calls to __aeabi_* functions. Normally
andrew [Tue, 12 Feb 2013 06:04:51 +0000 (06:04 +0000)]
When clang builds libc it may insert calls to __aeabi_* functions. Normally
this is not a problem as they are resolved by libgcc. The exception is for
the __aeabi_mem* functions. These call back into libc to the appropriate
function. This causes issues for static binaries as we only link against
libc once so there is no way for it to call into libgcc and back.

The fix for this is to include these symbols in libc but keep them hidden
so binaries use the libgcc version.

11 years agoAllow us to build clang for ARM EABI. Clang and llvm use the
andrew [Tue, 12 Feb 2013 05:56:00 +0000 (05:56 +0000)]
Allow us to build clang for ARM EABI. Clang and llvm use the
arm-gnueabi-freebsd10.0 triple for EABI. Use this when we are on arm or
armv6 and are building for EABI.

Reviewed by: dim

11 years agoStyle.
pjd [Mon, 11 Feb 2013 23:14:54 +0000 (23:14 +0000)]
Style.

11 years agoUpdate comments to reflect r246689.
marius [Mon, 11 Feb 2013 23:05:10 +0000 (23:05 +0000)]
Update comments to reflect r246689.

11 years agoStyle.
pjd [Mon, 11 Feb 2013 22:54:23 +0000 (22:54 +0000)]
Style.

11 years agoMake SYSCTL_{LONG,QUAD,ULONG,UQUAD}(9) work as advertised and also handle
marius [Mon, 11 Feb 2013 21:50:00 +0000 (21:50 +0000)]
Make SYSCTL_{LONG,QUAD,ULONG,UQUAD}(9) work as advertised and also handle
constant values.

Reviewed by: kib
MFC after: 3 days

11 years agoMerge zfs_ioctl.c code that should have been merged together with ZFS v28.
mm [Mon, 11 Feb 2013 21:10:55 +0000 (21:10 +0000)]
Merge zfs_ioctl.c code that should have been merged together with ZFS v28.
Fixes several problems if working with read-only pools.

Changed code originaly introduced in onnv-gate 13061:bda0decf867b
Contains changes up to illumos-gate 13700:4bc0783f6064

PR: kern/175897
Suggested by: avg

MFC after: 2 weeks

11 years agoSend the adaptation layer indication only if set by the user.
tuexen [Mon, 11 Feb 2013 21:02:49 +0000 (21:02 +0000)]
Send the adaptation layer indication only if set by the user.

MFC after: 3 days
Discussed with: rrs

11 years agoImplement guest vcpu pinning using 'pthread_setaffinity_np(3)'.
neel [Mon, 11 Feb 2013 20:36:07 +0000 (20:36 +0000)]
Implement guest vcpu pinning using 'pthread_setaffinity_np(3)'.

Prior to this change pinning was implemented via an ioctl (VM_SET_PINNING)
that called 'sched_bind()' on behalf of the user thread.

The ULE implementation of 'sched_bind()' bumps up 'td_pinned' which in turn
runs afoul of the assertion '(td_pinned == 0)' in userret().

Using the cpuset affinity to implement pinning of the vcpu threads works with
both 4BSD and ULE schedulers and has the happy side-effect of getting rid
of a bunch of code in vmm.ko.

Discussed with: grehan

11 years agoUse the right year.
delphij [Mon, 11 Feb 2013 18:22:26 +0000 (18:22 +0000)]
Use the right year.

Noticed by: Denis Ahrens <denis h3q com>

11 years agoMFV r246633:
mm [Mon, 11 Feb 2013 14:29:38 +0000 (14:29 +0000)]
MFV r246633:
Import vendor bugfixes regarding SA rounding, header size and layout.
This was already partially fixed by avg.

Illumos ZFS issues:
  3512 rounding discrepancy in sa_find_sizes()
  3513 mismatch between SA header size and layout

References:
  https://www.illumos.org/issues/3512
  https://www.illumos.org/issues/3513

MFC after: 2 weeks

11 years agoMFV r246394:
mm [Mon, 11 Feb 2013 13:59:57 +0000 (13:59 +0000)]
MFV r246394:
Add tunable to allow block allocation on degraded vdevs.

Illumos ZFS issues:
  3507 Tunable to allow block allocation even on degraded vdevs

References:
  https://www.illumos.org/issues/3507

MFC after: 2 weeks

11 years agoDon't send kernel provided information in the User Initiated
tuexen [Mon, 11 Feb 2013 13:57:03 +0000 (13:57 +0000)]
Don't send kernel provided information in the User Initiated
ABORT cause, since the user can also provide this kind of
information. So the receiver doesn't know who provided the
information.
While there: Fix a bug where the stack would send a malformed
ABORT chunk when using a send() call with SCTP_ABORT|SCT_SENDALL
flags.

MFC after: 3 days

11 years agoMajor update for unix_cmsg from Andrey Simonenko.
pluknet [Mon, 11 Feb 2013 12:56:23 +0000 (12:56 +0000)]
Major update for unix_cmsg from Andrey Simonenko.

Quoting the submitter:
- Added tests for SCM_BINTIME, LOCAL_PEERCRED, cmsghdr.cmsg_len
- Code that checks correctness of groups was corrected (getgroups(2) change)
- unix_cmsg.c was completely redesigned and simplified
- Use less timeout value in unix_cmsg.c for faster work
- Added support for not sending data in a message, not sending data and
  data array associated with a cmsghdr structure in a message
- Existent tests were improved
- unix_cmsg.t was redesigned and simplified

Correctness of unix_cmsg verified on 7.1-STABLE, 9.1-STABLE and 10-CURRENT.

PR: bin/131567
Submitted by: Andrey Simonenko <simon@comsys.ntu-kpi.kiev.ua>
MFC after: 2 weeks

11 years agoMFV r246392:
mm [Mon, 11 Feb 2013 12:42:11 +0000 (12:42 +0000)]
MFV r246392:
Import vendor ZFS bugfix fixing a possible deadlock in arc_read().

Illumos ZFS issues:
  3498 panic in arc_read(): !refcount_is_zero(&pbuf->b_hdr->b_refcnt)

References:
  https://www.illumos.org/issues/3498

MFC after: 2 weeks

11 years agoA10 reset mechanism is the same for all boards in this family so remove
gonzo [Mon, 11 Feb 2013 11:33:56 +0000 (11:33 +0000)]
A10 reset mechanism is the same for all boards in this family so remove
redundant reset function implementation pointer. We might want to
ressurect it later when support for other Allwinner chips is introduced.

11 years agoAdd watchdog driver for Allwinner A10
gonzo [Mon, 11 Feb 2013 11:31:23 +0000 (11:31 +0000)]
Add watchdog driver for Allwinner A10

11 years ago Resolve source address selection in presense of CARP. Add a couple
glebius [Mon, 11 Feb 2013 10:58:22 +0000 (10:58 +0000)]
  Resolve source address selection in presense of CARP. Add a couple
of helper functions:

- carp_master()   - boolean function which is true if an address
    is in the MASTER state.
- ifa_preferred() - boolean function that compares two addresses,
    and is aware of CARP.

  Utilize ifa_preferred() in ifa_ifwithnet().

  The previous version of patch also changed source address selection
logic in jails using carp_master(), but we failed to negotiate this part
with Bjoern. May be we will approach this problem again later.

Reported & tested by: Anton Yuzhaninov <citrin citrin.ru>
Sponsored by: Nginx, Inc

11 years agoCross-reference vfs_unbusy(9).
pluknet [Mon, 11 Feb 2013 10:14:12 +0000 (10:14 +0000)]
Cross-reference vfs_unbusy(9).

MFC after: 1 week

11 years agoAdd -lheimntlm to LDADD directly.
brooks [Mon, 11 Feb 2013 09:45:24 +0000 (09:45 +0000)]
Add -lheimntlm to LDADD directly.

With the current binutils, symbols from libheimtlm.so are loaded because
it is referenced by DT_NEEDED.  This feature is not implemented in
mclinker (https://code.google.com/p/mclinker/issues/detail?id=104).
I encountered the same issue when linking with a recent devel/binutils
invoked via clang.  This was the only use of DT_NEEDED in the tree so
removing it simplifies toolchain requirements.

Submitted by: Pete Chou <petechou@gmail.com> (mclinker issue)

11 years agoUse DEVMETHOD_END.
rpaulo [Mon, 11 Feb 2013 08:20:21 +0000 (08:20 +0000)]
Use DEVMETHOD_END.

11 years agoPut this back into the ath taskqueue rather than the ath TX taskqueue.
adrian [Mon, 11 Feb 2013 07:49:40 +0000 (07:49 +0000)]
Put this back into the ath taskqueue rather than the ath TX taskqueue.

This now should mean all the entry points into the software TX
scheduler are back in the same taskqueue.

11 years agoMFV r246390:
mm [Mon, 11 Feb 2013 07:48:57 +0000 (07:48 +0000)]
MFV r246390:
Import minor type change in refcount.h header from vendor (illumos).

MFC after: 2 weeks

11 years agoGo back to direct-dispatch of the software queue and frame TX paths
adrian [Mon, 11 Feb 2013 07:48:26 +0000 (07:48 +0000)]
Go back to direct-dispatch of the software queue and frame TX paths
when they're being called from the TX completion handler.

Going (back) through the taskqueue is just adding extra locking and
latency to packet operations.  This improves performance a little bit
on most NICs.

It still hasn't restored the original performance of the AR5416 NIC
but the AR9160, AR9280 and later NICs behave very well with this.

Tested:

* AR5416 STA (still tops out at ~ 70mbit TCP, rather than 150mbit TCP..)
* AR9160 hostap (good for both TX and RX)
* AR9280 hostap (good for both TX and RX)

11 years agoTeach athalq about the recent if_ath_alq timestamp format change.
adrian [Mon, 11 Feb 2013 02:54:24 +0000 (02:54 +0000)]
Teach athalq about the recent if_ath_alq timestamp format change.

11 years agoExtend the timestamp to be a timeval, rather than ticks.
adrian [Mon, 11 Feb 2013 02:48:49 +0000 (02:48 +0000)]
Extend the timestamp to be a timeval, rather than ticks.

This makes it easier to see TX and RX buffer latencies.

11 years agoProvide verbose help for fdt commands on platforms that use it.
kientzle [Mon, 11 Feb 2013 02:15:26 +0000 (02:15 +0000)]
Provide verbose help for fdt commands on platforms that use it.

11 years agoCapability rights for process management via process descriptors do exist
pjd [Mon, 11 Feb 2013 00:10:35 +0000 (00:10 +0000)]
Capability rights for process management via process descriptors do exist
already, so uncomment them.

Sponsored by: The FreeBSD Foundation

11 years agoAdd CAP_MKNOD right.
pjd [Sun, 10 Feb 2013 23:51:26 +0000 (23:51 +0000)]
Add CAP_MKNOD right.

Sponsored by: The FreeBSD Foundation

11 years agofts: Use O_DIRECTORY when opening name that might be changed by attacker.
jilles [Sun, 10 Feb 2013 23:09:15 +0000 (23:09 +0000)]
fts: Use O_DIRECTORY when opening name that might be changed by attacker.

There are uncommon cases where fts_safe_changedir() may be called with a
non-NULL name that is not "..". Do not block or worse if an attacker put (a
(symlink to) a fifo or device where a directory used to be.

MFC after: 1 week

11 years agoRemove the ia64-specific code fragment, which effect is more cleanly
kib [Sun, 10 Feb 2013 20:08:33 +0000 (20:08 +0000)]
Remove the ia64-specific code fragment, which effect is more cleanly
done by the call to trans_prot() function a line before.

Discussed with: Oliver Pinter <oliver.pntr@gmail.com>
MFC after: 1 week

11 years agoMake sure that received packets for removed addresses are handled
tuexen [Sun, 10 Feb 2013 19:57:19 +0000 (19:57 +0000)]
Make sure that received packets for removed addresses are handled
consistently. While there, make variable names consistent.

MFC after: 3 days

11 years agoext2fs: Use prototype declarations for function definitions
pfg [Sun, 10 Feb 2013 19:49:37 +0000 (19:49 +0000)]
ext2fs: Use prototype declarations for function definitions

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoUse the entire 64 bits of 'bar.pbi_length' when printing the bar size.
neel [Sun, 10 Feb 2013 19:35:40 +0000 (19:35 +0000)]
Use the entire 64 bits of 'bar.pbi_length' when printing the bar size.

This allows bar sizes greater than or equal to 4GB to be displayed correctly.

11 years agoMFV r246388:
mm [Sun, 10 Feb 2013 19:32:55 +0000 (19:32 +0000)]
MFV r246388:

Import vendor bugfixes

Illumos ZFS issues:
  3422 zpool create/syseventd race yield non-importable pool
  3425 first write to a new zvol can fail with EFBIG

References:
  https://www.illumos.org/issues/3422
  https://www.illumos.org/issues/3425

MFC after: 2 weeks

11 years agoAdd bootcamp support to the loader.
ae [Sun, 10 Feb 2013 19:27:17 +0000 (19:27 +0000)]
Add bootcamp support to the loader.

Tested by: dchagin
MFC after: 1 week

11 years agoImprove code style. No functional change.
tuexen [Sun, 10 Feb 2013 19:21:17 +0000 (19:21 +0000)]
Improve code style. No functional change.

MFC after: 3 days

11 years agofind: Run when cwd cannot be opened, except with -execdir or -delete.
jilles [Sun, 10 Feb 2013 18:56:37 +0000 (18:56 +0000)]
find: Run when cwd cannot be opened, except with -execdir or -delete.

fts(3) can run (albeit more slowly and imposing the {PATH_MAX} limit) when
the current directory cannot be opened. Therefore, do not make a failure to
open the current directory (for returning to it later in -exec) fatal.

If -execdir or -delete are used, the expectation is that fts(3) will use
chdir to avoid race conditions (except for -execdir with -L). Do not break
this expectation any more than it already is by still failing if the current
directory cannot be opened.

11 years agoDon't try to suppress the inclusion of the build date in named's version
cperciva [Sun, 10 Feb 2013 17:58:44 +0000 (17:58 +0000)]
Don't try to suppress the inclusion of the build date in named's version
string by undefining __DATE__, since (unlike gcc) clang doesn't allow us
to do that.  Instead, define NO_VERSION_DATE, which was helpfully added
to the named source code for exactly this purpose.

11 years agoBackport vendor changes in zfs(8) manual page (MFV r246389)
mm [Sun, 10 Feb 2013 17:10:07 +0000 (17:10 +0000)]
Backport vendor changes in zfs(8) manual page (MFV r246389)

Illumos ZFS issues:
  3380 zfs man page: documentation for zfs allow is confusing

References:
  https://www.illumos.org/issues/3380

MFC after: 2 weeks

11 years agoFix minor memory leak.
pjd [Sun, 10 Feb 2013 15:56:47 +0000 (15:56 +0000)]
Fix minor memory leak.

11 years agoAssert that if we are not dealing with keyfile we are dealing with passfile.
pjd [Sun, 10 Feb 2013 15:56:20 +0000 (15:56 +0000)]
Assert that if we are not dealing with keyfile we are dealing with passfile.

11 years agoUse arc4random_buf(3) instead of reimplementing it.
pjd [Sun, 10 Feb 2013 15:55:42 +0000 (15:55 +0000)]
Use arc4random_buf(3) instead of reimplementing it.

11 years agoCorrect spelling of "daemon". No .Dd bump.
gavin [Sun, 10 Feb 2013 14:28:07 +0000 (14:28 +0000)]
Correct spelling of "daemon".  No .Dd bump.

Noticed by: Nathan Rich <Nathan.Rich dynastysystems com>
MFC after: 3 days

11 years agofind: In -execdir ... {} +, only pass one file per invocation.
jilles [Sun, 10 Feb 2013 13:28:02 +0000 (13:28 +0000)]
find: In -execdir ... {} +, only pass one file per invocation.

This is inefficient but ensures that -execdir ... {} + does not mix files
from different directories in one invocation; the command could not access
some files. Files from the same directory should really be handled in one
invocation but this is somewhat more complicated.

11 years agosigqueue(2): Fix typo (EEPERM -> EPERM).
jilles [Sun, 10 Feb 2013 13:20:23 +0000 (13:20 +0000)]
sigqueue(2): Fix typo (EEPERM -> EPERM).

MFC after: 3 days

11 years ago- Move scratch data from the USB bus structure to the USB device structure
hselasky [Sun, 10 Feb 2013 10:56:13 +0000 (10:56 +0000)]
- Move scratch data from the USB bus structure to the USB device structure
so that simultaneous access cannot happen. Protect scratch area using
the enumeration lock. Also reduce stack usage in usbd_transfer_setup()
by moving some big stack members to the scratch area. This saves around
200 bytes of stack.
- Fix a whitespace.

MFC after: 1 week

11 years agoFix correct use of USB header files.
hselasky [Sun, 10 Feb 2013 10:55:20 +0000 (10:55 +0000)]
Fix correct use of USB header files.

11 years ago- Streamline detach logic in wlan drivers, so that
hselasky [Sun, 10 Feb 2013 10:36:16 +0000 (10:36 +0000)]
- Streamline detach logic in wlan drivers, so that
  freed memory cannot be used during detach.
- Remove all panic() calls from the urtw driver because
  panic() is not appropriate here.
- Remove redundant checks for device detached in
  device detach callbacks.
- Use DEVMETHOD_END to mark end of device methods.

MFC after: 2 weeks

11 years agoFix several unsafe pointer dereferences in the buffered_write()
kib [Sun, 10 Feb 2013 10:17:33 +0000 (10:17 +0000)]
Fix several unsafe pointer dereferences in the buffered_write()
function, implementing the sysctl vfs.ffs.set_bufoutput (not used in
the tree yet).

- The current directory vnode dereference is unsafe since fd_cdir
  could be changed and unreferenced, lock the filedesc around and vref
  the fd_cdir.
- The VTOI() conversion of the fd_cdir is unsafe without first
  checking that the vnode is indeed from an FFS mount, otherwise
  the code dereferences a random memory.
- The cdir could be reclaimed from under us, lock it around the
  checks.
- The type of the fp vnode might be not a disk, or it might have
  changed while the thread was in flight, check the type.

Reviewed and tested by: mckusick
MFC after: 2 weeks

11 years agoRemove a racy checks on resident and cached pages for
attilio [Sun, 10 Feb 2013 01:04:10 +0000 (01:04 +0000)]
Remove a racy checks on resident and cached pages for
tmpfs_mapped{read, write}() functions:
- tmpfs_mapped{read, write}() are only called within VOP_{READ, WRITE}(),
  which check before-hand to work only on valid VREG vnodes.  Also the
  vnode is locked for the duration of the work, making vnode reclaiming
  impossible, during the operation. Hence, vobj can never be NULL.
- Currently check on resident pages and cached pages without vm object
  lock held is racy and can do even more harm than good, as a page could
  be transitioning between these 2 pools and then be skipped entirely.
  Skip the checks as lookups on empty splay trees are very cheap.

Discussed with: alc
Tested by: flo
MFC after: 2 weeks

11 years agoAdd nmtree to ITOOLS if it is installed on the host instead of keying off
brooks [Sat, 9 Feb 2013 23:17:28 +0000 (23:17 +0000)]
Add nmtree to ITOOLS if it is installed on the host instead of keying off
the BOOTSTRAPPING variable.  The previous test was wrong because
BOOTSTRAPPING is 0 in most cases.

Tested by: db

11 years agoFix breakage introduced in r246318.
kientzle [Sat, 9 Feb 2013 21:36:14 +0000 (21:36 +0000)]
Fix breakage introduced in r246318.

11 years agoAdd dtc to the build.
kientzle [Sat, 9 Feb 2013 18:14:26 +0000 (18:14 +0000)]
Add dtc to the build.

11 years agoCleanup the handling of address scopes. Announce in the INIT/INIT-ACK
tuexen [Sat, 9 Feb 2013 17:26:14 +0000 (17:26 +0000)]
Cleanup the handling of address scopes. Announce in the INIT/INIT-ACK
only the supported address types. While there, do some whitespace
cleanups.

MFC after: 1 week

11 years agoReference something which exists instead of the non-existent runsocks
eadler [Sat, 9 Feb 2013 17:13:54 +0000 (17:13 +0000)]
Reference something which exists instead of the non-existent runsocks
program.

PR: docs/173664
Submitted by: wkoszek
Approved by: bcr (mentor)

11 years agoFix logic inversion.
eadler [Sat, 9 Feb 2013 17:13:51 +0000 (17:13 +0000)]
Fix logic inversion.

PR: docs/174966
Submitted by: Christian Ullrich <chris+freebsd@chrullrich.net>
Approved by: bcr (mentor)

11 years agoFix some NLS catalogs broken after r245888.
antoine [Sat, 9 Feb 2013 13:31:59 +0000 (13:31 +0000)]
Fix some NLS catalogs broken after r245888.

11 years agoAdd more obsolete files.
antoine [Sat, 9 Feb 2013 13:28:49 +0000 (13:28 +0000)]
Add more obsolete files.

11 years agoFix a bug where HEARTBEATs were still sent in SHUTDOWN_SENT or
tuexen [Sat, 9 Feb 2013 08:27:08 +0000 (08:27 +0000)]
Fix a bug where HEARTBEATs were still sent in SHUTDOWN_SENT or
SHUTDOWN_ACK_SENT state. While there, make the corresponding
code consistent.

MFC after: 1 week

11 years agomdoc: Remove EOL whitespace.
joel [Sat, 9 Feb 2013 07:01:05 +0000 (07:01 +0000)]
mdoc: Remove EOL whitespace.

11 years agoMFV r245512:
delphij [Sat, 9 Feb 2013 06:39:28 +0000 (06:39 +0000)]
MFV r245512:

 * Illumos zfs issue #3035 [1] LZ4 compression support in ZFS.

LZ4 is a new high-speed BSD-licensed compression algorithm created
by Yann Collet that delivers very high compression and decompression
performance compared to lzjb (>50% faster on compression, >80% faster
on decompression and around 3x faster on compression of incompressible
data), while giving better compression ratio [1].

This version of LZ4 corresponds to upstream's [2] revision 85.

Please note that for obvious reasons this is not backward read
compatible.  This means once a pool have LZ4 compressed data, these
data can no longer be read by older ZFS implementations.

Local changes:

 - On-stack hash table disabled and using kernel slab allocator
   instead, at this time.  This requires larger kernel thread stack
   for zio workers.  This may change in the future should we adjusted
   the zio workers' thread stack size.
 - likely and unlikely will be undefined if they are already defined,
   this is required for i386 XEN build.
 - Removed De Bruijn sequence based __builtin_ctz family of builtins
   in favor of the latter.  Both GCC and clang supports these builtins.
 - Changed the way the LZ4 code detects endianness.
 - Manual pages modifications to mention the feature based on Illumos
   counterpart.
 - Boot loader changes to make it support LZ4 decompression.

[1] https://www.illumos.org/issues/3035
[2] http://code.google.com/p/lz4/source/list

Obtained from: Illumos (13921:9d721847e469)
Tested on: FreeBSD/amd64
MFC after: 1 month

11 years agoFix LINT build for ARM.
delphij [Sat, 9 Feb 2013 06:31:22 +0000 (06:31 +0000)]
Fix LINT build for ARM.

11 years agoFix LINT build on amd64.
delphij [Sat, 9 Feb 2013 04:13:45 +0000 (04:13 +0000)]
Fix LINT build on amd64.

11 years agoThe encryption type field needs to be preserved for each descriptor
adrian [Sat, 9 Feb 2013 02:42:01 +0000 (02:42 +0000)]
The encryption type field needs to be preserved for each descriptor
making up a frame, in both a sub-frame and for all frames in an
aggregate.

Tested:

* AR5416, STA mode

11 years agoDo not hold locks around hardware context reads.
np [Sat, 9 Feb 2013 00:35:28 +0000 (00:35 +0000)]
Do not hold locks around hardware context reads.

MFC after: 3 days

11 years agoCorrectly list the usbloader dependencies.
hselasky [Fri, 8 Feb 2013 23:13:46 +0000 (23:13 +0000)]
Correctly list the usbloader dependencies.

11 years agoMake sure we don't leak command buffers when a USB
hselasky [Fri, 8 Feb 2013 22:51:09 +0000 (22:51 +0000)]
Make sure we don't leak command buffers when a USB
command transfer fails.

MFC after: 1 week
Reported by: Ian FREISLICH

11 years agoIn r246282 the KTR_ENTRIES was specified with syntax error, fix it so 'make
delphij [Fri, 8 Feb 2013 22:41:48 +0000 (22:41 +0000)]
In r246282 the KTR_ENTRIES was specified with syntax error, fix it so 'make
universe' would work.

MFC after: 12 days
X-MFC-with: r246282

11 years agoFix regression issue after r244503:
hselasky [Fri, 8 Feb 2013 21:15:47 +0000 (21:15 +0000)]
Fix regression issue after r244503:
Correct init order to fix a NULL pointer access.

MFC after: 1 week
Reported by: Ian FREISLICH

11 years agoext2fs: Replace redundant EXT2_MIN_BLOCK with EXT2_MIN_BLOCK_SIZE.
pfg [Fri, 8 Feb 2013 21:09:44 +0000 (21:09 +0000)]
ext2fs: Replace redundant EXT2_MIN_BLOCK with EXT2_MIN_BLOCK_SIZE.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: make e2fs_maxcontig local and remove tautological check.
pfg [Fri, 8 Feb 2013 20:58:00 +0000 (20:58 +0000)]
ext2fs: make e2fs_maxcontig local and remove tautological check.

e2fs_maxcontig was modelled after UFS when bringing the
"Orlov allocator" to ext2. On UFS fs_maxcontig is kept in the
superblock and is used by userland tools (fsck and growfs),

In ext2 this information is volatile so it is not available
for userland tools, so in this case it doesn't have sense
to carry it in the in-memory superblock.

Also remove a pointless check for MAX(1, x) > 0.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoRemove unused MAXSYMLINKLEN macro.
pfg [Fri, 8 Feb 2013 20:30:19 +0000 (20:30 +0000)]
Remove unused MAXSYMLINKLEN macro.

Reviewed by: mckusick
PR: kern/175794
MFC after: 1 week

11 years agoadd semicolon to end of CALLOUT_HANDLE_INITIALIZER example.
alfred [Fri, 8 Feb 2013 20:13:28 +0000 (20:13 +0000)]
add semicolon to end of CALLOUT_HANDLE_INITIALIZER example.

11 years agopatch: Follow original versioning convention.
pfg [Fri, 8 Feb 2013 19:39:15 +0000 (19:39 +0000)]
patch: Follow original versioning convention.

According to the README file [1] the 12u variant, unlike
the 12g variant, contains no copyleft code. It is therefore
convenient to keep using the original versioning scheme to
prevent confusions.

[1] http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/patch/README

11 years agoFix NFSv4 permission description in setfacl(1) manual page: the 'D'
trasz [Fri, 8 Feb 2013 18:43:47 +0000 (18:43 +0000)]
Fix NFSv4 permission description in setfacl(1) manual page: the 'D'
means delete_child, not delete.

MFC after: 1 week

11 years agoImprove description of the "-m" option to setfacl(1).
trasz [Fri, 8 Feb 2013 18:12:16 +0000 (18:12 +0000)]
Improve description of the "-m" option to setfacl(1).

Submitted by: scottl
MFC after: 1 week

11 years agoIn the setfacl(1) manual page, make it clear that for NFSv4 ACLs,
trasz [Fri, 8 Feb 2013 18:02:28 +0000 (18:02 +0000)]
In the setfacl(1) manual page, make it clear that for NFSv4 ACLs,
one should really use -a and -x instead of -m.

MFC after: 1 week

11 years agoAvoid use of register variables, which some compilers (e.g. clang)
nwhitehorn [Fri, 8 Feb 2013 17:44:44 +0000 (17:44 +0000)]
Avoid use of register variables, which some compilers (e.g. clang)
don't like. It makes the code a little clearer as well.

MFC after: 1 week

11 years agoThe 'end' word was missed in the comment.
kib [Fri, 8 Feb 2013 15:52:20 +0000 (15:52 +0000)]
The 'end' word was missed in the comment.

MFC after:     3 days

11 years agoPrint a warning if not setuid root.
des [Fri, 8 Feb 2013 14:14:00 +0000 (14:14 +0000)]
Print a warning if not setuid root.
Document the need for the setuid bit and how to set it.
Explain why it isn't set by default, and suggest simply adding users
to groups instead.

PR: docs/167741
MFC after: 3 weeks

11 years agoCross-reference newgrp(1), and document the use of pw(8) to set the group
des [Fri, 8 Feb 2013 14:11:12 +0000 (14:11 +0000)]
Cross-reference newgrp(1), and document the use of pw(8) to set the group
password.

PR: docs/167741
MFC after: 3 weeks

11 years agoRemove NO_OBJ from Makefiles that generate manuals because this causes the
dteske [Fri, 8 Feb 2013 11:14:01 +0000 (11:14 +0000)]
Remove NO_OBJ from Makefiles that generate manuals because this causes the
GZIP compressed manuals to appear in ./src instead of the appropriate obj dir.

PR: conf/175844
Submitted by: Dominique Goncalves <dominique.goncalves@gmail.com>

11 years agoFix warning: comparison of unsigned expression < 0 is always false.
pluknet [Fri, 8 Feb 2013 09:54:53 +0000 (09:54 +0000)]
Fix warning: comparison of unsigned expression < 0 is always false.

Reported by: clang