]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
10 years agoFinish MFC of r248291,249741:
marck [Fri, 5 Jul 2013 08:17:48 +0000 (08:17 +0000)]
Finish MFC of r248291,249741:

Change 'status' command to produce one-line easy-parseable output.

Approved by: trociny

git-svn-id: svn://svn.freebsd.org/base/stable/8@252777 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252218:
delphij [Fri, 5 Jul 2013 04:16:52 +0000 (04:16 +0000)]
MFC r252218:

Diff reduction against Illumos, no real change to code itself.

This marks vendor branch revision 252213 as merged, the actual code was
committed in r245479.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252767 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251646 + r252219:
delphij [Fri, 5 Jul 2013 04:11:34 +0000 (04:11 +0000)]
MFC r251646 + r252219:

MFV r251644:

Poor ZFS send / receive performance due to snapshot
hold / release processing (by smh@)

Illumos ZFS issues:
3740 Poor ZFS send / receive performance due to snapshot
     hold / release processing

MFV r252215:

Restore a previous behavior before r251646, where when destructing
ZFS snapshot, the ioctl would return ENOENT when it hit any of
them in the errlist (the new behavior was only return ENOENT when
all returns error).

Illumos ZFS issues:
  3829 fix for 3740 changed behavior of zfs destroy/hold/release ioctl

git-svn-id: svn://svn.freebsd.org/base/stable/8@252765 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251636: illumos #3749 zfs event processing should work on R/O root
delphij [Fri, 5 Jul 2013 04:02:15 +0000 (04:02 +0000)]
MFC r251636: illumos #3749 zfs event processing should work on R/O root
filesystems

This log is a modified version of the original one written by gibbs@,
to account for changes made during the illumos RTI process.

Allow ZFS asynchronous event handling to proceed even if the root file
system is mounted read-only.  This restriction appears to have been put
in place to avoid errors with updating the configuration cache file.
However:

 o The majority of asynchronous event handling does not involve
   configuration cache file updates.
 o The configuration cache file need not be on the root file system,
   so the check was not complete.
 o Other classes of errors (e.g. file system full) can also prevent
   a successful update yet do not prevent asynchronous event processing.
 o Configurations such as NanoBSD never have a read-write root,
   so ZFS event processing is permanently disabled in these systems.
 o Failure to handle asynchronous events promptly can extend the
   window of time that a pool is in a critical state.

At worst, a missed configuration cache update will force the operator to
perform a manual "zfs import" (note -f is not required) to inform the
system about a newly created pool.  To minimize the likelihood of this
rare occurrence, configuration cache write failures now emit FMA events
(via devctl) so the operator can take corrective action, and the write
is retried every 5 minutes.  The retry interval, in seconds, is tunable
via the sysctl "vfs.zfs.ccw_retry_interval".

As a side effect of reporting configuration cache events, other sysevents,
such as re-silver start/stop, are now also reported via devctl.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c:
o As is done in zfs_fm.c, provide a manual declaration for
  devctl_notify().  Both declarations could be combined
  into spa_impl.h, but the declaration is fault management
  related, not spa specific.  sys/fm/fs/zfs.h would be ideal
  if it weren't so public and reserved for FMA string
  definitions.  I'm open to suggestions on how to improve
  this nit while minimizing our divergence from Solaris.
o Use devctl_notify() to implement sysevent support in
  spa_event_notify().  The subsystem is EC_ZFS so that
  these events can never collide with those emitted in
  zfs_fm.c.
o Add the sysctl "vfs.zfs.ccw_retry_interval".  The value
  defaults to 5 minutes and is used to rate limit, on a
  per-pool basis, configuration cache file write attempts.
o Modify spa_async_dispatch to honor configuration cache
  write limiting.  If other events are pending, a configuration
  cache write will be attempted at the same time, so the
  rate limiting only applies when the asynchronous dispatch
  system is otherwise idle.  Async events should be rare
  (e.g. device arrival/departure) and configuration cache
  writes rarer, so a more complicated system to strictly
  honor the retry limit seems unwarranted.
o Remove check in spa_async_dispatch() for the root file
  system being read-write.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c:
Instead of silently ignoring configuration cache write
failures, report them via a new FMA event as well as
to the console.  The current zfs_ereport_post() doesn't
allow arbitrary name=value pairs to be appended to the
report, so the configuration cache file name is only
available on the console output.  This limitation should
be addressed in a future update.

Note: This error report is only posted once per incident,
to avoid spamming.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h:
Add a hrtime_t to the spa data structure to track the
time (via gethrtime()) of the last configuration cache file
write failure.  This is referenced in spa_async_dispatch()
to effect the rate limiting.

sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h:
  Add FM_EREPORT_ZFS_CONFIG_CACHE_WRITE as an ereport class.

Submitted by: gibbs
Reviewed by: Matthew Ahrens <mahrens@delphix.com>,
Eric Schrock <eric.schrock@delphix.com>,
Christopher Siden <christopher.siden@delphix.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/8@252763 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251635: illumos #3747 txg commit callbacks don't work
delphij [Fri, 5 Jul 2013 03:55:13 +0000 (03:55 +0000)]
MFC r251635: illumos #3747 txg commit callbacks don't work

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c:
Fix commit callbacks by moving them to the task's list.
Previously, list_move_tail() returned without doing anything because
the task list was passed as the source rather than destination.

cddl/contrib/opensolaris/cmd/ztest/ztest.c:
Check the commit callback threshold correctly.

Submitted by: will
Reviewed by: Matthew Ahrens <mahrens@delphix.com>,
Christopher Siden <christopher.siden@delphix.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/8@252761 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251634: illumos #3745 zpool create should treat -O mountpoint and -m the same
delphij [Fri, 5 Jul 2013 03:50:11 +0000 (03:50 +0000)]
MFC r251634: illumos #3745 zpool create should treat -O mountpoint and -m the same

cddl/contrib/opensolaris/cmd/zpool/zpool_main.c:  (change 644608)
This allows specifying a mountpoint using the latter form and having
its value checked and used as it would be using the former form.

As a consequence of this change:

1. The mountpoint property is set in the fsprops nvlist prior
   to creating the pool, rather than being set after creating
   the pool.  To me, this is the proper approach, since it
   avoids creating the pool if the mountpoint setting would
   cause the command to fail.
2. The mountpoint property, unlike all others, can be specified
   more than once.  Only the last setting takes effect.  This
   is to avoid breaking potential existing users that specify
   -m more than once.

Submitted by: will

cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
Fix "zpool create -R <whatever> -m <whatever>".  Ever since
change 644608, this has been broken.  The problem is that some
old code in libzfs_pool.c would force a pool's mountpoint to
"/" when creating a pool with an altroot.  That probably
implemented some old policy decision regarding altroots, but it
conflicts with the current manpage.  It also had no effect
until 644608, because the zpool command would _always_ change
the pool's mountpoint after creating it.  The solution is to
delete the old code from libzfs_pool.c.

