]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
11 years agoMerge r237645 from head:
gavin [Sat, 30 Jun 2012 20:22:20 +0000 (20:22 +0000)]
Merge r237645 from head:

  The -S option, to specify the sector size, has been usable on all types
  of memory disks since r135340.  Update the man page to reflect this.

Noticed by: avg

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

11 years agoMFC r237674
thompsa [Sat, 30 Jun 2012 18:57:55 +0000 (18:57 +0000)]
MFC r237674

 Update the usage with the new jail option.

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

11 years agoMFC r236503: free wdog_kern_pat calls in post-panic paths from under
avg [Sat, 30 Jun 2012 14:17:59 +0000 (14:17 +0000)]
MFC r236503: free wdog_kern_pat calls in post-panic paths from under
SW_WATCHDOG

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

11 years agoMFC r236504: cpucontrol: use CPUCTL_UPDATE ioctl on correct file
avg [Sat, 30 Jun 2012 14:05:35 +0000 (14:05 +0000)]
MFC r236504: cpucontrol: use CPUCTL_UPDATE ioctl on correct file
descriptor (in amd case)

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

11 years agoMFC r237452:
ken [Fri, 29 Jun 2012 22:33:48 +0000 (22:33 +0000)]
MFC r237452:

  r237452 | ken | 2012-06-22 12:57:06 -0600 (Fri, 22 Jun 2012) | 25 lines

  Change 'camcontrol defects' to first probe a drive to find out how much
  defect information it has before grabbing the full defect list.

  This works around a bug with some Hitachi drives that generate data overrun
  errors when they are asked for more defect data than they have.

  The change is done in a spec-compliant way, so it should have no negative
  impact on drives that don't have this issue.

  This is based on work originally done at Sandvine.

  scsi_da.h: Add a define for the maximum amount of data that can be
   contained in a defect list.

  camcontrol.c: Update the readdefects() function to issue an initial
   command to determine the length of the defect list, and
   then use that length in the request for the full defect
   list.

  camcontrol.8: Add a note that some drives will report 0 defects available
   if you don't request either the PLIST or GLIST.

  Submitted by: Mark Johnston <markjdb@gmail.com> (original version)

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

11 years agoMFC r237328, except for the scsi_enc.c changes:
ken [Fri, 29 Jun 2012 22:28:31 +0000 (22:28 +0000)]
MFC r237328, except for the scsi_enc.c changes:

  r237328 | ken | 2012-06-20 11:08:00 -0600 (Wed, 20 Jun 2012) | 69 lines

  Fix several reference counting and object lifetime issues between
  the pass(4) and enc(4) drivers and devfs.

  The pass(4) driver uses the destroy_dev_sched() routine to
  schedule its device node for destruction in a separate thread
  context.  It does this because the passcleanup() routine can get
  called indirectly from the passclose() routine, and that would
  cause a deadlock if the close routine tried to destroy its own
  device node.

  In any case, once a particular passthrough driver number, e.g.
  pass3, is destroyed, CAM considers that unit number (3 in this
  case) available for reuse.

  The problem is that devfs may not be done cleaning up the previous
  instance of pass3, and will panic if isn't done cleaning up the
  previous instance.

  The solution is to get a callback from devfs when the device node
  is removed, and make sure we hold a reference to the peripheral
  until that happens.

  Testing exposed some other cases where we have reference counting
  issues, and those were also fixed in the pass(4) driver.

  cam_periph.c: In camperiphfree(), reorder some of the operations.

   The peripheral destructor needs to be called before
   the peripheral is removed from the peripheral is
   removed from the list.  This is because once we
   remove the peripheral from the list, and drop the
   topology lock, the peripheral number may be reused.
   But if the destructor hasn't been called yet, there
   may still be resources hanging around (like devfs
   nodes) that haven't been fully cleaned up.

  cam_xpt.c: Add an argument to xpt_remove_periph() to indicate
   whether the topology lock is already held.

  scsi_enc.c: Acquire an extra reference to the peripheral during
   registration, and release it once we get a callback
   from devfs indicating that the device node is gone.

   Call destroy_dev_sched_cb() in enc_oninvalidate()
   instead of calling destroy_dev() in the cleanup
   routine.

  scsi_pass.c: Add reference counting to handle peripheral and
   devfs object lifetime issues.

   Add a reference to the peripheral and the devfs
   node in the peripheral registration.

   Don't attempt to add a physical path alias if the
   peripheral has been marked invalid.

   Release the devfs reference once the initial
   physical path alias taskqueue run has completed.

   Schedule devfs node destruction in the
   passoninvalidate(), and release our peripheral
   reference in a new routine, passdevgonecb() once
   the devfs node is gone.  This allows the peripheral
   to fully go away, and the peripheral destructor,
   passcleanup(), will get called.

  Sponsored by: Spectra Logic

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

