]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
13 years agoMerge r213061 from head:
gavin [Sat, 9 Oct 2010 13:03:32 +0000 (13:03 +0000)]
Merge r213061 from head:
  Various changes from various sources:

  - Add "children" [1]
  - Add "acknowledgement", "acknowledgment", "Austria" and "haunted" [2]
  - Add "near", "antidisestablishmentarianism" and "Persephone" [2]
  - "Transvaal" should be capitalized [2]
  - Correct spelling of "structurelessness" and "Athena" [2]
  - Add missing atomic elements [3]
  - Add various words from "word of the day" lists [3]

PR: conf/149756 [1]
Submitted by: Nick Johnson <freebsd spatula.net> [1]
Obtained from: NetBSD [2], OpenBSD [3]

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

13 years agoMFC r211980: Correct value for _POSIX_AIO_LISTIO_MAX in <limits.h>.
jilles [Sat, 9 Oct 2010 13:01:25 +0000 (13:01 +0000)]
MFC r211980: Correct value for _POSIX_AIO_LISTIO_MAX in <limits.h>.

All the "Minimum Values" (POSIX.1-2008 XBD 13 Headers <limits.h>) are now
correct. These should all be exactly as they are in the specification; the
possibly higher values we support are announced differently.

PR: standards/104743

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

13 years agoMFC r209653: sh: Use $PWD instead of getcwd() for \w \W prompt expansions.
jilles [Sat, 9 Oct 2010 12:57:06 +0000 (12:57 +0000)]
MFC r209653: sh: Use $PWD instead of getcwd() for \w \W prompt expansions.

This ensures that the logical working directory (which may include
symlinks) is shown and is similar to the default behaviour of the pwd
builtin.

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

13 years agoMFC r213488:
delphij [Sat, 9 Oct 2010 00:36:32 +0000 (00:36 +0000)]
MFC r213488:

Use a defined FreeBSD version.

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

13 years agoMFC r213487:
delphij [Sat, 9 Oct 2010 00:34:58 +0000 (00:34 +0000)]
MFC r213487:

Add definition for FreeBSD 7.4, which will be used in a manual page change.

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

13 years agoMFC r212167:
yongari [Fri, 8 Oct 2010 23:16:02 +0000 (23:16 +0000)]
MFC r212167:
  Initial WOL support. NS DP8315 was tested but SiS900/SiS7016 was
  not tested.
  While I'm here, clean up SIOCSIFCAP handler.

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

13 years agoMFC r212166:
yongari [Fri, 8 Oct 2010 23:11:46 +0000 (23:11 +0000)]
MFC r212166:
  Implement initial device suspend/resume method.

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

13 years agoMFC r212159,212161:
yongari [Fri, 8 Oct 2010 20:58:05 +0000 (20:58 +0000)]
MFC r212159,212161:
r212159:
  Document tunable dev.sis.%unit.manual_pad
  While I'm here Xref vlan(4) as sis(4) supports VLAN oversized
  frames.

r212161:
  Better wording.

  Submitted by: jkim

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

13 years agoMFC r212158:
yongari [Fri, 8 Oct 2010 20:54:09 +0000 (20:54 +0000)]
MFC r212158:
  Enable sis(4). sis(4) should work on all architectures.

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

13 years agoMFC r212157:
yongari [Fri, 8 Oct 2010 20:51:33 +0000 (20:51 +0000)]
MFC r212157:
  Unlike most other controllers, NS DP83815/DP83816 controllers seem
  to pad with 0xFF when it encounter short frames.  According to RFC
  1042 the pad bytes should be 0x00.
  Because manual padding consumes extra CPU cycles, introduce a new
  tunable which controls the padding behavior. Turning this tunable
  on will have driver pad manually but it's disabled by default. Users
  can enable software padding by setting the following tunable to
  non-zero value.

  dev.sis.%d.manual_pad="1"

  PR: kern/35422 (patch not used)

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

13 years agoMFC r212121,212156:
yongari [Fri, 8 Oct 2010 20:48:09 +0000 (20:48 +0000)]
MFC r212121,212156:
r212121:
  Move sis_reset() to sis_initl(). This ensures driver starts with
  known good state of controller.

r212156:
  Fix the last endianness issue on handling station address which
  prevented driver from working on big-endian machines. Also rewrite
  station address programming to make it work on strict-alignment
  architectures. With this change, sis(4) now works on sparc64 and
  performance number looks good even though sis(4) have to apply
  fixup code to align received frames on 2 bytes boundary on sparc64.

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

13 years agoMFC r212120:
yongari [Fri, 8 Oct 2010 20:42:59 +0000 (20:42 +0000)]
MFC r212120:
  Avoid controller reinitialization which could be triggered by
  dhclient(8) or alias addresses are added.

  PR: kern/87506

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

13 years agoMFC r212117,212119:
yongari [Fri, 8 Oct 2010 20:39:45 +0000 (20:39 +0000)]
MFC r212117,212119:
rr212117:
  Report result of link state change to caller. Previously it always
  returned success.