Submitted by: asomers

Reviewed by: Matthew Ahrens <mahrens@delphix.com>,
Christopher Siden <christopher.siden@delphix.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/8@252759 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251633: illumos #3744 zfs shouldn't ignore errors unmounting
delphij [Fri, 5 Jul 2013 03:44:49 +0000 (03:44 +0000)]
MFC r251633: illumos #3744 zfs shouldn't ignore errors unmounting
snapshots

Propagate errors from zfs_unmount_snap() up to its callers wherever
feasible.

Submitted by: will
Reviewed by: Matthew Ahrens <mahrens@delphix.com>,
Christopher Siden <christopher.siden@delphix.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/8@252757 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251632: illumos #3743 zfs needs a refcount audit
delphij [Fri, 5 Jul 2013 03:38:53 +0000 (03:38 +0000)]
MFC r251632: illumos #3743 zfs needs a refcount audit

Audit zap cursor usage and correct missing calls to zap_cursor_fini().

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c:
Correct early exit handling of several functions that
previously failed to close a cursor prior to returning.

Submitted by: gibbs

Audit holders of dmu_bufs and correct missing calls to dmu_buf_rele().

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c:
Correct early exit handling of several functions that
previously failed to release a dmu_buf prior to returning.

Submitted by: will

Reviewed by: Matthew Ahrens <mahrens@delphix.com>,
Eric Schrock <eric.schrock@delphix.com>,
George Wilson <george.wilson@delphix.com>,
Christopher Siden <christopher.siden@delphix.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/8@252755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251631: illumos #3742 zfs comments need cleaner, more consistent style
delphij [Fri, 5 Jul 2013 03:06:36 +0000 (03:06 +0000)]
MFC r251631: illumos #3742 zfs comments need cleaner, more consistent style

- Make more of ZFS's comments use a natural English writing flow.
- Break up long paragraphs, fix various typos and spelling errors.
- Don't prefix a function description with its name when the function
  definition immediately follows.
- Remove useless comments.
- Add extra whitespace where it makes the comments more readable.

New comments were separated from this change and added in r251629.

Submitted by: asomers, gibbs, will
Reviewed by: Matthew Ahrens <mahrens@delphix.com>,
George Wilson <george.wilson@delphix.com>,
Eric Schrock <eric.schrock@delphix.com>,
Christopher Siden <christopher.siden@delphix.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/8@252752 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251629: 3741 zfs needs better comments
delphij [Fri, 5 Jul 2013 03:02:19 +0000 (03:02 +0000)]
MFC r251629: 3741 zfs needs better comments

Embellish the comments in various components of ZFS.  Move some comments
around closer to what they describe.  Specifically, answer the questions:

- What are some of the edge cases of the dbuf state machine?
- What does a txg quiesce do?
- When does the DMU notify threads waiting on txg's that they may
  proceed?
- How do the calculations for RAIDZ map allocations work?
- What process do the RAIDZ I/O start and done callbacks follow?

While here, adjust the function prototype of dmu_zfetch.c:dmu_zfetch_colinear()
to match its comment which describes its return as a boolean.

Submitted by: asomers, gibbs, will
Reviewed by: Matthew Ahrens <mahrens@delphix.com>,
Eric Schrock <eric.schrock@delphix.com>,
Christopher Siden <christopher.siden@delphix.com>
Sponsored by: Spectra Logic

git-svn-id: svn://svn.freebsd.org/base/stable/8@252750 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252387:
dim [Thu, 4 Jul 2013 22:09:14 +0000 (22:09 +0000)]
MFC r252387:

Make libsupc++'s __cxa_call_terminate() prototype consistent with the
definition.

Submitted by: dt71@gmx.com

git-svn-id: svn://svn.freebsd.org/base/stable/8@252731 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252262:
jimharris [Wed, 3 Jul 2013 23:28:07 +0000 (23:28 +0000)]
MFC r252262:

  For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA
  by treating it as UDMA.

  This fixes a problem introduced in r249933/r249939, where CAM sends
  ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16.  scsi_ata_trim()
  sets protocol as DMA (not UDMA) which is for multi-word DMA, even
  though no such mode is selected for the device.  isci(4) would fail
  these commands which is the correct behavior but not consistent with
  other HBAs, namely LSI's.

  smh@ did some further testing on an LSI controller, which rejected
  ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only
  a UDMA mode was selected on the device.  So this precludes adding
  any kind of mode detection in CAM to determine which mode to use on
  a per-device basis.

Sponsored by: Intel

git-svn-id: svn://svn.freebsd.org/base/stable/8@252650 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r242726 (ambrisko):
markj [Wed, 3 Jul 2013 23:16:33 +0000 (23:16 +0000)]
MFC r242726 (ambrisko):
Add support for SCSI pass through devices to be attached and detached.

MFC r251172 (sbruno):
xpt_create_path() requires mfi_io_lock to be held, so do it.

mfi(4) doesn't panic on host startup now.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252644 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMF9: r252635, r252638:
obrien [Wed, 3 Jul 2013 22:59:46 +0000 (22:59 +0000)]
MF9: r252635, r252638:
     MFC: r252348, r252363: sysconf(3) returns a long, not an int.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252639 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252600: Fix grammar in a comment.
dteske [Wed, 3 Jul 2013 20:55:49 +0000 (20:55 +0000)]
MFC r252600: Fix grammar in a comment.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252601 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252471:
smh [Wed, 3 Jul 2013 08:35:14 +0000 (08:35 +0000)]
MFC r252471:
Remove forced timeout of in-flight commands from mfi_timeout.

While this prevents commands getting stuck forever there is no way to guarantee
that data from the command hasn't been committed to the device.

In addition older mfi firmware has a bug that would cause the controller to
frequently stall IO for over our timeout value, which when combined with
a forced timeout often resulted in panics in UFS; which would otherwise be
avoided when the command eventually completed if left alone.

For reference this timeout issue is resolved in Dell FW package 21.2.1-0000.
Fixed FW package version for none Dell controller will likely vary.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252553 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252052:
lstewart [Wed, 3 Jul 2013 08:21:05 +0000 (08:21 +0000)]
MFC r252052:

Non-virtualised hhook points are supported as of r251732.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252552 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251789:
lstewart [Wed, 3 Jul 2013 07:58:14 +0000 (07:58 +0000)]
MFC r251789:

Now that the necessary infrastructure is in place to ensure hhook points which
register after a khelp module will get hooked, move khelp module initialisation
to the earlier SI_SUB_KLD stage.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252550 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251787:
lstewart [Wed, 3 Jul 2013 06:23:46 +0000 (06:23 +0000)]
MFC r251787:

Move hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to
ensure all per-vnet related hhook initialisation is completed prior to any
virtualised hhook points attempting registration.

vnet_register_sysinit() requires that a stage later than SI_SUB_VNET be chosen.
There are no per-vnet initialisors in the source tree at this time which run
earlier than SI_SUB_INIT_IF. A quick audit of non-virtualised SYSINITs indicates
there are no subsystems pre SI_SUB_MBUF that would likely be interested in
registering a virtualised hhook point.

Settle on SI_SUB_MBUF as hhook's per-vnet initialisation stage as it's the first
overtly network-related initilisation stage to run after SI_SUB_VNET. If a
subsystem that initialises earlier than SI_SUB_MBUF ends up wanting to register
virtualised hhook points in future, hhook's use of SI_SUB_MBUF will need to be
revisited and would probably warrant creating a dedicated SI_SUB_HHOOK which
runs immediately after SI_SUB_VNET.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252544 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251778:
lstewart [Wed, 3 Jul 2013 05:59:48 +0000 (05:59 +0000)]
MFC r251778:

Cleanup and simplification in khelp_{register|deregister}_helper(). No
functional changes.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252542 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251774:
lstewart [Wed, 3 Jul 2013 05:47:28 +0000 (05:47 +0000)]
MFC r251774:

Add a private KPI between hhook and khelp that allows khelp modules to insert
hook functions into hhook points which register after the modules were loaded -
potentially useful during boot or if hhook points are dynamically registered.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252538 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251770:
lstewart [Wed, 3 Jul 2013 05:29:21 +0000 (05:29 +0000)]
MFC r251770:

Internalise handling of virtualised hook points inside
hhook_{add|remove}_hook_lookup() so that khelp (and other potential API
consumers) do not have to care when they attempt to (un)hook a particular hook
point identified by id and type.

Reviewed by: scottl

git-svn-id: svn://svn.freebsd.org/base/stable/8@252537 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251732,251752:
lstewart [Wed, 3 Jul 2013 04:21:29 +0000 (04:21 +0000)]
MFC r251732,251752:

Add support for non-virtualised hhook points, which are uniquely identified by
type and id, as compared to virtualised hook points which are now uniquely
identified by type, id and a vid (which for vimage is the pointer to the vnet
that the hhook resides in).

All hhook_head structs for both virtualised and non-virtualised hook points
coexist in hhook_head_list, and a separate list is maintained for hhook points
within each vnet to simplify some vimage-related housekeeping.

Reviewed by: scottl

git-svn-id: svn://svn.freebsd.org/base/stable/8@252535 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoWhen a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an
lstewart [Wed, 3 Jul 2013 03:40:06 +0000 (03:40 +0000)]
When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an
mbuf that was fully consumed by the previous call, the mbuf ptr returned by the
current call ends up being the previous mbuf in the sb chain to the one that
contains the data we want.

This does not cause any observable issues because the mbuf copy routines happily
walk the mbuf chain to get to the data at the moff offset, which in this case
means they effectively skip over the mbuf returned by sbsndptr().

We can't adjust sb->sb_sndptr during the previous call for this case because the
next mbuf in the chain may not exist yet. We therefore need to detect the
condition and make the adjustment during the current call.

Fix by detecting the special case of moff being at the start of the next mbuf in
the chain and adjust the required accounting variables accordingly.

Reviewed by: andre

git-svn-id: svn://svn.freebsd.org/base/stable/8@252533 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252380:
mm [Tue, 2 Jul 2013 19:45:14 +0000 (19:45 +0000)]
MFC r252380:
Unbreak "zfs jail" and "zfs unjail" (broken in stable/8 since r251757)

I missed to register zfs_ioc_jail and zfs_ioc_unjail as legacy ioctl's
with the new zfs_ioctl_register_legacy() function.

These operations do not modify pools or datasets so there is no need to
log them to pool history.

Reported by: Alexander Leidinger <netchild@FreeBSD.org> on current@

git-svn-id: svn://svn.freebsd.org/base/stable/8@252525 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248286 (pjd):
trociny [Tue, 2 Jul 2013 19:29:45 +0000 (19:29 +0000)]
MFC r248286 (pjd):

Removed redundant includes.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252520 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248294, r248296:
trociny [Tue, 2 Jul 2013 19:28:16 +0000 (19:28 +0000)]
MFC r248294, r248296:

r248294 (pjd):

Delete requests can be larger than MAXPHYS.

r248296 (pjd):

Minor corrections.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252518 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251859:
delphij [Mon, 1 Jul 2013 22:07:01 +0000 (22:07 +0000)]
MFC r251859:

Return ENETDOWN instead of ENOENT when all lagg(4) links are
inactive when upper layer tries to transmit packet.  This
gives better feedback and meaningful errors for applications.

Reviewed by: thompsa

git-svn-id: svn://svn.freebsd.org/base/stable/8@252490 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251825,252486:
delphij [Mon, 1 Jul 2013 22:02:39 +0000 (22:02 +0000)]
MFC r251825,252486:

Remove vfs_mount(9), it have been died since 2004.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252488 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252062:
delphij [Mon, 1 Jul 2013 20:46:35 +0000 (20:46 +0000)]
MFC r252062:

Call sshd_precmd instead of sshd_configtest when the operator
requests reload or restart, which, in addition of testing the
configuration, will also generate host keys when they are not
present (previous behavior).

Obtained from: FreeNAS
Ok'ed by: bdrewery, des

git-svn-id: svn://svn.freebsd.org/base/stable/8@252478 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252392:
smh [Mon, 1 Jul 2013 08:27:15 +0000 (08:27 +0000)]
MFC r252392:
style(9) fixes

git-svn-id: svn://svn.freebsd.org/base/stable/8@252462 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252390:
smh [Mon, 1 Jul 2013 08:25:50 +0000 (08:25 +0000)]
MFC r252390:
Remove invalid ASSERT

git-svn-id: svn://svn.freebsd.org/base/stable/8@252461 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251482,251733:
yongari [Mon, 1 Jul 2013 07:03:38 +0000 (07:03 +0000)]
MFC r251482,251733:
r251482:
  Correct setting TX random backoff register. This register is
  implemented as a 10 bits linear feedback shift register so only
  lower 10 bits are valid.
  Because this register is used to initialize random backoff interval
  register only when resolved duplex is half-duplex, it wouldn't have
  caused issues in these days.

r251733:
  Fix a typo introduced in r213280. IFM_OPTIONS macro should see
  current media word.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252456 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251481:
yongari [Mon, 1 Jul 2013 06:58:35 +0000 (06:58 +0000)]
MFC r251481:
  Do not report current link status if driver is not running.
  Reporting link status in driver has a side-effect that makes mii(4)
  check current link status.  mii(4) will call link status change
  callback when it sees link state change.  Normally this wouldn't
  have problems. However, ASF/IPMI firmware can actively access PHY
  regardless of driver's running state such that reporting link
  status for not-running interface can generate meaningless link
  UP/DOWN messages.

  This change also makes dhclient think driver got a valid link
  regardless of link establishment so it will bypass dhclient's
  initial link status check. I think that wouldn't be issue
  though.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252453 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252186:
yongari [Mon, 1 Jul 2013 05:33:55 +0000 (05:33 +0000)]
MFC r252186:
  Add Lenovo USB 2.0 Ethernet adapter to the list of supported
  devices.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252448 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252185:
yongari [Mon, 1 Jul 2013 05:30:38 +0000 (05:30 +0000)]
MFC r252185:
  Add Lenovo USB 2.0 Ethernet adapter.

  PR: usb/179920

git-svn-id: svn://svn.freebsd.org/base/stable/8@252445 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252143:
yongari [Mon, 1 Jul 2013 05:26:29 +0000 (05:26 +0000)]
MFC r252143:
  When RX checksum offloading is active, AX88772B will prepend a
  checksum header.  The header contains a received frame length but
  the defined length for AX88772B is different with other ASIX
  controllers.  When the RX checksum is off, AX88772B controller does
  not prepend a checksum header so driver has to use normal header
  length mask.
  This change should fix RX errors when RX checksum offloading is
  off.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252443 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251887:
lstewart [Sat, 29 Jun 2013 04:27:04 +0000 (04:27 +0000)]
MFC r251887:

Add new FOREACH_FROM variants of the queue(3) FOREACH macros which can
optionally start the traversal from a previously found element by passing the
element in as "var". Passing a NULL "var" retains the same semantics as the
regular FOREACH macros.

Reviewed by: jhb (previous version), rpaulo

git-svn-id: svn://svn.freebsd.org/base/stable/8@252366 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFH (r251088, r252338): revert default privsep setting to "yes"
des [Fri, 28 Jun 2013 10:21:49 +0000 (10:21 +0000)]
MFH (r251088, r252338): revert default privsep setting to "yes"

git-svn-id: svn://svn.freebsd.org/base/stable/8@252340 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251725:
lstewart [Fri, 28 Jun 2013 03:41:23 +0000 (03:41 +0000)]
MFC r251725:

Fix a potential NULL-pointer dereference that would trigger if the hhook
registration site did not provide storage for a copy of the hhook_head struct.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252329 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251682:
lstewart [Fri, 28 Jun 2013 03:23:24 +0000 (03:23 +0000)]
MFC r251682:

Remove some duplicate code by making KHELP_DECLARE_MOD() a wrapper around
KHELP_DECLARE_MOD_UMA().

git-svn-id: svn://svn.freebsd.org/base/stable/8@252327 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250951,251838:
lstewart [Fri, 28 Jun 2013 03:04:07 +0000 (03:04 +0000)]
MFC r250951,251838:

Ensure alq's shutdown_pre_sync event handler is deregistered on module unload to
avoid a dangling pointer and eventual panic on system shutdown.

Reported by: Ali <comnetboy at gmail.com>

git-svn-id: svn://svn.freebsd.org/base/stable/8@252324 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 233662,233677-233678,250418,252166:
jhb [Thu, 27 Jun 2013 21:02:26 +0000 (21:02 +0000)]
MFC 233662,233677-233678,250418,252166:
If the firmware/BIOS assigns conflicting ranges to BARs then leaving the
BARs alone could result in one device stealing mmio accesses intended to go
to a second device.  Previously the PCI bus driver attempted to handle this
case by clearing the BAR to 0 depending on BARs based at 0 not decoding (which
is not guaranteed to be true).  Now when a conflicting BAR is detected the
following steps are taken:

 1) If hw.pci.realloc_bars (a new tunable) is enabled (default is disabled),
    then ignore the current BAR setting from the firmware and attempt to
    allocate a fresh resource range for the BAR.

 2) If 1) failed (or was disabled), disable decoding for the relevant
    BAR type (e.g. disable mem decoding for a memory BAR) and emit a
    warning if booting verbose.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252318 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252056:
smh [Thu, 27 Jun 2013 14:32:51 +0000 (14:32 +0000)]
MFC r252056:
Fix destroyed ZFS pools failing to import

MFC r252059:
Fix ZFS zpool freeze (debug command) not processing due to invalid ioctl call syntax.

MFC r252060:
Fix intermittent ZFS lock panic

MFC r252061:
Switch ZFS mutex_owner macro to use sx_xholder as its now exported via sx.h

git-svn-id: svn://svn.freebsd.org/base/stable/8@252306 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252045:
smh [Thu, 27 Jun 2013 10:58:31 +0000 (10:58 +0000)]
MFC r252045:
Corrected ATA Passthrough defines from decimal to hex

git-svn-id: svn://svn.freebsd.org/base/stable/8@252304 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250613:
jimharris [Thu, 27 Jun 2013 00:51:47 +0000 (00:51 +0000)]
MFC r250613:

Fix typo in net.inet.tcp.minmss sysctl description.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252286 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251560
bapt [Tue, 25 Jun 2013 21:50:05 +0000 (21:50 +0000)]
MFC r251560

Fix a bad calloc(3) call

git-svn-id: svn://svn.freebsd.org/base/stable/8@252217 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250377:
eadler [Tue, 25 Jun 2013 20:03:06 +0000 (20:03 +0000)]
MFC r250377:
Allow the use of lowercase 'yes'

PR: bin/178422

git-svn-id: svn://svn.freebsd.org/base/stable/8@252211 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251945:
mav [Tue, 25 Jun 2013 07:11:07 +0000 (07:11 +0000)]
MFC r251945:
Pass proper memory type to free() in ata_ali_chipinit().

git-svn-id: svn://svn.freebsd.org/base/stable/8@252198 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251769
bryanv [Tue, 25 Jun 2013 04:44:42 +0000 (04:44 +0000)]
MFC r251769

  Fix setting of the Rx filters

  QEMU 1.4 made the descriptor requirement stricter - the size of buffer
  descriptor must exactly match the number of MAC addresses provided.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252194 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 251323:
jhb [Mon, 24 Jun 2013 19:28:36 +0000 (19:28 +0000)]
MFC 251323:
- Handle the recursed/not recursed flags with RA_RLOCKED in rw_assert().
- Tweak a panic message.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252173 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 252037: Document RA_RECURSED and RA_NOTRECURSED.
jhb [Mon, 24 Jun 2013 18:41:28 +0000 (18:41 +0000)]
MFC 252037: Document RA_RECURSED and RA_NOTRECURSED.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252169 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 251470:
jhb [Mon, 24 Jun 2013 18:37:52 +0000 (18:37 +0000)]
MFC 251470:
Do not compare the existing mask of a cpuset with a new mask when changing
the mask of a cpuset.  Also, change the cpuset's mask before updating the
masks of all children.  Previously changing a cpuset's mask first required
setting the mask to a super-set of both the old and new masks and then
changing it a second time to the new mask.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252167 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 250223:
jhb [Mon, 24 Jun 2013 17:09:28 +0000 (17:09 +0000)]
MFC 250223:
Similar to 233760 and 236717, export some more useful info about the
kernel-based POSIX semaphore descriptors to userland via procstat(1) and
fstat(1):
- Change sem file descriptors to track the pathname they are associated
  with and add a ksem_info() method to copy the path out to a
  caller-supplied buffer.
- Use ksem_info() to export the path of a semaphore via struct kinfo_file.
- Teach fstat about semaphores and to display their path, mode, and value.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252164 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoAdded ZFS TRIM support which is enabled by default. To disable
smh [Mon, 24 Jun 2013 15:35:42 +0000 (15:35 +0000)]
Added ZFS TRIM support which is enabled by default. To disable
ZFS TRIM support set vfs.zfs.trim.enabled=0 in loader.conf.

Creating new ZFS pools and adding new devices to existing pools
first performs a full device level TRIM which can take a significant
amount of time. The sysctl vfs.zfs.vdev.trim_on_init can be set to 0
to disable this behaviour.

ZFS TRIM requires the underlying device support BIO_DELETE which
is currently provided by methods such as ATA TRIM and SCSI UNMAP
via CAM, which are typically supported by SSD's.

Stats for ZFS TRIM can be monitored by looking at the sysctl's
under kstat.zfs.misc.zio_trim.

MFC r240868: Add TRIM support
MFC r244155: Renamed zfs trim stats
MFC r244187: Upgrade TRIM free request sizes optimisation
MFC r244188: Added vfs.zfs.vdev.trim_on_init sysctl
MFC r248572: Add TRIM support for L2ARC
MFC r248573: Don't register repair writes in the trim map.
MFC r248574: Improve TXG handling in the TRIM module
MFC r248575: TRIM cache devices based on time instead of TXGs
MFC r248576: Names the ZFS TRIM thread
MFC r248577: Optimisation of TRIM processing
MFC r248602: Fix for building libzpool under i386
MFC r249921: Enabled ZFS TRIM by default

git-svn-id: svn://svn.freebsd.org/base/stable/8@252162 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251872:
markj [Mon, 24 Jun 2013 01:05:51 +0000 (01:05 +0000)]
MFC r251872:
Be sure to actually decrement the "count" parameter for each processed
descriptor so that we return when the threshold has been reached.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252136 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r252042:
eadler [Sun, 23 Jun 2013 20:19:05 +0000 (20:19 +0000)]
MFC r252042:
Ports switched from dialog to dialog4ports some time ago.

PR: docs/179785

git-svn-id: svn://svn.freebsd.org/base/stable/8@252122 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoSince we likely will not have an 8.5-RELEASE, reword the errata page
gjb [Sun, 23 Jun 2013 20:09:58 +0000 (20:09 +0000)]
Since we likely will not have an 8.5-RELEASE, reword the errata page
for the 8.4-RELEASE.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252120 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFS9->8 r252025:
dteske [Sun, 23 Jun 2013 10:16:14 +0000 (10:16 +0000)]
MFS9->8 r252025:
Fix a copy/paste error introduced by r248452 (s/ftp/http/ in menu text).
This is a direct commit to stable/8.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252111 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFi386: revision 251332
nyan [Sun, 23 Jun 2013 09:34:55 +0000 (09:34 +0000)]
MFi386: revision 251332

  Use slightly more idiomatic expression to get the address of array.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252108 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFi386: revision 245847
nyan [Sun, 23 Jun 2013 09:23:32 +0000 (09:23 +0000)]
MFi386: revision 245847

  Add special loader environment variables 'comconsole_port' and
  'comconsole_pcidev'.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252107 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250599:
markj [Sat, 22 Jun 2013 05:32:45 +0000 (05:32 +0000)]
MFC r250599:
Add a remark to the effect that a manually started relearn will always
result in the battery being completely drained, even in transparent learning
mode.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252094 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r246951:
markj [Sat, 22 Jun 2013 05:25:12 +0000 (05:25 +0000)]
MFC r246951:
Mark the coretemp(4) sysctls as MPSAFE, ensuring that Giant won't be held
unnecessarily by a user thread waiting to run on a specific CPU after
calling sched_bind().

git-svn-id: svn://svn.freebsd.org/base/stable/8@252092 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251166:
markj [Sat, 22 Jun 2013 04:52:12 +0000 (04:52 +0000)]
MFC r251166:
Add macros which allow one to define SDT probes with six or seven arguments;
they are needed when porting some of the Solaris providers (ip, iscsi, and
tcp in particular).

dtrace_probe() only takes five arguments from the probe site, so we need to
add the appropriate cast to allow for more than five arguments. The extra
arguments are later copied out of dtrace_probe()'s stack frame by
dtrace_getarg() (or the provider-specific getarg method) as needed.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252090 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251723:
markj [Sat, 22 Jun 2013 04:04:34 +0000 (04:04 +0000)]
MFC r251723:
The functions are called pci_{msi,msix}_count(), not pci_count_{msi,msix}().

git-svn-id: svn://svn.freebsd.org/base/stable/8@252088 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoshare/mk: merge: r241298,243393,249057,251506 from head for bmake support.
sjg [Fri, 21 Jun 2013 22:45:03 +0000 (22:45 +0000)]
share/mk: merge: r241298,243393,249057,251506 from head for bmake support.
  merge: r252048 from stable/9

Makefile: merge: r252048 from stable/9 for bmake support.

Reviewed by: obrien

git-svn-id: svn://svn.freebsd.org/base/stable/8@252073 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFS9->8 r249822:
dteske [Fri, 21 Jun 2013 21:59:58 +0000 (21:59 +0000)]
MFS9->8 r249822:
Update error messages when processing the INDEX file to display the given
path rather than a static string. This makes the error messages consistent
with the rest of the functions which already do the same thing (assumed to
be an oversight of r47055, 13+ years ago). A direct commit to stable/9.

This is a direct commit to stable/8.

Reviewed by: eadler