11 years agoMFC r236138, with the exception of scsi_enc.c:
ken [Fri, 29 Jun 2012 22:00:30 +0000 (22:00 +0000)]
MFC r236138, with the exception of scsi_enc.c:

  r236138 | ken | 2012-05-27 00:11:09 -0600 (Sun, 27 May 2012) | 64 lines

  Work around a race condition in devfs by changing the way closes
  are handled in most CAM peripheral drivers that are not handled by
  GEOM's disk class.

  The usual character driver open and close semantics are that the
  driver gets N open calls, but only one close, when the last caller
  closes the device.

  CAM peripheral drivers expect that behavior to be honored to the
  letter, and the CAM peripheral driver code (specifically
  cam_periph_release_locked_busses()) panics if it is done incorrectly.

  Since devfs has to drop its locks while it calls a driver's close
  routine, and it does not have a way to delay or prevent open calls
  while it is calling the close routine, there is a race.

  The sequence of events, simplified a bit, is:

  - devfs acquires a lock
  - devfs checks the reference count, and if it is 1, continues to close.
  - devfs releases the lock

  - 2nd process open call on the device happens here

  - devfs calls the driver's close routine

  - devfs acquires a lock
  - devfs decrements the reference count
  - devfs releases the lock

  - 2nd process close call on the device happens here

  At the second close, we get a panic in
  cam_periph_release_locked_busses(), complaining that peripheral
  has been released when the reference count is already 0.  This is
  because we have gotten two closes in a row, which should not
  happen.

  The fix is to add the D_TRACKCLOSE flag to the driver's cdevsw, so
  that we get a close() call for each open().  That does happen
  reliably, so we can make sure that our reference counts are
  correct.

  Note that the sa(4) and pt(4) drivers only allow one context
  through the open routine.  So these drivers aren't exposed to the
  same race condition.

  scsi_ch.c,
  scsi_enc.c,
  scsi_enc_internal.h,
  scsi_pass.c,
  scsi_sg.c:
   For these drivers, change the open() routine to
   increment the reference count for every open, and
   just decrement the reference count in the close.

   Call cam_periph_release_locked() in some scenarios
   to avoid additional lock and unlock calls.

  scsi_pt.c: Call cam_periph_release_locked() in some scenarios
   to avoid additional lock and unlock calls.

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

11 years agoMFC r237601:
ken [Fri, 29 Jun 2012 21:33:36 +0000 (21:33 +0000)]
MFC r237601:
  r237601 | ken | 2012-06-26 08:51:35 -0600 (Tue, 26 Jun 2012) | 38 lines

  Fix an issue that caused the kernel to panic inside CTL when trying
  to attach to target capable HBAs that implement the old immediate
  notify (XPT_IMMED_NOTIFY) and notify acknowledge (XPT_NOTIFY_ACK)
  CCBs.  The new API has been in place since SVN change 196008 in
  2009.

  The solution is two-fold:  fix CTL to handle the responses from the
  HBAs, and convert the HBA drivers in question to use the new API.

  These drivers have not been tested with CTL, so how well they will
  interoperate with CTL is unknown.

  scsi_target.c:Update the userland target example code to use the
   new immediate notify API.

  scsi_ctl.c: Detect when an immediate notify CCB is returned
   with CAM_REQ_INVALID or CAM_PROVIDE_FAIL status,
   and just free it.

   Fix a duplicate assignment.

  aic79xx.c,
  aic79xx_osm.c:Update the aic79xx driver to use the new API.
     Target mode is not enabled on for this driver, so
   the changes will have no practical effect.

  aic7xxx.c,
  aic7xxx_osm.c:Update the aic7xxx driver to use the new API.

  sbp_targ.c: Update the firewire target code to work with the
   new API.

  mpt_cam.c: Update the mpt(4) driver to work with the new API.
   Target mode is only enabled for Fibre Channel
   mpt(4) devices.

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

11 years agoMFC r233963:
ken [Fri, 29 Jun 2012 21:27:37 +0000 (21:27 +0000)]
MFC r233963:
  r233963 | ken | 2012-04-06 16:23:13 -0600 (Fri, 06 Apr 2012) | 27 lines

  Change the SCSI INQUIRY peripheral qualifier that CTL reports for LUNs
  that don't exist.

  Anecdotal evidence indicates that it is better to return 011b (bad LUN)
  than 001b (LUN offline).  However, this change also gives the user a
  sysctl/tunable, kern.cam.ctl.inquiry_pq_no_lun, to override the change
  and return to the previous behavior.  (The previous behavior was to
  return 001b, or LUN offline.)

  ctl.c: Change the default inquiry peripheral qualifier to 011b,
   and add a sysctl and tunable to allow the user to change
   it back to 001b if needed.

   Don't insert a Copan copyright statement in the inquiry
   data.  The copyright statements on the files are
   sufficient.

  ctl_private.h:Add sysctl variable context to the CTL softc.

  ctl_cmd_table.c,
  ctl_frontend_internal.c,
  ctl_frontend.c,
  ctl_backend.c,
  ctl_error.c: Include sys/sysctl.h.

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

11 years agoMFC 235024,235029,235556,235834,235845:
jhb [Fri, 29 Jun 2012 21:24:56 +0000 (21:24 +0000)]
MFC 235024,235029,235556,235834,235845:
Use MADT to match ACPI Processor objects to CPUs.  MADT and DSDT/SSDTs may
list CPUs in different orders, especially for disabled logical cores.  Now
we match ACPI IDs from the MADT with Processor objects, strictly order CPUs
accordingly, and ignore disabled cores.  This prevents us from executing
methods for other CPUs, e. g., _PSS for disabled logical core, which may not
exist.  Unfortunately, it is known that there are a few systems with buggy
BIOSes that do not have unique ACPI IDs for MADT and Processor objects.  To
work around these problems, 'debug.acpi.cpu_unordered' tunable is added.
Set this to a non-zero value to restore the old behavior.

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