r212119:
  Do not reinitialize controller whenever promiscuous mode or
  allmulti is toggled. Controller does not require reinitialization.
  This removes unnecessary controller reinitialization whenever
  tcpdump is used.
  While I'm here remove unnecessary variable reinitialization.

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

13 years agoMFC r212116:
yongari [Fri, 8 Oct 2010 20:33:43 +0000 (20:33 +0000)]
MFC r212116:
  Overhaul link state change handling. Previously sis(4) blindly
  configured TX/RX MACs before getting a valid link. After that, when
  link state change callback is called, it called device
  initialization again to reconfigure TX/RX MACs depending on
  resolved link state. This hack created several bad side effects and
  it required more hacks to not collide with sis_tick callback as
  well as disabling switching to currently selected media in device
  initialization. Also it seems sis(4) was used to be a template
  driver for long time so other drivers which was modeled after
  sis(4) also should be changed.

  TX/RX MACs are now reconfigured after getting a valid link. Fix for
  short cable error is also applied after getting a link because it's
  only valid when the resolved speed is 100Mbps.

  While I'm here slightly reorganize interrupt handler such that
  sis(4) always read SIS_ISR register to see whether the interrupt is
  ours or not. This change removes another hack and make it possible
  to nuke sis_stopped variable in softc.

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

13 years agoMFC r212113:
yongari [Fri, 8 Oct 2010 20:30:08 +0000 (20:30 +0000)]
MFC r212113:
  s/u_intXX_t/uintXX_t/g

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

13 years agoMFC r212109,212124,212185:
yongari [Fri, 8 Oct 2010 20:18:44 +0000 (20:18 +0000)]
MFC r212109,212124,212185:
r212109:
  bus_dma(9) cleanup.
   o Enforce TX/RX descriptor ring alignment. NS data sheet says the
     controller needs 4 bytes alignment but use 16 to cover both SiS
     and NS controllers. I don't have SiS data sheet so I'm not sure
     what is alignment restriction of SiS controller but 16 would be
     enough because it's larger than the size of a TX/RX descriptor.
     Previously sis(4) ignored the alignment restriction.
   o Enforce RX buffer alignment, 4.
     Previously sis(4) ignored RX buffer alignment restriction.
   o Limit number of TX DMA segment to be used to 16. It seems
     controller has no restriction on number of DMA segments but
     using more than 16 looks resource waste.
   o Collapse long mbuf chains with m_collapse(9) instead of calling
     expensive m_defrag(9).
   o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove
     unnecessary callbacks.
   o Initial endianness support.
   o Prefer local alignment fixup code to m_devget(9).
   o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying
     these maps in fast TX/RX path. On non-x86 architectures, this is
     very expensive operation and there is no need to do that.
   o Add missing bus_dmamap_sync(9) in TX/RX path.
   o watchdog is now unarmed only when there are no pending frames
     on controller. Previously sis(4) blindly unarmed watchdog
     without checking the number of queued frames.
   o For efficiency, loaded DMA map is reused for error frames.
   o DMA map loading failure is now gracefully handled. Previously
     sis(4) ignored any DMA map loading errors.
   o Nuke unused macros which are not appropriate for endianness
     operation.
   o Stop embedding driver maintained structures into descriptor
     rings. Because TX/RX descriptor structures are shared between
     host and controller, frequent bus_dmamap_sync(9) operations are
     required in fast path. Embedding driver structures will increase
     the size of DMA map which in turn will slow down performance.

r212124:
  Fix stupid error in r212109 which didn't swap DMA maps. This caused
  IOMMU panic on sparc64 under high TX load.

r212185:
  Fix another bug introduced in r212109. We should unload DMA maps
  only after sending the last fragment of a frame so the mbuf pointer
  also should be stored in the last descriptor index.

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

13 years agoMFC r212103-212105:
yongari [Fri, 8 Oct 2010 19:39:35 +0000 (19:39 +0000)]
MFC r212103-212105:
r212103:
  Remove leading and trailing white spaces.
  No functional changes.

r212104:
  style(9) - space after keywords.

r212105:
  Nuke unnecessary return at the end of function.

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

13 years agoMFC r212972,21300:
yongari [Fri, 8 Oct 2010 19:32:39 +0000 (19:32 +0000)]
MFC r212972,21300:
r212972:
  Remove unnecessary controller reinitialization.

  PR: kern/87506

r213000:
  Fix build breakage introduced in r212972.

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

13 years agoMFC r212971:
yongari [Fri, 8 Oct 2010 19:27:34 +0000 (19:27 +0000)]
MFC r212971:
  Remove unnecessary controller reinitialization.
  StarFire controller does not require controller reinitialization to
  program perfect filters. While here, make driver immediately exit
  from interrupt/polling handler if driver reinitialized controller.

  PR: kern/87506

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

13 years agoMFC r212969:
yongari [Fri, 8 Oct 2010 19:24:38 +0000 (19:24 +0000)]
MFC r212969:
  Make sure to clear IFF_DRV_RUNNING to reinitialize controller.
  While I'm here update if_oerrors counter when driver encounters
  watchdog timeout.

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