git-svn-id: svn://svn.freebsd.org/base/stable/8@252071 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 251637:
jhb [Fri, 21 Jun 2013 19:30:32 +0000 (19:30 +0000)]
MFC 251637:
Borrow the algorithm from kvm_getprocs() to fix procstat(1) to handle the
case where the process tables grows in between the calls to fetch the size
and fetch the table.

Note that this is not a true MFC as the libprocstat library doesn't exist
in 8.x and the relevant code is in the procstat binary instead.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252066 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 250333: Don't pad disk partition sizes with leading zeros.
jhb [Fri, 21 Jun 2013 15:30:18 +0000 (15:30 +0000)]
MFC 250333: Don't pad disk partition sizes with leading zeros.

git-svn-id: svn://svn.freebsd.org/base/stable/8@252058 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r249406
gahr [Thu, 20 Jun 2013 16:50:05 +0000 (16:50 +0000)]
MFC: r249406

- Do not bail out if stat(2) fails with ENOENT in the spool directory. This
  happens if another atrm process removes a job while we're scanning through
  the directory.
- While at it, optimize a bit the directory scanning, so that we quit
  looping as soon as all jobs specified in argv have been dealt with.

Approved by: cognet

git-svn-id: svn://svn.freebsd.org/base/stable/8@252034 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251485:
jh [Wed, 19 Jun 2013 18:01:37 +0000 (18:01 +0000)]
MFC r251485:

Revert r238399.

The "failok" option doesn't have any effect at all unless specified in
fstab(5) and combined with the -a flag. The "failok" option is already
documented in fstab(5).

PR: 177630

git-svn-id: svn://svn.freebsd.org/base/stable/8@251999 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251616:
mav [Tue, 18 Jun 2013 09:48:56 +0000 (09:48 +0000)]
MFC r251616:
Don't update provider properties and don't set DISKFLAG_OPEN if d_open()
disk method call returned error.  GEOM considers devices in such case as
still closed, and won't call symmetric d_close() for them.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251932 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r248720:
mav [Tue, 18 Jun 2013 09:36:01 +0000 (09:36 +0000)]
MFC r248720:
Remove extra bio_data and bio_length copying to child request after calling
g_clone_bio(), that already copied them.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251923 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251349:
delphij [Tue, 18 Jun 2013 04:06:12 +0000 (04:06 +0000)]
MFC r251349:

Fix a typo: XPORT_SPI should be tested against transport, nor protocol.

Submitted by: Sascha Wildner <swildner dragonflybsd org>
Reviewed by: mjacob

git-svn-id: svn://svn.freebsd.org/base/stable/8@251892 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251187:
delphij [Tue, 18 Jun 2013 04:04:15 +0000 (04:04 +0000)]
MFC r251187:

Explicitly use a pair of parentheses to ensure correct evaluation
ordering for bitwise operation.

Submitted by: swildner (DragonFly)

git-svn-id: svn://svn.freebsd.org/base/stable/8@251890 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r249252:
ae [Mon, 17 Jun 2013 20:18:12 +0000 (20:18 +0000)]
MFC r249252:
  Remove reference to the nonexistent sysctl node net.inet6.mld.stats.
  Also add cross reference to the icmp6(4).

  PR: 177696