11 years agoMFC r232604:
ken [Fri, 29 Jun 2012 21:19:24 +0000 (21:19 +0000)]
MFC r232604:
  r232604 | trasz | 2012-03-06 06:43:57 -0700 (Tue, 06 Mar 2012) | 6 lines

  Add LUN resizing to CTL.  Also make it possible to explicitly set
  size when creating file-backed or device-backed LUN.

  Reviewed by:    ken (earlier version)
  Sponsored by:   The FreeBSD Foundation

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

11 years agoMFC: r236581
marius [Fri, 29 Jun 2012 18:39:22 +0000 (18:39 +0000)]
MFC: r236581

The loaddev environment variable is not modifiable once set, so it is not
update for ZFS. It seems that this does not really affect anything except
the help command. Nevertheless, rearrange things so loaddev is set only
once in all cases in order to get it right.
Pointed out by: avg

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

11 years agoMFC r236810:
dim [Fri, 29 Jun 2012 18:18:51 +0000 (18:18 +0000)]
MFC r236810:

Amend r227797 by also passing ${STATIC_CXXFLAGS} for the other supported
C++ file extensions.

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

11 years agoMFC r235281:
dim [Fri, 29 Jun 2012 18:09:39 +0000 (18:09 +0000)]
MFC r235281:

Fix sys/boot/i386/cdboot/cdboot.S compilation with clang after r235219.
This file uses .code16 directives, which are not yet supported by
clang's integrated assembler.

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

11 years agoMFC 237337:
jhb [Fri, 29 Jun 2012 17:28:48 +0000 (17:28 +0000)]
MFC 237337:
Only output a list of file systems that need to be dumped if the system
has a non-empty dumpdates file.

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

11 years agoMFC 233191:
jhb [Fri, 29 Jun 2012 17:21:19 +0000 (17:21 +0000)]
MFC 233191:
Fix madvise(MADV_WILLNEED) to properly handle individual mappings larger
than 4GB.  Specifically, the inlined version of 'ptoa' of the the 'int'
count of pages overflowed on 64-bit platforms.  While here, change
vm_object_madvise() to accept two vm_pindex_t parameters (start and end)
rather than a (start, count) tuple to match other VM APIs as suggested
by alc@.

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

11 years agoMFC 237334:
jhb [Fri, 29 Jun 2012 17:12:03 +0000 (17:12 +0000)]
MFC 237334:
Move the per-thread deferred user map entries list into a private list
in vm_map_process_deferred() which is then iterated to release map entries.
This avoids having a nested vm map unlock operation called from the loop
body attempt to recuse into vm_map_process_deferred().  This can happen if
the vm_map_remove() triggers the OOM killer.

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

11 years agoMFC 237008,237271,237272,237673:
jhb [Fri, 29 Jun 2012 16:29:38 +0000 (16:29 +0000)]
MFC 237008,237271,237272,237673:
- Fix a couple of bugs that prevented windows in PCI-PCI bridges from
  growing "downward" (moving the start address down).  First, an off by
  one error caused the end address to be moved down an extra alignment
  chunk unnecessarily.  Second, when aligning the new candidate starting
  address, the wrong bits were masked off.
- Add a 'wmask' variable to hold the expression '(1ul << w->step) - 1' in
  pcib_grow_window().
- For subtractively decoding bridges, don't try to grow windows but pass
  the request up the tree in order to be on the safe side. Growing windows
  in this case would mean to switch resources to positive decoding and
  it's unclear how to correctly handle this. At least with ALi/ULi M5249
  PCI-PCI bridges, this also just doesn't work out of the box.

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

11 years agoMFC: r236592 r236593 r236594 r236620 r236621 r236622 r236637 r237794: filemon(4)
obrien [Fri, 29 Jun 2012 15:57:25 +0000 (15:57 +0000)]
MFC: r236592 r236593 r236594 r236620 r236621 r236622 r236637 r237794: filemon(4)

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

11 years agoMFC 236717:
jhb [Fri, 29 Jun 2012 15:30:14 +0000 (15:30 +0000)]
MFC 236717:
Teach procstat_get_shm_info_kvm() how to fetch the pathname of a SHM file
descriptor from a core and set it in fts->fs_path.

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

11 years agoMFC 236577:
jhb [Fri, 29 Jun 2012 15:24:46 +0000 (15:24 +0000)]
MFC 236577:
Allow the -p argument to kdump to accept either a PID or a thread ID.

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

11 years agoMFC: r237268
bapt [Fri, 29 Jun 2012 13:00:28 +0000 (13:00 +0000)]
MFC: r237268

early MFC to get this important bugfix into 9.1

Revert user comparison back to user names as some user can share uids (root/toor
for example)

get the username information from old_pw structures to still allow renaming of a
user.

Reported by: Claude Buisson <clbuisson@orange.fr>
Approved by: des (mentor)

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

11 years agoMerge r236364 from head by eri@:
glebius [Fri, 29 Jun 2012 12:11:31 +0000 (12:11 +0000)]
Merge r236364 from head by eri@:
  Correct table counter functionality to not panic.
  This was caused by not proper initialization of necessary parameters.

  PR: 168200
  Reviewed by: bz@, glebius@
  MFC after: 1 week

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