13 years agoMFC r212968:
yongari [Fri, 8 Oct 2010 19:19:51 +0000 (19:19 +0000)]
MFC r212968:
  Remove unnecessary controller reinitialization.

  PR: kern/87506

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

13 years agoMFC r212306-212307,212342:
yongari [Fri, 8 Oct 2010 18:58:01 +0000 (18:58 +0000)]
MFC r212306-212307,212342:
r212306:
  Remove trailing CR at EOL.

r212307:
  Consistently use tab characters instead of tab + space characters.
  No functional changes.

r212342:
  Correct definition of T2 mode bit of MRBE Message Page 5 Next Page
  Control Register.

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

13 years agoMFC r212069,212071:
yongari [Fri, 8 Oct 2010 18:49:59 +0000 (18:49 +0000)]
MFC r212069,212071:
r212069:
  bge_txeof() already checks whether it has to free transmitted mbufs
  or not by comparing reported TX consumer index with saved index. So
  remove unnecessary check done after freeing transmitted mbufs.
  While I'm here nuke unnecessary variable initializations.

r212071:
  Remove unnecessary atomic operation in bge_poll. bge(4) always
  holds a driver lock in the function entry and
  memory synchronization is handled by bus_dmamap_sync(9).

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

13 years agoMFC r212061,212065,212302:
yongari [Fri, 8 Oct 2010 18:43:06 +0000 (18:43 +0000)]
MFC r212061,212065,212302:
r212061:
  Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
  tag. All controllers that are not BCM5755 or higher have 4GB
  boundary DMA bug. Previously bge(4) used 32bit DMA address to
  workaround the bug(r199670). However this caused the use of bounce
  buffers such that it resulted in poor performance for systems which
  have more than 4GB memory. Because bus_dma(9) honors boundary
  restriction requirement of DMA tag for dynamic buffers, having a
  separate TX/RX mbuf DMA tag will greatly reduce the possibility of
  using bounce buffers. For DMA buffers allocated with
  bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
  requested memory region crossed the boundary or not.
  With this change, only the DMA buffer that crossed the boundary
  will use 32bit DMA address. Other DMA buffers are not affected as
  separate DMA tag is created for each DMA buffer.
  Even if 32bit DMA address space is used for a buffer, the chance to
  use bounce buffer is still very low as the size of buffer is small.
  This change should eliminate most usage of bounce buffers on
  systems that have more than 4GB memory.

  More correct fix would be teaching bus_dma(9) to honor boundary
  restriction for buffers created with bus_dmamem_alloc(9) but it
  seems that is not easy.

  While I'm here cleanup bge_dma_map_addr() and remove unnecessary
  member variables in bge_dmamap_arg structure.

  Tested by: marcel

r212065:
  Handle PAE case correctly. You cannot effectively specify a 4GB
  boundary in PAE case so use a 2GB boundary for PAE as suggested by
  jhb.

  Pointed out by: jhb
  Reviewed by: jhb

r212302:
  Make sure to create DMA'able memory for statistics block. This was
  missed in r212061 and it caused crashes for 570x controllers as
  controller DMAed statistics to physical address 0.

  Reported by: kan

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

13 years agoMFC r213306:
yongari [Fri, 8 Oct 2010 18:19:05 +0000 (18:19 +0000)]
MFC r213306:
  Rename rl_setmulti() to rl_rxfilter() as rl_rxfilter() will handle
  IFF_ALLMULTI/IFF_PROMISC as well as multicast filter configuration.
  Rewrite RX filter logic to reduce number of register accesses and
  make it handle promiscuous/allmulti toggling without controller
  reinitialization.

  Previously rl(4) counted on controller reinitialization to reprogram
  promiscuous configuration but r211767 resulted in avoiding
  controller reinitialization whenever promiscuous mode is toggled.
  To address this, keep track of driver's view of interface state and
  handle IFF_ALLMULTI/IFF_PROMISC changes without reinitializing
  controller. This should fix a regression introduced in r211267.

  While I'm here remove unnecessary variable reassignment in ioctl
  handler.

  PR: kern/151079

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

13 years agoMFC r212926:
mdf [Fri, 8 Oct 2010 18:06:15 +0000 (18:06 +0000)]
MFC r212926:

Use destroy_dev_sched(9) instead of destroy_dev(9) in passcleanup() as
it is indirectly a d_close method.

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

13 years agoMFC r213013:
emaste [Fri, 8 Oct 2010 14:59:14 +0000 (14:59 +0000)]
MFC r213013:

  Move test for zero bufp or size before rseq and wseq calculation.  This
  avoids spinning in an infinite loop for some (possibly corrupt?) core
  files at work.

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

13 years agoMFC r212570:
emaste [Fri, 8 Oct 2010 14:56:39 +0000 (14:56 +0000)]
MFC r212570:

  Allow a kernel config to specify a set but empty value via
  'makeoptions OPTION=' for consistency with the make commandline.

  Previously 'makeoptions WERROR=' would result in a syntax error; now
  it produces the same effect as 'makeoptions WERROR'.  Both forms now
  result in 'WERROR=' in the generated Makefile.

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