git-svn-id: svn://svn.freebsd.org/base/stable/8@251865 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251659:
mav [Mon, 17 Jun 2013 15:01:40 +0000 (15:01 +0000)]
MFC r251659:
Use CAM_DIR_NONE for requests without data.
Wrong values there confuse some drivers.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251853 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251661:
mav [Mon, 17 Jun 2013 14:56:49 +0000 (14:56 +0000)]
MFC r251661:
Replicate r242422 from ata(4) to mvs(4):
Only four specific ATA PIO commands transfer several sectors per DRQ block
(interrupt).  All other ATA PIO commands transfer one sector or 512 bytes
at one time.  Hardcode these exceptions in mvs(4).
This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`.
Also it fixes timeout of DOWNLOAD_MICROCODE on `camcontrol fwdownload`.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251851 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251600:
yongari [Mon, 17 Jun 2013 04:42:02 +0000 (04:42 +0000)]
MFC r251600:
  Avoid unnecessary controller reinitialization by checking driver
  running state.  fxp(4) requires controller reinitialization for the
  following cases.
   o RX lockup condition on i82557
   o promiscuous mode change
   o multicast filter change
   o WOL configuration
   o TSO/VLAN hardware tagging/checksum offloading configuration
   o MAC reprogramming after speed/duplex/flow-control resolution
   o Any events that result in MAC reprogramming(link UP/DOWN,
     remote link partner's restart of auto-negotiation etc)
   o Microcode loading/unloading
  Apart from above cases which come from hardware limitation, upper
  stack also blindly reinitializes controller whenever an IP address
  is assigned. After r194573, fxp(4) no longer needs to reinitialize
  the controller to program multicast filter after upping the
  interface. So keeping track of driver running state should remove
  all unnecessary controller reinitializations.

  This change will also address endless controller reinitialization
  triggered by dhclient(8).

git-svn-id: svn://svn.freebsd.org/base/stable/8@251830 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251490:
trociny [Sat, 15 Jun 2013 08:07:47 +0000 (08:07 +0000)]
MFC r251490:

Properly set curvnet context in lagg_port_setlladdr() task handler.

Reported by: Nikos Vassiliadis <nvass gmx.com>
Submitted by: zec
Tested by: Nikos Vassiliadis <nvass gmx.com>

git-svn-id: svn://svn.freebsd.org/base/stable/8@251780 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r249623
rmacklem [Sat, 15 Jun 2013 01:35:52 +0000 (01:35 +0000)]
MFC: r249623
Both NFS clients can deadlock when using the "rdirplus" mount
option. This can occur when an nfsiod thread that already holds
a buffer lock attempts to acquire a vnode lock on an entry in
the directory (a LOR) when another thread holding the vnode lock
is waiting on an nfsiod thread. This patch avoids the deadlock by disabling
readahead for this case, so the nfsiod threads never do readdirplus.
Since readaheads for directories need the directory offset cookie
from the previous read, they cannot normally happen in parallel.
As such, testing by jhb@ and myself didn't find any performance
degredation when this patch is applied. If there is a case where
this results in a significant performance degradation, mounting
without the "rdirplus" option can be done to re-enable readahead
for directories.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251768 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 250220:
jhb [Fri, 14 Jun 2013 22:06:45 +0000 (22:06 +0000)]
MFC 250220:
Fix FIONREAD on regular files.  The computed result was being ignored and
it was being passed down to VOP_IOCTL() where it promptly resulted in
ENOTTY due to a missing else for the past 8 years.  While here, use a
shared vnode lock while fetching the current file's size.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251764 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 250053:
jhb [Fri, 14 Jun 2013 20:44:23 +0000 (20:44 +0000)]
MFC 250053:
Only cleanup CMI-related state on detach if the system supports CMI.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251760 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 246619,247187,247265,247348,247398,247540,247585,248265,248267,248571,
mm [Fri, 14 Jun 2013 19:26:32 +0000 (19:26 +0000)]
MFC 246619,247187,247265,247348,247398,247540,247585,248265,248267,248571,
    248976,249004,249042,249047,249188,249195,249196,249206,249207,249319,
    249326,249356,249357,249787,249883,249858

Merge libzfs_core, zfs deadman thread and other ZFS bugfixes and improvements.

MFC r246619:
  Correct spelling of "daemon".  No .Dd bump.
  Noticed by: Nathan Rich <Nathan.Rich dynastysystems com>

MFC r247187:
  Import vendor change to avoid "unitialized variable" warnings.

  Illumos ZFS issues:
  3522 zfs module should not allow uninitialized variables

MFC r247265:
  Merge the ZFS I/O deadman thread from vendor (illumos).
  This feature panics the system on hanging ZFS I/O, helps debugging
  and resumes failed service.

  The panic behavior can be controlled with the loader-only tunables:
  vfs.zfs.deadman_enabled (enable or disable panic on stalled ZFS I/O)
  vfs.zfs.deadman_synctime (expiration time for stalled ZFS I/O)

  By default, ZFS I/O deadman is enabled by default on amd64 and i386
  excluding virtual guest machines.

MFC r247348:
  Be more verbose on ZFS deadman I/O panic
  Patch suggested upstream.

MFC r247398:
  Import metaslab_sync() speedup from vendor (illumos).

  Illumos ZFS issues:
  3552 condensing one space map burns 3 seconds of CPU in spa_sync() thread
  3564 spa_sync() spends 5-10% of its time in metaslab_sync() (when not
condensing)
  3578 transferring the freed map to the defer map should be constant time
  3579 ztest trips assertion in metaslab_weight()

MFC r247540:
  Fix the zfs_ioctl compat layer to support zfs_cmd size change introduced
  in r247265 (ZFS deadman thread). Both new utilities now support the old
  kernel and new kernel properly detects old utilities.

  For future backwards compatibility, the vfs.zfs.version.ioctl read-only
  sysctl has been introduced. With this sysctl zfs utilities will be able
  to detect the ioctl interface version of the currently loaded zfs module.

MFC r247585:
  Merge new read-only zfs properties from vendor (illumos)

  Illumos ZFS issues:
  3588 provide zfs properties for logical (uncompressed) space used and
       referenced

MFC r248265:
  Update zfs.8 manpage date (missing in r247585)

MFC r248267:
  Import minor ZFS changes from vendor

  Illumos ZFS issues:
  3604 zdb should print bpobjs more verbosely (fix zdb hang)
  3606 zpool status -x shouldn't warn about old on-disk format

MFC r248571:
  MFV 238590, 238592:
  In the first zfs ioctl restructuring phase, the libzfs_core library was
  introduced. It is a new thin library that wraps around kernel ioctl's.
  The idea is to provide a forward-compatible way of dealing with new
  features. Arguments are passed in nvlists and not random zfs_cmd fields,
  new-style ioctls are logged to pool history using a new method of
  history logging.

  http://blog.delphix.com/matt/2012/01/17/the-future-of-libzfs/

  MFV 247580 [1]:
  To address issues of several deadlocks and race conditions the locking
  code around dsl_dataset was rewritten and the interface to synctasks
  was changed.

  User-Visible Changes:
  "zfs snapshot" can create more arbitrary snapshots at once (atomically)
  "zfs destroy" destroys multiple snapshots at once
  "zfs recv" has improved performance

  Backward Compatibility:
  I have extended the compatibility layer to support full backward
  compatibility by remapping or rewriting the responsible ioctl arguments.
  Old utilities are fully supported by the new kernel module.

  Forward Compatibility:
  New utilities work with old kernels with the following restrictions:
    - creating, destroying, holding and releasing of multiple snapshots
      at once is not supported, this includes recursive (-r) commands

  Illumos ZFS issues:
    2882 implement libzfs_core
    2900 "zfs snapshot" should be able to create multiple,
         arbitrary snapshots at once
    3464 zfs synctask code needs restructuring

MFC r248976:
  Call dmu_snapshot_list_next() in zvol.c with dsl_pool_config lock held

MFC r249004:
  Do not check against uninitialized rc and comment out vendor code

MFC r249042:
  Fix possible pool hold leak in dmu_send_impl()

  Illumos ZFS issues:
    3645 dmu_send_impl: possibilty of pool hold leak

MFC r249047 (avg):
  spa_open_common: fix argument to zvol_create_minors

  Prior to r248571 spa_open was always called with a bare pool name,
  but now it is called with a dataset name instead (spa_lookup handles
  that).
  So, when a ZFS root is mounted spa_open is called with a name of a root
  dataset, which can very well be different from the pool name.
  But zvol_create_minors should be called with the pool name, because it
  performs a recursive traversal of all datasets under the name to find
  all those that are volumes.

MFC r249188:
  Import vendor change to reduce diff, no effect on FreeBSD.

  Illumos ZFS issues:
    3517 importing pool with autoreplace=on and "hole" vdevs crashes
 syseventd

MFC r249195:
  Merge change from vendor to reduce diff only.
  ZFS dtrace probes are not supported on FreeBSD yet.

  Illumos ZFS issues:
    3598 want to dtrace when errors are generated in zfs

MFC r249196:
  Provide a fix for kernel panic if receiving recursive deduplicated
  streams. Problem reported to vendor.

  Illumos ZFS issues:
    3692 Panic on zfs receive of a recursive deduplicated stream

MFC r249206:
  Merge vendor change - modify time processing in deadman thread.

  Illumos ZFS issues:
    3618 ::zio dcmd does not show timestamp data

MFC r249207:
  Allow zdb to output a histogram of compressed block sizes.

  Illumos ZFS issues:
    3641 want a histogram of compressed block sizes

MFC r249319:
  ZFS expects a copyout of zfs_cmd_t on an ioctl error. Our sys_ioctl()
  doesn't copyout in this case.

  To solve this a new struct zfs_iocparm_t is introduced consisting of:
  - zfs_ioctl_version (future backwards compatibility purposes)
  - user space pointer to zfs_cmd_t (copyin and copyout)
  - size of zfs_cmd_t (verification purposes)

  The copyin and copyout of zfs_cmd_t is now done the illumos (vendor) way
  what makes porting of new changes easier and ensures correct behavior if
  returning an error.

MFC r249326:
  Cast (void *)(uintptr_t) on copyout and copyin of zfs_iocparm_t.zfs_cmd

MFC r249356:
  Merge bugfixes accepted and integrated by vendor. Underlying problems
  have been reported by us and fixed in r240942 and r249196.

  Illumos ZFS issues:
    3645 dmu_send_impl: possibilty of pool hold leak
    3692 Panic on zfs receive of a recursive deduplicated stream

MFC r249357:
  Fix libzfs to report error instead of returning zero if trying to hold or
  release a non-existing snapshot of a existing dataset. In recursive case
  error is reported if no snapshots with the requested name have been found.

  Illumos ZFS issues:
    3699 zfs hold or release of a non-existent snapshot does not output
 error

MFC r249787:
  The zfs synctask code restructuring introduced a new bug that makes it
  impossible to set quota and reservation on pools lower than version 22.
  Problem has been reported and a solution discussed with vendor.

  Illumos ZFS issues:
    3739 cannot set zfs quota or reservation on pool version < 22

MFC r249883:
  Respect the enoent_ok flag if reporting error for holding an non-existing
  snapshot.

  Related illumos ZFS issue:
    3699 zfs hold or release of a non-existent snapshot does not output error

MFC r249858:
  Merge vendor bugfix for a possible deadlock related to async destroy
  and improve write performance by introducing a new lock protecting
  tx_open_txg.

  Illumos ZFS issues:
    3642 dsl_scan_active() should not issue I/O to determine if async
         destroying is active
    3643 txg_delay should not hold the tc_lock

git-svn-id: svn://svn.freebsd.org/base/stable/8@251757 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 249767:
jhb [Fri, 14 Jun 2013 18:42:08 +0000 (18:42 +0000)]
MFC 249767:
- Some BIOSes use an Extended IRQ resource descriptor in _PRS for a link
  that uses non-ISA IRQs but use a plain IRQ resource in _CRS.  However,
  a non-ISA IRQ can't fit into a plain IRQ resource.  If we encounter a
  link like this, build the resource buffer from _PRS instead of _CRS.
- Set the correct size of the end tag in a resource buffer.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251755 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250550:
pfg [Fri, 14 Jun 2013 10:45:31 +0000 (10:45 +0000)]
MFC r250550:

(Missing libcpp merge)

Add support for "d" floating-point suffix, as defined by draft N1312
of TR 24732.

Reported by: dim
Pointy hat: pfg

git-svn-id: svn://svn.freebsd.org/base/stable/8@251746 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250550, r250566;
pfg [Fri, 14 Jun 2013 03:28:29 +0000 (03:28 +0000)]
MFC r250550, r250566;

Update the gcc43 ChangeLog.

Add support for "d" floating-point suffix, as defined by draft N1312
of TR 24732.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251728 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251561:
pfg [Fri, 14 Jun 2013 03:21:53 +0000 (03:21 +0000)]
MFC r251561:

libstand: Reset the seek pointer in ext2fs as done in UFS.

PR: 177328
Submitted by: Eric van Gyzen
Reviewed by: iedowse

git-svn-id: svn://svn.freebsd.org/base/stable/8@251727 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r250177
rmacklem [Fri, 14 Jun 2013 00:33:55 +0000 (00:33 +0000)]
MFC: r250177
Fix the getpwnam_r() call in the pname_to_uid() kerberos library function so
that it handles the ERANGE error return case. Without this fix, authentication
of users for certain system setups could fail unexpectedly.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251722 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r250176
rmacklem [Fri, 14 Jun 2013 00:30:11 +0000 (00:30 +0000)]
MFC: r250176
Fix the getpwuid_r() call in the gssd daemon so that it handles
the ERANGE error return case. Without this fix, authentication
of users for certain system setups could fail unexpectedly.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251721 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC: r251089
rmacklem [Fri, 14 Jun 2013 00:02:29 +0000 (00:02 +0000)]
MFC: r251089
Add a patch analygous to r248567, r248581, r251079 to the
old NFS client to avoid the panic reported in the PR by
doing the vnode_pager_setsize() call after unlocking the mutex.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251719 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r227183,r229905,r250432,r250451,r250882:
eadler [Thu, 13 Jun 2013 21:06:17 +0000 (21:06 +0000)]
MFC r227183,r229905,r250432,r250451,r250882:

- Add missing static keywords to split(1)

- Fix warning when compiling with gcc46:
 error: variable 'defname' set but not use

- Implement 'split -d' which allows a numeric suffix instead of an
alphabetic one.

- Bump .Dd for recent content change.
Avoid signed overflow in error handling code.

PR: bin/116209

git-svn-id: svn://svn.freebsd.org/base/stable/8@251710 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 249766: Use a higher TTL (128) for DHCP packets.
jhb [Thu, 13 Jun 2013 21:03:23 +0000 (21:03 +0000)]
MFC 249766: Use a higher TTL (128) for DHCP packets.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251708 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 249315:
jhb [Thu, 13 Jun 2013 21:01:33 +0000 (21:01 +0000)]
MFC 249315:
Proxy allocation requests for the PCI ROM BAR from child devices similar
to how the VGA bus driver currently proxies allocation requests for other
PCI BARs.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251706 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r250462:
eadler [Thu, 13 Jun 2013 20:46:30 +0000 (20:46 +0000)]
MFC r250462:
Add option to lockf to avoid creating a file if it does not exist.

PR: bin/170775

git-svn-id: svn://svn.freebsd.org/base/stable/8@251705 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251109:
eadler [Thu, 13 Jun 2013 20:41:09 +0000 (20:41 +0000)]
MFC r251109:
Add support for tethering on the iPhone 4S

PR: usb/179078

git-svn-id: svn://svn.freebsd.org/base/stable/8@251702 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC 249263: Fix a potential socket leak in the NFS server.
jhb [Thu, 13 Jun 2013 19:35:56 +0000 (19:35 +0000)]
MFC 249263: Fix a potential socket leak in the NFS server.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251699 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoDocument an issue in vtnet(4) + QEMU 1.4.1 or later.
hrs [Thu, 13 Jun 2013 05:51:59 +0000 (05:51 +0000)]
Document an issue in vtnet(4) + QEMU 1.4.1 or later.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251680 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251249, r251251, r251252, r251253, r251254 and r251515:
hselasky [Tue, 11 Jun 2013 06:22:09 +0000 (06:22 +0000)]
MFC r251249, r251251, r251252, r251253, r251254 and r251515:
Correct XHCI DMA descriptor programming.
Correct maximum IRQ rate.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251615 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

10 years agoMFC r251324:
kib [Mon, 10 Jun 2013 04:23:11 +0000 (04:23 +0000)]
MFC r251324:
Assert that interrupts are enabled in the trap handlers on x86 before
calling generic code to deliver signals.

git-svn-id: svn://svn.freebsd.org/base/stable/8@251595 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f