11 years agoMFC: r237219
pho [Fri, 29 Jun 2012 12:08:26 +0000 (12:08 +0000)]
MFC: r237219

In tty_makedev() the following construction:

dev = make_dev_cred();
dev->si_drv1 = tp;

leaves a small window where the newly created device may be opened
and si_drv1 is NULL.

As this is a vary rare situation, using a lock to close the window
seems overkill. Instead just wait for the assignment of si_drv1.

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

11 years agoMerge r233773 from head:
glebius [Fri, 29 Jun 2012 12:05:19 +0000 (12:05 +0000)]
Merge r233773 from head:
  Historically arp(8) did a route lookup for the entry it is
  about to add, and failed if it exist and had invalid data
  link type.

  Later on, in r201282, this check morphed to other code, but
  message "proxy entry exists for non 802 device" still left,
  and now it is printed in a case if route prefix found is
  equal to current address being added. In other words, when
  we are trying to add ARP entry for a network address. The
  message is absolutely unrelated and disappointing in this
  case.

  I don't see anything bad with setting ARP entries for
  network addresses. While useless in usual network,
  in a /31 RFC3021 it may be necessary. This, remove this code.

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

11 years agoMFC r237480
jhibbits [Fri, 29 Jun 2012 10:39:42 +0000 (10:39 +0000)]
MFC r237480

Release the ADB keyboard mutex when handling the power button
press/release.  Found by WITNESS.

Approved by: nwhitehorn (mentor)

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

11 years agoMFC r235390: zfs boot code: mark spa_t arguments as const where they are
avg [Fri, 29 Jun 2012 10:30:59 +0000 (10:30 +0000)]
MFC r235390: zfs boot code: mark spa_t arguments as const where they are
used as such

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

11 years agoMFC r235392,235394,235395: fixes and cleanups for zfs boot MFC
avg [Fri, 29 Jun 2012 10:28:46 +0000 (10:28 +0000)]
MFC r235392,235394,235395: fixes and cleanups for zfs boot MFC

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

11 years agoMFC r235330: zfs boot: try to set vfs.root.mountfrom from currdev as a
avg [Fri, 29 Jun 2012 10:22:20 +0000 (10:22 +0000)]
MFC r235330: zfs boot: try to set vfs.root.mountfrom from currdev as a
fallback

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

11 years agoMFC r235329,235343,235361,235364: zfsboot/zfsloader: support accessing
avg [Fri, 29 Jun 2012 10:19:15 +0000 (10:19 +0000)]
MFC r235329,235343,235361,235364: zfsboot/zfsloader: support accessing
filesystems within a pool

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

11 years agoMFC r235264: MFi386: improve argument passing via btxldr
avg [Fri, 29 Jun 2012 10:12:18 +0000 (10:12 +0000)]
MFC r235264: MFi386: improve argument passing via btxldr

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

11 years agoMFC r235219: cdboot, pxeldr: make use of bootargs.h instead of
avg [Fri, 29 Jun 2012 10:10:16 +0000 (10:10 +0000)]
MFC r235219: cdboot, pxeldr: make use of bootargs.h instead of
redefining flag constants

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

11 years agoMFC r235156: i386 zfsloader: rename LIBZFS to LIBZFSBOOT
avg [Fri, 29 Jun 2012 10:08:31 +0000 (10:08 +0000)]
MFC r235156: i386 zfsloader: rename LIBZFS to LIBZFSBOOT

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

11 years agoMFC r235155: i386 boot: consolidate MAXBDDEV definition
avg [Fri, 29 Jun 2012 10:06:37 +0000 (10:06 +0000)]
MFC r235155: i386 boot: consolidate MAXBDDEV definition

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

11 years agoMFC r235154,r235158: btxldr: future-proof argument passing from
avg [Fri, 29 Jun 2012 10:01:56 +0000 (10:01 +0000)]
MFC r235154,r235158: btxldr: future-proof argument passing from
boot1/2-ish to loader

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

11 years agoMFC r237430:
kib [Fri, 29 Jun 2012 09:41:09 +0000 (09:41 +0000)]
MFC r237430:
Reserve AT_TIMEKEEP auxv entry for providing usermode the pointer to
timekeeping information.

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

11 years agoMFC r235153: sys/boot: add common CTASSERT definition
avg [Fri, 29 Jun 2012 09:17:49 +0000 (09:17 +0000)]
MFC r235153: sys/boot: add common CTASSERT definition

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

11 years agoMFC r237458:
mm [Fri, 29 Jun 2012 06:41:03 +0000 (06:41 +0000)]
MFC r237458:
Import Illumos revision 13736:9f1d48e1681f
2901 ZFS receive fails for exabyte sparse files

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