13 years agoMFC r213322: sysctls in kern_shutdown: add twin tunables
avg [Fri, 8 Oct 2010 08:13:22 +0000 (08:13 +0000)]
MFC r213322: sysctls in kern_shutdown: add twin tunables

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

13 years agoMFC r213305: there must be only one SYSINIT with
avg [Fri, 8 Oct 2010 08:01:36 +0000 (08:01 +0000)]
MFC r213305: there must be only one SYSINIT with
SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order

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

13 years agoMFC r213304: debug.kdb.stop_cpus sysctl: hint that this is also a
avg [Fri, 8 Oct 2010 07:57:19 +0000 (07:57 +0000)]
MFC r213304: debug.kdb.stop_cpus sysctl: hint that this is also a
tunable

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

13 years agoMFC r213303: kmem_size* sysctls: hint that these are also tunables
avg [Fri, 8 Oct 2010 07:52:00 +0000 (07:52 +0000)]
MFC r213303: kmem_size* sysctls: hint that these are also tunables

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

13 years agoMFC r212994: kdb_backtrace: use stack_print_ddb instead of stack_print
avg [Fri, 8 Oct 2010 07:49:05 +0000 (07:49 +0000)]
MFC r212994: kdb_backtrace: use stack_print_ddb instead of stack_print

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

13 years agoMFC r212964: kdb_backtrace: stack(9)-based code to print backtrace
avg [Fri, 8 Oct 2010 07:38:44 +0000 (07:38 +0000)]
MFC r212964: kdb_backtrace: stack(9)-based code to print backtrace
without any backend

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

13 years agoMFC r212781: zfs arc_reclaim_needed: remove redundant checks for
avg [Fri, 8 Oct 2010 07:36:30 +0000 (07:36 +0000)]
MFC r212781: zfs arc_reclaim_needed: remove redundant checks for
arc_c_max and arc_c_max

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

13 years agoMFC r212783: zfs arc_reclaim_needed: fix typo in mismerge in r212780
avg [Fri, 8 Oct 2010 07:34:32 +0000 (07:34 +0000)]
MFC r212783: zfs arc_reclaim_needed: fix typo in mismerge in r212780

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

13 years agoMFC r212780: zfs arc_reclaim_needed: more reasonable threshold for
avg [Fri, 8 Oct 2010 07:33:22 +0000 (07:33 +0000)]
MFC r212780: zfs arc_reclaim_needed: more reasonable threshold for
available pages

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

13 years agoMFC r212657: zfs vn_has_cached_data: take into account v_object->cache != NULL
avg [Fri, 8 Oct 2010 07:31:32 +0000 (07:31 +0000)]
MFC r212657: zfs vn_has_cached_data: take into account v_object->cache != NULL

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

13 years agoMFC r212951: zfs_map_page/zfs_unmap_page: do not use sched_pin() and
avg [Fri, 8 Oct 2010 07:29:26 +0000 (07:29 +0000)]
MFC r212951: zfs_map_page/zfs_unmap_page: do not use sched_pin() and
SFB_CPUPRIVATE

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

13 years agoMFC r212950: zfs_vnops: use zfs_map_page/zfs_unmap_page helper functions
avg [Fri, 8 Oct 2010 07:26:56 +0000 (07:26 +0000)]
MFC r212950: zfs_vnops: use zfs_map_page/zfs_unmap_page helper functions
in another place

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

13 years agoMFC r213258:
davidxu [Thu, 7 Oct 2010 12:20:50 +0000 (12:20 +0000)]
MFC r213258:
- kern_sched_rr_get_interval should return interval for thread 1 in
    target process.
- eliminate a goto.

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

13 years agoMFC r211059:
delphij [Thu, 7 Oct 2010 00:36:58 +0000 (00:36 +0000)]
MFC r211059:

Address an edge condition that we found at work, where the carp(4)
interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at
cold boot.  This behavior is not observed when carp(4) interface
is created slightly later, when the underlying interface is fully
up.

Before this change what happen at boot is roughly:

 - ifconfig creates em0 interface;
 - ifconfig clones a carp device using em0;
   (em0's link state is DOWN at this point)
 - carp state: INIT -> BACKUP [*]
 - carp state: BACKUP -> MASTER
 - [Some negotiate between em0 and switch]
 - em0 kicks up link state change event
   (em0's link state is now up DOWN at this point)
 - do_link_state_change() -> carp_carpdev_state()
 - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+]
 - carp state: INIT -> BACKUP
 - carp state: BACKUP -> MASTER

At the [*] stage, em0 did not received any broadcast message from other
node, and assume our node is the master, thus carp(4) sets the link
state to "UP" after becoming a master.  At [+], the master status
is forcely set to "INIT", then an election is casted, after which our
node would actually become a master.

We believe that at the [*] stage, the master status should remain as
"INIT" since the underlying parent interface's link state is not up.

Obtained from:  iXsystems, Inc.
Reported by:    jpaetzel

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

13 years agoMFC r213044:
delphij [Thu, 7 Oct 2010 00:29:07 +0000 (00:29 +0000)]
MFC r213044:

In the past gunzip(1) write()'s after each inflate return.  This is
not optimal from a performance standpoint since the write buffer is
not necessarily be filled up when the inflate rountine reached the
end of input buffer and it's not the end of file.

This problem gets uncovered by trying to pipe gunzip -c output to
a GEOM device directly, which enforces the writes be multiple of
sector size.

Sponsored by: iXsystems, Inc.
Reported by:  jpaetzel

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

13 years agoMFC r212998:
kib [Wed, 6 Oct 2010 10:00:37 +0000 (10:00 +0000)]
MFC r212998:
For sparc64 relocations that directly put bits of the symbol value into
the location, apply elf_relocaddr to the symbol value to have right
values for the symbols from dpcpu segment.

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

13 years agoMFC r203958: %U was macroized in mdoc(7), escape.
ru [Wed, 6 Oct 2010 08:05:53 +0000 (08:05 +0000)]
MFC r203958: %U was macroized in mdoc(7), escape.

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

13 years agoMFC r202454,202457,202458,202586,207842,207844,208099:
delphij [Wed, 6 Oct 2010 00:13:55 +0000 (00:13 +0000)]
MFC r202454,202457,202458,202586,207842,207844,208099:

Expose stripesize and stripeoffset via kernel sysctl as well as userland
library and the geom(8) utility.

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

13 years agoMFC: r213105, r213147
marius [Mon, 4 Oct 2010 20:13:19 +0000 (20:13 +0000)]
MFC: r213105, r213147

Improve r56796; the reply handler actually may remove the request from
the chain in which case it shouldn't be removed twice.
Reported by: Staale Kristoffersen

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

13 years agoMFC: r213102
marius [Mon, 4 Oct 2010 20:02:48 +0000 (20:02 +0000)]
MFC: r213102

Remove the duplicate logging of failed read requests, whose error message
also was inappropriate as it triggered for every EACCESS and ENOTFOUND, not
just the case the -n option is intended to deal with and thus really spammed
us with ~20 messages in the default configuration when booting a diskless
FreeBSD client, introduced with r207608 (commited to stable/8 in 213038)
again.

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

13 years agoMFC: r213099
marius [Mon, 4 Oct 2010 19:59:08 +0000 (19:59 +0000)]
MFC: r213099

Make WARNS=6 clean.

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

13 years agoMFC: 213075
marius [Mon, 4 Oct 2010 19:51:15 +0000 (19:51 +0000)]
MFC: 213075

Try to adhere to style.Makefile(5).

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

13 years agoMFC: r213053
marius [Mon, 4 Oct 2010 19:39:51 +0000 (19:39 +0000)]
MFC: r213053

Remove an explicit assignment of the CFLAGS variable intended for
debugging purposes only.

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

13 years agoMFC r213325:
bz [Mon, 4 Oct 2010 07:00:47 +0000 (07:00 +0000)]
MFC r213325:

  Proper bracketing.

  Submitted by: SunMinghao (sunminghao hotmail.com)
PR: kern/151100

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

13 years agoRevision 209601 should have merged this part of r203711 to make fmt(1)
delphij [Mon, 4 Oct 2010 06:49:12 +0000 (06:49 +0000)]
Revision 209601 should have merged this part of r203711 to make fmt(1)
build unconditional.

PR: misc/151180

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

13 years agoMFC r201053: sh: Various warning fixes (from WARNS=6 NO_WERROR=1):
jilles [Sun, 3 Oct 2010 21:56:20 +0000 (21:56 +0000)]
MFC r201053: sh: Various warning fixes (from WARNS=6 NO_WERROR=1):
- const
- initializations to silence -Wuninitialized (it was safe anyway)
- remove nested extern declarations
- rename "index" locals to "idx"

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

13 years agoMFC r212506:
kib [Sun, 3 Oct 2010 08:57:02 +0000 (08:57 +0000)]
MFC r212506:
Do not fork nfsiod directly from the vop methods.
Schedule the task that performs fork to be executed in
the taskqueue context.

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

13 years agoMFC r213174:
ae [Sat, 2 Oct 2010 22:21:01 +0000 (22:21 +0000)]
MFC r213174:
  Some schemes can allocate memory for internal purposes but when
  GEOM does withering this memory doesn't freed. Add G_PART_DESTROY
  call to g_part_wither. Also add missed g_free() call to G_PART_READ
  method for MBR and PC98 schemes.

  Submitted by: jh (previous version)
  Reviewed by: pjd

Approved by: kib (mentor)

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

13 years agoMFC r212706 (by pjd):
ae [Sat, 2 Oct 2010 22:18:36 +0000 (22:18 +0000)]
MFC r212706 (by pjd):
  Change message when setting or unsetting attribute to be less confusing.
  Before:

   ada0 has <attrib> set

  After:

   <attrib> set on ada0

Approved by: kib (mentor)

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

13 years agoMFC r212703 (by pjd):
ae [Sat, 2 Oct 2010 22:15:57 +0000 (22:15 +0000)]
MFC r212703 (by pjd):
  Make the message that informs about bootcode being written to disk less
  confusing.

  Note there is still no information about 'partcode' being written to disk
  (gpart bootcode -p <partcode> <disk>).

  Maybe in the future all the messages printed by gpart(8) on success could
  be hidden under -v?

  PR: bin/150239
  Reported by: Roddi <roddi@me.com>
  Submitted by: arundel

Approved by: kib (mentor)

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

13 years agoMFC r212609 (by pjd):
ae [Sat, 2 Oct 2010 22:14:01 +0000 (22:14 +0000)]
MFC r212609 (by pjd):
  Simplify the code a bit.

Approved by: kib (mentor)

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

13 years agoMFC r209536 (by rpaulo):
ae [Sat, 2 Oct 2010 22:12:04 +0000 (22:12 +0000)]
MFC r209536 (by rpaulo):
  Add NTFS partition type to GEOM_MBR.

Approved by: kib (mentor)

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

13 years agoMFC r203261 (by marcel):
ae [Sat, 2 Oct 2010 22:08:17 +0000 (22:08 +0000)]
MFC r203261 (by marcel):
  Export the UUID of the partition in the XML. The partition UUID is used
  by EFI's device path to identify a partition. In order for FreeBSD to
  add EFI boot options, proper device paths need to be constructed.

Approved by: kib (mentor)

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

13 years agoMFC r202977 (by trasz):
ae [Sat, 2 Oct 2010 22:06:07 +0000 (22:06 +0000)]
MFC r202977 (by trasz):
  Remove unneeded variables.

Approved by: kib (mentor)

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

13 years agoMFC r200967: sh: Add some __dead2 to indicate functions that do not return.
jilles [Sat, 2 Oct 2010 20:55:11 +0000 (20:55 +0000)]
MFC r200967: sh: Add some __dead2 to indicate functions that do not return.

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

13 years agoMFC r200956: sh: Constify various strings.
jilles [Sat, 2 Oct 2010 20:39:45 +0000 (20:39 +0000)]
MFC r200956: sh: Constify various strings.

Most of this is adding const keywords, but setvar() in var.c had to be
changed somewhat more.

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

13 years agoMFC r212824:
kib [Sat, 2 Oct 2010 17:41:47 +0000 (17:41 +0000)]
MFC r212824:
Adopt the deferring of object deallocation for the deleted map entries
on map unlock to the lock downgrade and later read unlock operation.

MFC r212868 (by alc) [1]:
Make refinements to r212824. Redo the implementation of
vm_map_unlock_and_wait().

Approved by: alc [1]

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

13 years agoMFC r210782,210837: Update the "desiredvnodes" calculation.
avg [Sat, 2 Oct 2010 08:11:38 +0000 (08:11 +0000)]
MFC r210782,210837: Update the "desiredvnodes" calculation.

On behalf of: alc

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

13 years agoCreate the var/run/wpa_supplicant directory where the wpa_supplicant
bschmidt [Fri, 1 Oct 2010 17:20:13 +0000 (17:20 +0000)]
Create the var/run/wpa_supplicant directory where the wpa_supplicant
RC script wants to save a pidfile for each interface.

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

13 years agoMFC of 213312, tzdata2010m
edwin [Thu, 30 Sep 2010 22:03:43 +0000 (22:03 +0000)]
MFC of 213312, tzdata2010m

- Fix historical data for Hongkong
- Fix location description for Antarctica/Vostok

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

13 years agoMFC r213005:
dougb [Thu, 30 Sep 2010 21:54:25 +0000 (21:54 +0000)]
MFC r213005:

Remove confusing-though-technically-correct --disable-ipv6
from CONFIGARGS.

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

13 years agoMFC r212732:
mav [Thu, 30 Sep 2010 04:23:03 +0000 (04:23 +0000)]
MFC r212732:
Fix panic, when due to some kind of congestion on FIS-based switching
port multiplier some command triggers false positive timeout, but then
completes normally.

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

13 years agoMFC r212165:
nwhitehorn [Thu, 30 Sep 2010 04:06:16 +0000 (04:06 +0000)]
MFC r212165:

In the case of non-sequential mappings, ofw_mapmem() could ask Open
Firmware to map a memory region with negative length, causing crashes
and Undefined Behavior. Add the appropriate check to make the behavior
defined.

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

13 years agoMFC r212359:
nwhitehorn [Thu, 30 Sep 2010 04:03:14 +0000 (04:03 +0000)]
MFC r212359:

Fix a problem where device detection would work unreliably on Serverworks
K2 SATA controllers. The chip's status register must be read first, and
as a long, for other registers to be correctly updated after a command, and
this includes the command sequence in device detection as well as the
previously handled case after interrupts. While here, clean up some
previous hacks related to this controller.

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

13 years agoMFC Revision: 213042
emax [Wed, 29 Sep 2010 18:41:47 +0000 (18:41 +0000)]
MFC Revision: 213042

Add the following Linux BlueZ compatibility macros: htobs(), htobl(),
btohs() and btohl()

PR: kern/136386
Submitted by: Monty Hall < kungfu_disciple at sbcglobal dot net >

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

13 years agoMFC r209168:
jh [Wed, 29 Sep 2010 14:36:25 +0000 (14:36 +0000)]
MFC r209168:

Update vfs_busy(9) and vfs_unbusy(9) manual pages to better match the
current behaviour of the functions.

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

13 years agoMFC r212980 & r213160(man4/axe.4 only)
sanpei [Wed, 29 Sep 2010 12:53:02 +0000 (12:53 +0000)]
MFC r212980 & r213160(man4/axe.4 only)

Add Planex UE-200TX-G2 to list of supported devices.
Add new device ids.
 Buffalo (Melco Inc.) LUA3-U2-AGT
 Logitec LAN-GTJ/U2A

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

13 years agoMFC r212993: acpi_attach: do not explicitly install default handlers for
avg [Wed, 29 Sep 2010 09:20:18 +0000 (09:20 +0000)]
MFC r212993: acpi_attach: do not explicitly install default handlers for
default address spaces

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

13 years agoMFC r212655: zfs mappedread, update_pages: use int for offset and length
avg [Wed, 29 Sep 2010 09:18:34 +0000 (09:18 +0000)]
MFC r212655: zfs mappedread, update_pages: use int for offset and length
within a page

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

13 years agoMFC r212654: zfs mappedread: use uiomove_fromphys where possible
avg [Wed, 29 Sep 2010 09:16:45 +0000 (09:16 +0000)]
MFC r212654: zfs mappedread: use uiomove_fromphys where possible

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

13 years agoMFC r212652: zfs: catch up with vm_page_sleep_if_busy changes
avg [Wed, 29 Sep 2010 09:15:02 +0000 (09:15 +0000)]
MFC r212652: zfs: catch up with vm_page_sleep_if_busy changes

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

13 years agoMFC r212650: tmpfs, zfs + sendfile: mark page bits as valid after
avg [Wed, 29 Sep 2010 09:11:34 +0000 (09:11 +0000)]
MFC r212650: tmpfs, zfs + sendfile: mark page bits as valid after
populating it with data

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

13 years agoMFC r212932,212949: tools/umastat: fix build on amd64 and more
avg [Tue, 28 Sep 2010 05:53:35 +0000 (05:53 +0000)]
MFC r212932,212949: tools/umastat: fix build on amd64 and more

PR: misc/146119

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

13 years agoMFC r211913:
yongari [Mon, 27 Sep 2010 17:54:04 +0000 (17:54 +0000)]
MFC r211913:
  Do not allocate multicast array memory in multicast filter
  configuration function. For failed memory allocations, em(4)/lem(4)
  called panic(9) which is not acceptable on production box.
  igb(4)/ixgb(4)/ix(4) allocated the required memory in stack which
  consumed 768 bytes of stack memory which looks too big.

  To address these issues, allocate multicast array memory in device
  attach time and make multicast configuration success under any
  conditions. This change also removes the excessive use of memory in
  stack.

  Reviewed by: jfv

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

13 years agoMFC r211909:
yongari [Mon, 27 Sep 2010 17:50:56 +0000 (17:50 +0000)]
MFC r211909:
  If em(4) failed to allocate RX buffers, do not call panic(9).
  Just showing some buffer allocation error is more appropriate
  action for drivers. This should fix occasional panic reported on
  em(4) when driver encountered resource shortage.

  Reviewed by: jfv

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

13 years agoMFC r211907:
yongari [Mon, 27 Sep 2010 17:49:05 +0000 (17:49 +0000)]
MFC r211907:
  Do not call voluntary panic(9) in case of if_alloc() failure.

  Reviewed by: jfv

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

13 years agoMFC r211906:
yongari [Mon, 27 Sep 2010 17:46:11 +0000 (17:46 +0000)]
MFC r211906:
  Make sure not to access unallocated stats memory.

  Reviewed by: jfv

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

13 years agoMFC r211400:
yongari [Mon, 27 Sep 2010 17:37:25 +0000 (17:37 +0000)]
MFC r211400:
  Remove unnecessary clean target in em(4), igb(4) and ixgbe(4).
  While here also remove man target in igb(4).

  Reviewed by: jfv

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

13 years agoMFC r212755:
yongari [Mon, 27 Sep 2010 17:10:22 +0000 (17:10 +0000)]
MFC r212755:
  Fix incorrect RX BD producer updates. The producer index was
  already updated after allocating mbuf so driver had to use the last
  index instead of using next producer index. This should fix driver
  hang which may happen under high network load.

  Reported by: Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
  Tested by: Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>

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

13 years agoMFC 212902:
jhb [Mon, 27 Sep 2010 16:29:25 +0000 (16:29 +0000)]
MFC 212902:
Tweak the stats exported by the e1000 drivers:
- Add a single sysctl procedure to all three drivers to read an arbitrary
  register (the register is passed as arg2).  Use it to replace existing
  routines in igb(4) that used a separate routine for each register, and
  to add support for missing stats in em(4) and lem(4).
- Move the 'rx_overruns' and 'watchdog_timeouts' stats out of the MAC stats
  section as they are driver stats, not MAC counters.
- Simplify the code that creates per-queue stats in igb(4) to use a single
  loop and remove duplicated code.
- Properly read all 64 bits of the 'good octets received/transmitted' in
  em(4) and lem(4).
- Actually read the interrupt count registers in em(4), and drop the
  'host to card' sysctl stats from em(4) as they are not implemented in
  any of the hardware this driver supports.
- Restore several stats to em(4) that were lost in the earlier stats
  conversion including per-queue stats.
- Export several MAC stats in em(4) that were exported in igb(4) but not
  in em(4).
- Export stats in lem(4) using individual sysctls as in em(4) and igb(4).

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

13 years agoMFC r212544: bus_add_child: add specialized default implementation that
avg [Mon, 27 Sep 2010 06:02:12 +0000 (06:02 +0000)]
MFC r212544: bus_add_child: add specialized default implementation that
calls panic

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

13 years agoMFC r212821: kern.sched.topology_spec sysctl: use step of 1 for group
avg [Mon, 27 Sep 2010 05:46:20 +0000 (05:46 +0000)]
MFC r212821: kern.sched.topology_spec sysctl: use step of 1 for group
levels numeration

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

13 years agoMFC: r212834
rmacklem [Mon, 27 Sep 2010 02:57:44 +0000 (02:57 +0000)]
MFC: r212834
Fix nfsrv_freeallnfslocks() in the experimental NFSv4 server so that
it frees local locks correctly upon close. In order for
nfsrv_localunlock() to work correctly, the lock can no longer be in
the lockowner's stateid list. As such, nfsrv_freenfslock() has to
be called before nfsrv_localunlock(), to get rid of the lock structure
on the lockowner's stateid list. This only affected operation when
local locks (vfs.newnfs.enable_locallocks=1) are enabled, which is
not the default at this time.

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

13 years agoMFC: r212833
rmacklem [Mon, 27 Sep 2010 02:44:30 +0000 (02:44 +0000)]
MFC: r212833
Fix the experimental NFSv4 server so that it performs local VOP_ADVLOCK()
unlock operations correctly. It was passing in F_SETLK instead of
F_UNLCK as the operation for the unlock case. This only affected
operation when local locking (vfs.newnfs.enable_locallocks=1) was enabled.

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

13 years agoMFC: r212443
rmacklem [Mon, 27 Sep 2010 02:30:56 +0000 (02:30 +0000)]
MFC: r212443
This patch applies one of the two fixes suggested by
zack.kirsch at isilon.com for a race between nfsrv_freeopen()
and nfsrv_getlockfile() in the experimental NFS server that
he found during testing. Although nfsrv_freeopen() holds a
sleep lock on the lock file structure when called with
cansleep != 0, nfsrv_getlockfile() could still search the
list, once it acquired the NFSLOCKSTATE() mutex. I believe
that acquiring the mutex in nfsrv_freeopen() fixes the race.

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

13 years agoMFC: r212439
rmacklem [Mon, 27 Sep 2010 02:09:25 +0000 (02:09 +0000)]
MFC: r212439
Fix the NFSVNO_CMPFH() macro in the experimental NFS server so
that it works correctly for ZFS file handles. It is possible to
have two ZFS file handles that differ only in the bytes in the
fid_reserved field of the generic "struct fid" and comparing the
bytes in fid_data didn't catch this case. This patch changes the
macro to compare all bytes of "struct fid".

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

13 years agoMFC: r212362
rmacklem [Mon, 27 Sep 2010 01:41:39 +0000 (01:41 +0000)]
MFC: r212362
Fix the experimental NFS client so that it doesn't panic when
NFSv2,3 byte range locking is attempted. A fix that allows the
nlm_advlock() to work with both clients is in progress, but
may take a while. As such, I am doing this commit so that
the kernel doesn't panic in the meantime.

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

13 years agoMFC r211873:
jh [Sun, 26 Sep 2010 16:52:05 +0000 (16:52 +0000)]
MFC r211873:

Don't attempt to write label with GEOM_BSD based method if the class is
not available. This improves error reporting when bsdlabel(8) is unable
to open a device for writing. If GEOM_BSD was unavailable, only a rather
obscure error message "Class not found" was printed.

PR: bin/58390

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

13 years agoRevert r213002.
rpaulo [Sun, 26 Sep 2010 12:52:23 +0000 (12:52 +0000)]
Revert r213002.

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

13 years agoMFC r211393 (des):
delphij [Fri, 24 Sep 2010 23:47:42 +0000 (23:47 +0000)]
MFC r211393 (des):

In setusercontext(), do not apply user settings unless running as the
user in question (usually but not necessarily because we were called
with LOGIN_SETUSER).  This plugs a hole where users could raise their
resource limits and expand their CPU mask.

Approved by: des

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

13 years agoMFC r211768:
yongari [Fri, 24 Sep 2010 19:30:34 +0000 (19:30 +0000)]
MFC r211768:
  Remove unnecessary controller reinitialization.

  PR: kern/87506

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

13 years agoMFC r211767:
yongari [Fri, 24 Sep 2010 19:27:47 +0000 (19:27 +0000)]
MFC r211767:
  Remove unnecessary controller reinitialization.

  PR: kern/87506

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