Obtained from: illumos (issue #2901)

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

11 years agoMerge the firmware download functionality into camcontrol, as well as
scottl [Fri, 29 Jun 2012 03:37:23 +0000 (03:37 +0000)]
Merge the firmware download functionality into camcontrol, as well as
several other minor code changes.

Obtained from: Netflix, Inc.

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

11 years agoMFC r237448:
pfg [Fri, 29 Jun 2012 03:01:38 +0000 (03:01 +0000)]
MFC r237448:

Merge changes from upstream libedit.

Here we update most of the files to at least match the
version available in NetBSD's snapshot of 20091228. This
version was chosen because it still doesn't include wide
character support (UTF-8), which involves many changes and
new files.

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

11 years agoMFC 228161,230774,230822,236415:
jhb [Thu, 28 Jun 2012 21:24:09 +0000 (21:24 +0000)]
MFC 228161,230774,230822,236415:
Add a new -e flag to pciconf(8)'s list mode to display PCI error details.
Currently this dumps the status of any error bits in the PCI status register
and PCI-express device status register.  It also lists any errors indicated
by version 1 of PCI-express Advanced Error Reporting (AER).

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

11 years agoMFC 236405:
jhb [Thu, 28 Jun 2012 19:55:26 +0000 (19:55 +0000)]
MFC 236405:
Remove unnecessary initializations.  The BSS of boot2 is in fact
zero'd when boot2 begins execution by the _start() routine in btxcsu.S.

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

11 years agoMFC 236404:
jhb [Thu, 28 Jun 2012 19:34:23 +0000 (19:34 +0000)]
MFC 236404:
Extend VERBOSE_SYSINIT to also print out the name of variables passed
to SYSINIT routines if they can be resolved via symbol look up in DDB.
To avoid false positives, only honor a name if the symbol resolves
exactly to the pointer value (no offset).

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

11 years agoMFC 235132:
jhb [Thu, 28 Jun 2012 18:52:33 +0000 (18:52 +0000)]
MFC 235132:
Display dropped transmit packets in the daily network interface output.

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

11 years agoMFC 234494:
jhb [Thu, 28 Jun 2012 18:38:24 +0000 (18:38 +0000)]
MFC 234494:
Include the associated wait channel message for context switch ktrace
records.  kdump supports both the old and new messages.

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

11 years agoFix unbounded-length malloc, controlled from usermode. The added check
kib [Thu, 28 Jun 2012 14:26:55 +0000 (14:26 +0000)]
Fix unbounded-length malloc, controlled from usermode. The added check
is performed before exact size of the buffer is calculated, but the
buffer cannot have size greater then the total space allocated for
extended attributes. The existing check is executing with precise
size, but it is too late, since buffer needs to be allocated in
advance.

Also, adapt to uio_resid being of ssize_t type.  Use lblktosize instead of
multiplying by fs block size by hand as well.

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

11 years agoMFC r237058:
kib [Thu, 28 Jun 2012 14:13:45 +0000 (14:13 +0000)]
MFC r237058:
Eliminate the static buffer used to read the first page of the mapped
object, and eliminate the pread(2) call as well. Mmap the first
page of the object temporaly, and unmap it on error or last use.
Potentially, this leaves one-page gap between succeeding dlopen(3),
but there are other mmap(2) consumers as well.

Fix several cases were the whole mapping of the object leaked on error.

Use MAP_PREFAULT_READ for mmap(2) calls which map real object pages

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

11 years agoMFC r237655:
wblock [Thu, 28 Jun 2012 13:10:36 +0000 (13:10 +0000)]
MFC r237655:

Point out that /usr/src, /usr/doc, and /usr/ports may be empty or not
exist until populated with csup(1) or svn(1).

PR: 169487
Submitted by: Moritz Wilhelmy

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

11 years agoMFC r237620:
wblock [Thu, 28 Jun 2012 13:04:55 +0000 (13:04 +0000)]
MFC r237620:

Use possessive "its", no apostrophe.

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

11 years agoMFC: r237350, r237357
fjoe [Thu, 28 Jun 2012 11:15:48 +0000 (11:15 +0000)]
MFC: r237350, r237357

Add support for the following Moxa PCIe multiport serial boards:
- CP102E
- CP102EL
- CP114EL
- CP118EL-A
- CP168EL-A

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

11 years agoMerge head revisions 237393, 237409:
issyl0 [Thu, 28 Jun 2012 10:05:45 +0000 (10:05 +0000)]
Merge head revisions 237393, 237409:
  Locale-specific man page edits:
    - libc/string/strcoll.3
    - libc/string/strstr.3
    - libc/string/strxfrm.3
    - libc/string/strcasecmp.3
    - libc/string/Makefile.inc

Approved by: gabor (mentor)

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

11 years agoMFC 236028, 236185, 236972
gabor [Thu, 28 Jun 2012 09:18:11 +0000 (09:18 +0000)]
MFC 236028, 236185, 236972

- Add support for BSD iconv when it is built into libc

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

11 years agoMFC r237410: zlib 1.2.7.
delphij [Thu, 28 Jun 2012 07:08:48 +0000 (07:08 +0000)]
MFC r237410: zlib 1.2.7.

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

11 years agoMFC r237406:
pfg [Thu, 28 Jun 2012 01:02:50 +0000 (01:02 +0000)]
MFC r237406:

Bring a couple of fixes for gcc optimizations.

The GCC4.3 branch contains some optimization fixes
that were not considered regressions and therefore
were never backported. We are bringing a couple of
them that are under GPLv2 since they were made
before the license switch upstream.

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

11 years agoMFC r235870
thompsa [Wed, 27 Jun 2012 22:11:31 +0000 (22:11 +0000)]
MFC r235870

 Allow the socket list to be limited to a specific jail id.

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

11 years agoMFC r236178
thompsa [Wed, 27 Jun 2012 22:09:04 +0000 (22:09 +0000)]
MFC r236178

 if_lagg: allow to invoke SIOCSLAGGPORT multiple times in a row

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

11 years agoMFC r236062
thompsa [Wed, 27 Jun 2012 22:06:42 +0000 (22:06 +0000)]
MFC r236062

 Turn LACP debugging from a compile time option to a sysctl, it is very handy to
 be able to turn it on when negotiation to a switch misbehaves.

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

11 years agoMFC: r237025
jkim [Wed, 27 Jun 2012 21:18:47 +0000 (21:18 +0000)]
MFC: r237025

Add a convenience macro for the fastcall attribute.

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

11 years agoMFC 233925,236357:
jhb [Wed, 27 Jun 2012 21:12:15 +0000 (21:12 +0000)]
MFC 233925,236357:
Add new ktrace records for the start and end of VM faults.  This gives
a pair of records similar to syscall entry and return that a user can
use to determine how long page faults take.  The new ktrace records are
enabled via the 'p' trace type, but are not enabled in the default set of
trace points.

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

11 years agoMerge r237411 from head (originally by emast):
gavin [Wed, 27 Jun 2012 21:05:21 +0000 (21:05 +0000)]
Merge r237411 from head (originally by emast):

  Add PCI IDs for Ivy Bridge

Requested by: emaste

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

11 years agoMFC r236823 (pjd):
mm [Wed, 27 Jun 2012 11:59:57 +0000 (11:59 +0000)]
MFC r236823 (pjd):

ds_guid of 0 is special, as it is used by snapshot receive code to
differentiate between an incremental and full stream.
Be sure not to generate guid equal to 0.

Reported by: someone who saw 0 being generated as 64bit random guid

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

11 years agoMFC r237401:
mav [Wed, 27 Jun 2012 11:07:01 +0000 (11:07 +0000)]
MFC r237401:
Make cam_periph_hold() behavior consistent: drop taken reference and
return ENXIO if periph was invalidated while we were waiting for it.

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

11 years agoMFC r237398:
mav [Wed, 27 Jun 2012 11:02:35 +0000 (11:02 +0000)]
MFC r237398:
In camisr() clear CAM_SIM_ON_DONEQ flag after camisr_runqueue() purged SIM
done queue. Clearing it before caused extra SIM queueing in some cases.
It was invisible during normal operation, but during USB device unplug and
respective SIM destruction it could keep pointer on SIM without having
counted reference and as result crash the system by use afer free.

PR: usb/168743

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

11 years agoMFC r237286, r237523:
eadler [Wed, 27 Jun 2012 06:40:59 +0000 (06:40 +0000)]
MFC r237286, r237523:
Don't close an uninitialized descriptor.

PR: bin/167302
Approved by: cperciva (implicit)

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

11 years agoMFC r236214
alc [Wed, 27 Jun 2012 05:38:39 +0000 (05:38 +0000)]
MFC r236214
  Replace all uses of the vm page queues lock by a r/w lock that is private
  to this pmap.c.

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

11 years agoMFC r237339:
delphij [Wed, 27 Jun 2012 00:31:30 +0000 (00:31 +0000)]
MFC r237339:

Polish previous revision: if the fts_* routines have lstat()'ed the
directory entry then use the struct stat from that instead of doing
it again, and skip the rm_overwrite() call if fts_read() indicated
that the entry couldn't be a regular file.

Obtained from: OpenBSD

MFC r237284 (kevlo):

Fix potential symlink race condition in "rm -P" by adding a check
that the file we have opened is the one we expected.  Also open in
non-blocking mode to avoid a potential hang with FIFOs.

Obtained from: NetBSD via OpenBSD

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

11 years agoMFC 237494:
iwasaki [Tue, 26 Jun 2012 15:30:35 +0000 (15:30 +0000)]
MFC 237494:

- Add description about dev.acpi_ibm.0.handlerevents.

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

11 years agoMFC 237493:
iwasaki [Tue, 26 Jun 2012 15:29:38 +0000 (15:29 +0000)]
MFC 237493:

- Add in-driver event handler.

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

11 years agoMFC r237484:
kib [Tue, 26 Jun 2012 10:32:09 +0000 (10:32 +0000)]
MFC r237484:
Correct device id for GPU on some server SandyBridge model.

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

11 years agoMFC r237259 r237260 r237329:
eadler [Tue, 26 Jun 2012 03:05:17 +0000 (03:05 +0000)]
MFC r237259 r237260 r237329:
Allow users with RO privilege to the device to read the RO attributes. [0]
Add __unused macros to appropriate places in order to allow building
with WARNS=6 on base gcc, gcc46, and clang

PR: bin/167302 [0]
Approved by: cperciva (implicit)

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

11 years agoMFC r225808:
wblock [Mon, 25 Jun 2012 23:39:35 +0000 (23:39 +0000)]
MFC r225808:

Fix grammar.

PR: 140457
Submitted by: jeremyhu AT apple.com
Approved by: gjb (mentor)

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

11 years agoMFC r237243:
kib [Mon, 25 Jun 2012 09:41:47 +0000 (09:41 +0000)]
MFC r237243:
Adjust the fix in r236953, by not generating the signal manually, but
performing the return to usermode using full return path.

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

11 years agoMFC r236997:
fabient [Mon, 25 Jun 2012 07:56:23 +0000 (07:56 +0000)]
MFC r236997:
Add ARM callchain support for hwpmc.

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

11 years agoMFC r237295:
fabient [Mon, 25 Jun 2012 07:33:54 +0000 (07:33 +0000)]
MFC r237295:
Fix viawd(4) that was only working as a module.

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

11 years agoMFC r237322:
fabient [Mon, 25 Jun 2012 07:27:31 +0000 (07:27 +0000)]
MFC r237322:
Allow booting XENHVM kernel without Xen hypervisor.

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

11 years agoMFC r237460:
mav [Mon, 25 Jun 2012 07:09:36 +0000 (07:09 +0000)]
MFC r237460:
Return CAM_SEL_TIMEOUT and CAM_DEV_NOT_THERE instead of CAM_TID_INVALID
and CAM_LUN_INVALID for case of missing devices. In removes tons of error
messages from CAM during bus scans.

Reported and tested by: Mike Tancsa <mike@sentex.net>

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

11 years agoMFC r237446:
mav [Mon, 25 Jun 2012 07:06:58 +0000 (07:06 +0000)]
MFC r237446:
Don't print SCSI Queue Full and CAM_REQUEUE_REQ statuses as errors if they
were handled and retried. They are part of normal operation for SCSI TCQ.

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

11 years agoMFC: r237244
rmacklem [Mon, 25 Jun 2012 01:48:18 +0000 (01:48 +0000)]
MFC: r237244
Fix the NFSv4 client for the case where mmap'd files are
written, but not msync'd by a process. A VOP_PUTPAGES()
called when VOP_RECLAIM() happens will usually fail, since
the NFSv4 Open has already been closed by VOP_INACTIVE().
Add a vm_object_page_clean() call to the NFSv4 client's
VOP_INACTIVE(), so that the write happens before the NFSv4
Open is closed. kib@ suggested using vgone() instead and
I will explore this, but this patch fixes things in the
meantime. For some reason, the VOP_PUTPAGES() is still
attaempted in VOP_RECLAIM(), but having this fail doesn't
cause any problems except a "stateid0 in write" being logged.

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

11 years agopartial MFC. Mostly, do not build clang when initializing picobsd
luigi [Sun, 24 Jun 2012 17:02:28 +0000 (17:02 +0000)]
partial MFC. Mostly, do not build clang when initializing picobsd

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

11 years agoMFC: r237200
rmacklem [Sun, 24 Jun 2012 13:39:41 +0000 (13:39 +0000)]
MFC: r237200
Move the nfsrpc_close() call in ncl_reclaim() for the NFSv4 client
to below the vnode_destroy_vobject() call, since that is where
writes are flushed.

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

11 years agoMFC r237225:
mav [Sun, 24 Jun 2012 09:41:27 +0000 (09:41 +0000)]
MFC r237225:
Remove never used CD/DA_FLAG_TAGGED_QUEUING flags.

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

11 years agoMFC r235251:
eadler [Sat, 23 Jun 2012 21:29:53 +0000 (21:29 +0000)]
MFC r235251:
Add Spanish Dvorak keyboard model to syscons.

PR: conf/160235
Approved by: cperciva (implicit)

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

11 years agoMFC: r236829
pfg [Sat, 23 Jun 2012 20:33:29 +0000 (20:33 +0000)]
MFC: r236829

Bring a couple of libstdc++ patches from Apple's llvm-gcc project.

Modified Fri Jul 10 07:44:34 2009 CDT by rafael
backport part of
http://gcc.gnu.org/ml/gcc-cvs/2007-10/msg00118.html

The patch is for libstdc++ and it was GPL2 at the time.

Modified Tue Apr 29 01:20:19 2008 CDT by asl
Backport from mainline (pre-GPLv3).
Fix for sizeof(const void*) > sizeof(unsigned long).

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

11 years agoMake newfs(8) display "super-block backups (for fsck_ffs -b #)" instead
trasz [Sat, 23 Jun 2012 19:46:07 +0000 (19:46 +0000)]
Make newfs(8) display "super-block backups (for fsck_ffs -b #)" instead
of super-block backups (for fsck -b #), since fsck(8) doesn't accept
the "-b" option; only fsck_ffs(8) does.

PR: bin/82720
MFC after: 1 week

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

11 years agoMFC r231992:
eadler [Sat, 23 Jun 2012 19:42:06 +0000 (19:42 +0000)]
MFC r231992:
Remove reference to gsched_as module, which doesn't
actually exist.

Approved by: cperciva (implicit)

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

11 years agoMFC r234846:
trasz [Sat, 23 Jun 2012 19:15:12 +0000 (19:15 +0000)]
MFC r234846:

Improve growfs(8) in a few ways; unfortunately, it's somewhat hard to untangle
them and commit separately.

1. Rewrite the way growfs(8) finds the device and mount point.  This makes
   it possible to use e.g. "growfs /mnt"; it's also used to display more
   helpful messages.

2. Be more user-friendly, using descriptive messages, like this:

   OK to grow filesystem on /dev/md0, mounted on /mnt, from 9.8GB to 20GB? [Yes/No]"

3. Allow to specify the size (-s option) just like with mdconfig(8), i.e. with
   postfixes ("mdconfig -s 10g").4. Reload read-only filesystem after growing.

Reviewed by:    kib, mckusick (earlier version)
Sponsored by:   The FreeBSD Foundation

MFC r235079:

Fix offset calculation to actually rewrite the _last_ block.

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

11 years agoMFC r234189:
trasz [Sat, 23 Jun 2012 19:08:24 +0000 (19:08 +0000)]
MFC r234189:

Style.

MFC r234312:

Remove FSIRAND and FSMAXSWAP ifdefs, removing code unconditionally.

Reviewed by:    kib, mckusick
Sponsored by:   The FreeBSD Foundation

MFC r234314:

Style.

MFC r234420:

Style.

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

11 years agoMFC r234178:
trasz [Sat, 23 Jun 2012 19:03:42 +0000 (19:03 +0000)]
MFC r234178:

Remove block reallocation used to make room for the cylinder group
summary structure.  From now on, when there is no room for it,
we simply allocate new one in a newly added cylinder group.

This patch removes a conditional in updcsloc(), reindents some code
there, and removes unused routines.  I decided to do it this way instead
of disabling reallocation when the filesystem is live and leaving it
as it is otherwise, because this allows for removal of lots of complicated
and hard to test code.  Also, conditionally disabling it would result
in a different layout in filesystems resized online and offline, which
would look somewhat weird.

Reviewed by:            mckusick
No objections from:     kib
Sponsored by:           The FreeBSD Foundation

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

11 years agoMFC r233656:
trasz [Sat, 23 Jun 2012 19:01:42 +0000 (19:01 +0000)]
MFC r233656:

Remove disklabel handling code from growfs.  This should be done
via geom_part(4), and it doesn't belong in growfs anyway.

Reviewed by:    kib, mckusick
Sponsored by:   The FreeBSD Foundation

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

11 years agoMFC r232548:
trasz [Sat, 23 Jun 2012 18:58:02 +0000 (18:58 +0000)]
MFC r232548:

Make growfs(8) mostly style compliant.  No functional changes,
verified with MD5.

MFC r232858:

After r232548, clang complains about the apparent '=-' operator (a
left-over from ancient C times, and a frequent typo) in growfs.c:

sbin/growfs/growfs.c:1550:8: error: use of unary operator that may be intended as compound assignment (-=) [-Werror]
        blkno =- 1;
              ^~

Use 'blkno = -1' instead, to silence the error.

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

11 years agoMFC r230289 by ed@:
trasz [Sat, 23 Jun 2012 18:54:24 +0000 (18:54 +0000)]
MFC r230289 by ed@:

Allow growfs to be built with GCC 4.7 and -Werror.

The dp1 variable is only used when FSIRAND is defined. Just place the
variable behind #ifdefs entirely.

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

11 years agoMFC r227081 by ed@:
trasz [Sat, 23 Jun 2012 18:51:33 +0000 (18:51 +0000)]
MFC r227081 by ed@:

Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.

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

11 years agoMFC: r231620, r237098
marius [Sat, 23 Jun 2012 18:43:11 +0000 (18:43 +0000)]
MFC: r231620, r237098

Enable TLS support for ARM toolchain

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

11 years agoMFC: r231616, r232497, r234337
marius [Sat, 23 Jun 2012 18:39:35 +0000 (18:39 +0000)]
MFC: r231616, r232497, r234337

Add __aeabi_read_tp function required for thread-local storage.

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

11 years agoMFC r234036:
trasz [Sat, 23 Jun 2012 18:26:23 +0000 (18:26 +0000)]
MFC r234036:

Fix panic in ffs_reload(), which may happen when read-only filesystem
gets resized and then reloaded.

MFC r234537:

Fix use-after-free introduced in r234036.

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

11 years agoMFC r235138: Add -a and -A option to the usage.
ume [Sat, 23 Jun 2012 17:59:32 +0000 (17:59 +0000)]
MFC r235138: Add -a and -A option to the usage.

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

11 years agoMFC r237196:
davide [Sat, 23 Jun 2012 17:46:42 +0000 (17:46 +0000)]
MFC r237196:

Disable hwpmc(4) support for Intel Xeon Sandy Bridge (Model 0x2D).
Due to some differences in MSRs between Xeon Sandy Bridge and Core Sandy
Bridge (Model 0x2A), wrmsr() may generate in a GP# fault exception and so a
panic of the machine.

Approved by: gnn (mentor)

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

11 years agoMFC r237195:
davide [Sat, 23 Jun 2012 17:39:40 +0000 (17:39 +0000)]
MFC r237195:

The variable 'error' in sys_poll() is initialized in declaration to value
zero but in any case is overwritten by successive copyin(), making the
previous initialization useless. Remove this.
As an added bonus this fixes a style(9) bug.

Approved by: gnn (mentor)

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

11 years agoMFC r237336:
mav [Sat, 23 Jun 2012 07:48:00 +0000 (07:48 +0000)]
MFC r237336:
Remove unused error variables in cdclose() and daclose().

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

11 years agoMFC r237335:
mav [Sat, 23 Jun 2012 07:45:14 +0000 (07:45 +0000)]
MFC r237335:
Check status of cam_periph_hold() inside cdclose().  If cd device was
invalidated while open, cam_periph_hold() will return error and won't
get the reference.  Following reference release will crash the system.

Sponsored by: iXsystems, Inc.

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