]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 years agoBring back following change which was undone in previous commit:
Craig Rodrigues [Wed, 15 Jun 2011 23:22:35 +0000 (23:22 +0000)]
Bring back following change which was undone in previous commit:

    ------------------------------------------------------------------------
    r172854 | marius | 2007-10-21 10:03:18 -0700 (Sun, 21 Oct 2007) | 16 lines
    Changed paths:
       M /head/lib/libstand/tftp.c

    - Given that we tell the compiler that struct ip is packed and 32-bit
      aligned, GCC 4.2.1 also generates code for sendudp() that assumes
      this alignment. GCC 4.2.1 however doesn't 32-bit align wbuf, causing
      the loader to crash due to an unaligned access of wbuf in sendudp()
      when netbooting sparc64. Solve this by specifying wbuf as packed and
      32-bit aligned, too. As for lastdata and readudp() this currently is
      no issue when compiled with GCC 4.2.1, though give lastdata the same
      treatment as wbuf for consistency and possibility of being affected
      in the future. [1]
    - Sprinkle const on a lookup table.
    ------------------------------------------------------------------------

13 years agoEnsure that filesystem metadata contained within persistent snapshots
Kirk McKusick [Wed, 15 Jun 2011 23:19:09 +0000 (23:19 +0000)]
Ensure that filesystem metadata contained within persistent snapshots
is always kept consistent.

Suggested by: Jeff Roberson

13 years agoDon't include curcpu in the mask which is used as the IPI cookie as we
Marius Strobl [Wed, 15 Jun 2011 22:41:55 +0000 (22:41 +0000)]
Don't include curcpu in the mask which is used as the IPI cookie as we
have to ignore it when sending the IPI anyway. Actually I can't think of
a good reason why this ever was done that way in the first place as it's
not even usefull for debugging.
While at it replace the use of pc_other_cpus as it's slated for deorbit.

13 years agoIncrease WARNS level to 2.
Craig Rodrigues [Wed, 15 Jun 2011 22:15:28 +0000 (22:15 +0000)]
Increase WARNS level to 2.

13 years ago(1) When sending the TFTP RRQ packet to read a file,
Craig Rodrigues [Wed, 15 Jun 2011 22:13:22 +0000 (22:13 +0000)]
(1)  When sending the TFTP RRQ packet to read a file,
     send along the "blksize" option specified in RFC2348,
     and the "tsize" option specified in RFC2349.

     Add code to parse the TFTP Option Acknowledgement (OACK) packet as
     specified in RFC2347.

     For TFTP servers which support the "blksize" option, we can
     specify a TFTP Data block size larger than the default 512 bytes
     specified in RFC1350.  This offers greater read performance when
     downloading files.

     We request an initial size of 1428 bytes, which is less than the
     Ethernet MTU of 1500 bytes.  If the TFTP server sends back an OACK
     packet, then use the block size specified in the OACK packet.
     Most times it is usually the same value as what we request.
     If the TFTP server supports RFC2348, we will see performance improvements
     by transferring files over TFTP with larger block sizes.

     If we do not get back an OACK packet, then we most likely we
     are interoperating with a legacy TFTP server that does not
     support TFTP extension options, so default to the block size of
     512 bytes.

(2)  If the "tftp.blksize" environment variable is set, then
     take that value and use it when sending the TFTP RRQ packet,
     instead of 1428.  This allows us to set different values of
     "tftp.blksize" in the loader, so that we can test out different
     TFTP block sizes at run time.

Obtained from: Juniper Networks
Fixed by:  rodrigc

13 years agoCurrently tftp code in the loader retransmits the previous packet if it receives any
Craig Rodrigues [Wed, 15 Jun 2011 22:08:18 +0000 (22:08 +0000)]
Currently tftp code in the loader retransmits the previous packet if it receives any
unwanted packet(non-tftp). Change this to retransmit the packet(request or ack) only after
a timeout.

Obtained from: Juniper Networks
Fixed by: Santhanakrishnan Balraj <sbalraj at juniper dot net>

13 years agoAdded sendrecv_tftp function instead of sendrecv for use by tftp.
Craig Rodrigues [Wed, 15 Jun 2011 22:04:14 +0000 (22:04 +0000)]
Added sendrecv_tftp function instead of sendrecv for use by tftp.
In sendrecv_tftp:
    * Upon receving an unexpected block of data or error, resend the ACK
      immediately instead of waiting till the expiry of receive data timeout
      to resend the ACK.
    * change the receive timeout value between retries to be 2xMINTMO.

Obtained from: Juniper Networks
Fixed by: Santhanakrishnan Balraj <sbalraj at juniper dot net>

13 years agoIn sendrecv function, change the receive timeout value between retries
Craig Rodrigues [Wed, 15 Jun 2011 21:58:01 +0000 (21:58 +0000)]
In sendrecv function, change the receive timeout  value between retries
to increase in steps of MINTMO, instead of doubling the timeout for every
retry.

Obtained from: Juniper Networks
Fixed by: Santhanakrishnan Balraj <sbalraj at juniper dot net>

13 years agosh: Add support for named character classes in bracket expressions.
Jilles Tjoelker [Wed, 15 Jun 2011 21:48:10 +0000 (21:48 +0000)]
sh: Add support for named character classes in bracket expressions.

Example:
  case x in [[:alpha:]]) echo yes ;; esac

13 years agoHide driver revision behind bootverbose.
Joel Dahl [Wed, 15 Jun 2011 19:53:08 +0000 (19:53 +0000)]
Hide driver revision behind bootverbose.

Approved by: mav

13 years agoEliminate extraneous pipelines and tr calls.
Josh Paetzel [Wed, 15 Jun 2011 19:33:02 +0000 (19:33 +0000)]
Eliminate extraneous pipelines and tr calls.

Approved by: kib (mentor)
MFC after: 3 days

13 years agoAdd -ffreestanding to the command line, so taht inflate.c compiles and link
Olivier Houchard [Wed, 15 Jun 2011 19:15:50 +0000 (19:15 +0000)]
Add -ffreestanding to the command line, so taht inflate.c compiles and link
properly with llvm.

PR: arm/156771
Submitted by: Damjan Marion <damjan dot marion at gmail DOT com>

13 years agoDon't attempt to create the base directory when -d is specified.
Xin LI [Wed, 15 Jun 2011 19:09:58 +0000 (19:09 +0000)]
Don't attempt to create the base directory when -d is specified.

MFC after: 1 month

13 years agoWith the restructuring of the block reclaimation code, the notification
Kirk McKusick [Wed, 15 Jun 2011 18:05:08 +0000 (18:05 +0000)]
With the restructuring of the block reclaimation code, the notification
messages for a filesystem being out of space need to be moved so that
they do not print out until after a failed cleanup attempt.

Suggested by: Jeff Roberson

13 years agoRevert changes to this file in r222417. This unconditionally enabled the
Nathan Whitehorn [Wed, 15 Jun 2011 14:07:16 +0000 (14:07 +0000)]
Revert changes to this file in r222417. This unconditionally enabled the
boot menu on all platforms, which breaks loader completely on at least
powerpc for reasons that are not understood yet.

Reviewed by: Devin Teske

13 years agoMissing cleanup case after completion of a snapshot vnode write
Kirk McKusick [Wed, 15 Jun 2011 06:13:08 +0000 (06:13 +0000)]
Missing cleanup case after completion of a snapshot vnode write
claiming a released block.

Submitted by: Jeff Roberson
Tested by: Peter Holm

13 years agosys/kern/subr_kdb.c:
Justin T. Gibbs [Tue, 14 Jun 2011 21:37:25 +0000 (21:37 +0000)]
sys/kern/subr_kdb.c:
Modify the "alternate break sequence" detecting state
machine so that only a contiguous invocation of the
break sequence is accepted.  The old implementation
did not reset the state machine when detecting an
unexpected character.

While here, use an enum for the states of the machine
instead of magic numbers.bmitted by:

Sponsored by: Spectra Logic Corporation

13 years agoEnable USB 3.0 support by default in i386 and amd64 GENERIC kernels.
Hans Petter Selasky [Tue, 14 Jun 2011 20:30:49 +0000 (20:30 +0000)]
Enable USB 3.0 support by default in i386 and amd64 GENERIC kernels.

Discussed with: joel @ and thompsa @
MFC after: 7 days

13 years agoSkip BAR(5) usage for SATA registers access on ICH8M Apples, because for
Alexander Motin [Tue, 14 Jun 2011 20:30:15 +0000 (20:30 +0000)]
Skip BAR(5) usage for SATA registers access on ICH8M Apples, because for
some reason it causes system lock up. Linux does the same.

MFC after: 1 week

13 years agoAdd location and pnpinfo strings for puc device ports. The location is
John Baldwin [Tue, 14 Jun 2011 18:19:48 +0000 (18:19 +0000)]
Add location and pnpinfo strings for puc device ports.  The location is
announced during boot and contains the port number.  The pnpinfo string
lists the port type (PUC_TYPE_* constants).

Tested by: Boris Samorodov  bsam ipt ru
MFC after: 1 week

13 years agoReviewed by: gabor (mentor)
Stephen Montgomery-Smith [Tue, 14 Jun 2011 17:51:46 +0000 (17:51 +0000)]
Reviewed by: gabor (mentor)
Approved by: gabor (mentor)

13 years agoPlumb device physical path reporting from CAM devices, through GEOM and
Justin T. Gibbs [Tue, 14 Jun 2011 17:10:32 +0000 (17:10 +0000)]
Plumb device physical path reporting from CAM devices, through GEOM and
DEVFS, and make it accessible via the diskinfo utility.

Extend GEOM's generic attribute query mechanism into generic disk consumers.
sys/geom/geom_disk.c:
sys/geom/geom_disk.h:
sys/cam/scsi/scsi_da.c:
sys/cam/ata/ata_da.c:
- Allow disk providers to implement a new method which can override
  the default BIO_GETATTR response, d_getattr(struct bio *).  This
  function returns -1 if not handled, otherwise it returns 0 or an
  errno to be passed to g_io_deliver().

sys/cam/scsi/scsi_da.c:
sys/cam/ata/ata_da.c:
- Don't copy the serial number to dp->d_ident anymore, as the CAM XPT
  is now responsible for returning this information via
  d_getattr()->(a)dagetattr()->xpt_getatr().

sys/geom/geom_dev.c:
- Implement a new ioctl, DIOCGPHYSPATH, which returns the GEOM
  attribute "GEOM::physpath", if possible.  If the attribute request
  returns a zero-length string, ENOENT is returned.

usr.sbin/diskinfo/diskinfo.c:
- If the DIOCGPHYSPATH ioctl is successful, report physical path
  data when diskinfo is executed with the '-v' option.

Submitted by: will
Reviewed by: gibbs
Sponsored by: Spectra Logic Corporation

Add generic attribute change notification support to GEOM.

sys/sys/geom/geom.h:
Add a new attrchanged method field to both g_class
and g_geom.

sys/sys/geom/geom.h:
sys/geom/geom_event.c:
- Provide the g_attr_changed() function that providers
  can use to advertise attribute changes.
- Perform delivery of attribute change notifications
  from a thread context via the standard GEOM event
  mechanism.

sys/geom/geom_subr.c:
Inherit the attrchanged method from class to geom (class instance).

sys/geom/geom_disk.c:
Provide disk_attr_changed() to provide g_attr_changed() access
to consumers of the disk API.

sys/cam/scsi/scsi_pass.c:
sys/cam/scsi/scsi_da.c:
sys/geom/geom_dev.c:
sys/geom/geom_disk.c:
Use attribute changed events to track updates to physical path
information.

sys/cam/scsi/scsi_da.c:
Add AC_ADVINFO_CHANGED to the registered asynchronous CAM
events for this driver.  When this event occurs, and
the updated buffer type references our physical path
attribute, emit a GEOM attribute changed event via the
disk_attr_changed() API.

sys/cam/scsi/scsi_pass.c:
Add AC_ADVINFO_CHANGED to the registered asynchronous CAM
events for this driver.  When this event occurs, update
the physical patch devfs alias for this pass instance.

Submitted by: gibbs
Sponsored by: Spectra Logic Corporation

13 years agoWe should not return ECHILD when debugging a child and the parent does a
David E. O'Brien [Tue, 14 Jun 2011 17:09:30 +0000 (17:09 +0000)]
We should not return ECHILD when debugging a child and the parent does a
"wait4(-1, ..., WNOHANG, ...)".  Instead wait(2) should behave as if the
child does not wish to report status at this time.

Reviewed by: jhb

13 years agoAdd "gid" and "group" keywords to display the effective group ID
Edward Tomasz Napierala [Tue, 14 Jun 2011 16:50:16 +0000 (16:50 +0000)]
Add "gid" and "group" keywords to display the effective group ID
and effective group name.  Also, add "egid", "egroup" and "euid" aliases.

PR: bin/146331
Submitted by: Jeremie Le Hen <jeremie at le-hen dot org>

13 years agosys/sys/conf.h:
Justin T. Gibbs [Tue, 14 Jun 2011 16:29:43 +0000 (16:29 +0000)]
sys/sys/conf.h:
sys/kern/kern_conf.c:
Add make_dev_physpath_alias().  This interface takes
the parent cdev of the alias, an old alias cdev (if any)
to replace with the newly created alias, and the physical
path string.  The alias is visiable as a symlink to the
parent, with the same name as the parent, rooted at
physpath in devfs.

Note: make_dev_physpath_alias() has hard coded knowledge of the
      Solaris style prefix convention for physical path data,
      "id1,".  In the future, I expect the convention to change
      to allow "physical path quality" to be reported in the
      prefix.  For example, a physical path based on NewBus
      topology would be of "lower quality" than a physical path
      reported by a device enclosure.

Sponsored by: Spectra Logic Corporation

13 years agosys/cam/scsi/scsi_da.c:
Justin T. Gibbs [Tue, 14 Jun 2011 16:05:00 +0000 (16:05 +0000)]
sys/cam/scsi/scsi_da.c:
- Only attempt the closing synchronize cache on a disk
  if it is still there.
- When a device is lost, report the number of outstanding
  I/Os as they are drained.
- When a device is lost, return any unprocessed bios with
  ENXIO instead of EIO.
- Filter asynchronous events, but always allow cam_periph_async()
  to see them too.

Sponsored by: Spectra Logic Corporation

13 years ago- Check on target wordsize instead of compile time define if we build on
Andreas Tobler [Tue, 14 Jun 2011 15:20:30 +0000 (15:20 +0000)]
- Check on target wordsize instead of compile time define if we build on
  64-bit PowerPC or 32-bit PowerPC.
- Make gdb work on powerpc64, the code for this is obtained from
  ppc-linux-tdep.c.
- Remove non-elf core read functionality. Implement core read functionality
  similar like other FreeBSD targets.
- Set long double limitations.

13 years agoLay groundwork in CAM for recording and reporting physical path and
Justin T. Gibbs [Tue, 14 Jun 2011 14:53:17 +0000 (14:53 +0000)]
Lay groundwork in CAM for recording and reporting physical path and
other device attributes stored in the CAM Existing Device Table (EDT).
This includes some infrastructure requried by the enclosure services
driver to export physical path information.

Make the CAM device advanced info interface accept store requests.

  sys/cam/scsi/scsi_all.c:
  sys/cam/scsi/scsi_all.h:
- Replace scsi_get_sas_addr() with a scsi_get_devid() which takes
  a callback that decides whether to accept a particular descriptor.
  Provide callbacks for NAA IEEE Registered addresses and for SAS
  addresses, replacing the old function.  This is needed because
  the old function doesn't work for an enclosure address for a SAS
  device, which is not flagged as a SAS address, but is NAA IEEE
  Registered.  It may be worthwhile merging this interface with the
  devid match interface.
- Add a few more defines for some device ID fields.

  sbin/camcontrol/camcontrol.c:
- Update for the CCB_DEV_ADVINFO interface change.

  cam/cam_xpt_internal.h:
- Add the new fields for the physical path string to the CAM EDT.
  cam/cam_ccb.h:
- Rename CCB_GDEV_ADVINFO to simply CCB_DEV_ADVINFO, and the ccb
  structure to ccb_dev_advinfo.
- Add a flag that changes this CCB's action to store, rather than
  the default, retrieve.
- Add a new buffer type, CDAI_TYPE_PHYS_PATH, for the new CAM EDT
  physpath field.
- Remove the never-implemented transport & proto flags.
  cam/cam_xpt.c:
  cam/cam_xpt.h:
- Add xpt_getattr(), which provides a wrapper for fetching a device's
  attribute using the GEOM strings as key.  This method currently
  supports "GEOM::ident" and "GEOM::physpath".

Submitted by: will
Reviewed by : gibbs

Extend the XPT_DEV_MATCH api to allow a device search by device ID.
As far as the API is concerned, device ID is a binary blob to be
interpreted by the transport layer.  The SCSI implementation assumes
it is an array of VPD device ID descriptors.

  sys/cam/cam_ccb.h:
Create a new structure, device_id_match_pattern, and
update the XPT_DEV_MATCH datastructures and flags so
that this pattern type can be used.

  sys/cam/cam_xpt.c:
- A single pattern matching on both inquiry data and device
  ID is invalid.  Report any violators.
- Pass device ID match requests through to the new routine
  scsi_devid_match().  The direct call of a SCSI routine is
  a layering violation, but no worse than the one a few
  lines up that checks inquiry data.  Defer cleaning this
  up until our future, larger, rototilling of CAM.
- Zero out cam_ed and cam_et nodes on allocation.  Prior to
  this change, device_id_len and device_id were not inialized,
  preventing proper detection of the presence of this
  information.

  sys/cam/scsi/scsi_all.c:
  sys/cam/scsi/scsi_all.h:
Add the scsi_match_devid() routine.

Add a helper function for extracting peripherial driver names

  sys/cam/cam_periph.c:
  sys/cam/cam_periph.h:
Add the cam_periph_list() method which fills an sbuf
with a comma delimited list of the peripheral instances
associated with a given CAM path.

Add a helper functions for SCSI commands used by the SES driver.

  sys/cam/scsi/scsi_all.c:
  sys/cam/scsi/scsi_all.h:
Add structure definitions and csio filling functions for
the receive diagnostic results and send diagnostic commands.

Misc CAM XPT cleanups.

  sys/cam/cam_xpt.c:
Broadcast AC_FOUND_DEVICE and AC_PATH_REGISTERED
events at the time async event handlers are attached
even when registering just for events on a partitular
SIM.  Previously, you had to register for these
events on all SIMs in the system in order to get
the initial broadcast even though subsequent device
and path arrivals would be delivered.

  sys/cam/cam_xpt.c:
Remove SIM mutex held asserts from path accessors.
CAM paths are reference counted and it is this
reference count, not the sim mutex, that garantees
they are stable.

Sponsored by: Spectra Logic Corporation

13 years agoImplement "global" mode for ipfw nat. It is similar to natd(8)
Andrey V. Elsukov [Tue, 14 Jun 2011 13:35:24 +0000 (13:35 +0000)]
Implement "global" mode for ipfw nat. It is similar to natd(8)
"globalport" option for multiple NAT instances.

If ipfw rule contains "global" keyword instead of nat_number, then
for each outgoing packet ipfw_nat looks up translation state in all
configured nat instances. If an entry is found, packet aliased
according to that entry, otherwise packet is passed unchanged.

User can specify "skip_global" option in NAT configuration to exclude
an instance from the lookup in global mode.

PR: kern/157867
Submitted by: Alexander V. Chernikov (previous version)
Tested by: Eugene Grosbein

13 years agoCheck nat id a bit more strictly.
Andrey V. Elsukov [Tue, 14 Jun 2011 13:02:26 +0000 (13:02 +0000)]
Check nat id a bit more strictly.

13 years agoGrab one of the ifcap bits for netmap, and enable printing in ifconfig.
Luigi Rizzo [Tue, 14 Jun 2011 12:40:55 +0000 (12:40 +0000)]
Grab one of the ifcap bits for netmap, and enable printing in ifconfig.

Document the fact that we might want an IFCAP_CANTCHANGE mask,
even though the value is not yet used in sys/net/if.c

(asked on -current a week ago, no feedback so i assume no objection).

13 years agoSort alias mode flags in the increasing order.
Andrey V. Elsukov [Tue, 14 Jun 2011 12:06:38 +0000 (12:06 +0000)]
Sort alias mode flags in the increasing order.

13 years agoAdd IPv6 support to the ipfw uid/gid check. Pass an ip_fw_args structure
Andrey V. Elsukov [Tue, 14 Jun 2011 07:20:16 +0000 (07:20 +0000)]
Add IPv6 support to the ipfw uid/gid check. Pass an ip_fw_args structure
to the check_uidgid() function, since it contains all needed arguments
and also pointer to mbuf and now it is possible use in_pcblookup_mbuf()
function.

Since i can not test it for the non-FreeBSD case, i keep this ifdef
unchanged.

Tested by: Alexander V. Chernikov
MFC after: 3 weeks

13 years agosendmail has been updated to 8.14.5
Gregory Neil Shapiro [Tue, 14 Jun 2011 06:45:48 +0000 (06:45 +0000)]
sendmail has been updated to 8.14.5

13 years agoUpdate notes regarding FreeBSD import
Gregory Neil Shapiro [Tue, 14 Jun 2011 06:44:42 +0000 (06:44 +0000)]
Update notes regarding FreeBSD import

13 years agoMinor change to force commit this file so new freebsd*.cf files are
Gregory Neil Shapiro [Tue, 14 Jun 2011 04:34:20 +0000 (04:34 +0000)]
Minor change to force commit this file so new freebsd*.cf files are
built to use the new sendmail-8.14.5/cf tree.

MFC after: 4 days

13 years agoUpdate DNSBL information (MAPS has been acquired, used a generic example)
Gregory Neil Shapiro [Tue, 14 Jun 2011 04:33:43 +0000 (04:33 +0000)]
Update DNSBL information (MAPS has been acquired, used a generic example)

13 years agoMerge sendmail 8.14.5 to HEAD
Gregory Neil Shapiro [Tue, 14 Jun 2011 04:20:18 +0000 (04:20 +0000)]
Merge sendmail 8.14.5 to HEAD

MFC after: 4 days

13 years agoImport errata patch as published at http://www.sendmail.com/sm/open_source/download...
Gregory Neil Shapiro [Tue, 14 Jun 2011 03:59:08 +0000 (03:59 +0000)]
Import errata patch as published at http://www.sendmail.com/sm/open_source/download/8.14.5/

13 years agoImport sendmail 8.14.5
Gregory Neil Shapiro [Tue, 14 Jun 2011 03:55:17 +0000 (03:55 +0000)]
Import sendmail 8.14.5

13 years agoInstead of using an atomic operation to determine whether the devstat(9)
Kenneth D. Merry [Mon, 13 Jun 2011 22:08:24 +0000 (22:08 +0000)]
Instead of using an atomic operation to determine whether the devstat(9)
device node has been created, pass MAKEDEV_CHECKNAME in so that the devfs
code will do the check.

Use a regular static variable as before, that's good enough to keep us from
calling into devfs most of the time.

Suggested by: kib
MFC after: 1 week
Sponsored by: Spectra Logic Corporation

13 years agoFix a couple of race conditions in devstat(9) initialization.
Justin T. Gibbs [Mon, 13 Jun 2011 21:21:02 +0000 (21:21 +0000)]
Fix a couple of race conditions in devstat(9) initialization.

In devstat_new_entry(), there is no need to initialize the queue
and the mutex in this function.  There are ways to do static
initialization on both, so use STAILQ_HEAD_INITIALIZER and
MTX_SYSINIT to initialize the queue and the mutex.

In devstat_alloc(), use an atomic test and set routine to guard
making our entry in /dev.  Using just a plain static variable
creates a race condition on multiprocessor machines.  If you
attempt to create a second entry in devfs, the kernel will panic.

Submitted by: kdm
Reviewed by: gibbs
Sponsored by: Spectra Logic Corporation
MFC after: 1 week.

13 years agosh: Fix duplicate prototypes for builtins.
Jilles Tjoelker [Mon, 13 Jun 2011 21:03:27 +0000 (21:03 +0000)]
sh: Fix duplicate prototypes for builtins.

Have mkbuiltins write the prototypes for the *cmd functions to builtins.h
instead of builtins.c and include builtins.h in more .c files instead of
duplicating prototypes for *cmd functions in other headers.

13 years agoSeveral enhancements to the Xen block back driver.
Justin T. Gibbs [Mon, 13 Jun 2011 20:36:29 +0000 (20:36 +0000)]
Several enhancements to the Xen block back driver.

sys/dev/xen/blkback/blkback.c:
o Implement front-end request coalescing.  This greatly improves the
  performance of front-end clients that are unaware of the dynamic
  request-size/number of requests negotiation available in the
  FreeBSD backend driver.  This required a large restructuring
  in how this driver records in-flight transactions and how those
  transactions are mapped into kernel KVA.  For example, the driver
  now includes a mini "KVA manager" that allocates ranges of
  contiguous KVA to patches of requests that are physically
  contiguous in the backing store so that a single bio or UIO
  segment can be used to represent the I/O.

o Refuse to open any backend files or devices if the system
  has yet to mount root.  This avoids a panic.

o Properly handle "onlined" devices.  An "onlined" backend
  device stays attached to its backing store across front-end
  disconnections.  This feature is intended to reduce latency
  when a front-end does a hand-off to another driver (e.g.
  PV aware bootloader to OS kernel) or during a VM reboot.

o Harden the driver against a pathological/buggy front-end
  by carefully vetting front-end XenStore data such as the
  front-end state.

o Add sysctls that report the negotiated number of
  segments per-request and the number of requests that
  can be concurrently in flight.

Submitted by: kdm
Reviewed by: gibbs
Sponsored by: Spectra Logic Corporation
MFC after: 1 week

13 years agoAdd bunch of Conexant codec IDs. For some of them add quirks to disable
Alexander Motin [Mon, 13 Jun 2011 20:34:12 +0000 (20:34 +0000)]
Add bunch of Conexant codec IDs. For some of them add quirks to disable
excessive signal paths to simplify tracer's life.

13 years agoAdd a new option -P to suppress getservbyport(3) calls when printing rules.
Bjoern A. Zeeb [Mon, 13 Jun 2011 20:11:28 +0000 (20:11 +0000)]
Add a new option -P to suppress getservbyport(3) calls when printing rules.
This allows one to force consistent printing of numeric port numbers like
we do with -n for other tools like netstat (just that -n was already taken)
rather than the service names.

-P is currently unused in OpenBSD so the change is eligible for upstreaming.

PR: misc/151015
Submitted by: Matt Koivisto (mkoivisto sandvine.com)
Sponsored by: Sandvine Incorporated
MFC after: 1 week

13 years agoConvert the allowed characters '-', '.', and ':' in a ZFS pool name to _
Josh Paetzel [Mon, 13 Jun 2011 19:45:01 +0000 (19:45 +0000)]
Convert the allowed characters '-', '.', and ':' in a ZFS pool name to _
to avoid causing errors in the shell script.

Submitted by: William Grzybowski <william88@gmail.com>
Approved by: kib (mentor)
MFC after: 7 days
Sponsored by: iXsystems

13 years agoUse alternative, less messy solution to avoid breakage after r223020:
Dimitry Andric [Mon, 13 Jun 2011 16:05:41 +0000 (16:05 +0000)]
Use alternative, less messy solution to avoid breakage after r223020:
put the snapdata structure between #ifdef _KERNEL guards.

Suggested by: kib

13 years agoAdvance the advertised window (rcv_adv) to the currently received data
John Baldwin [Mon, 13 Jun 2011 15:38:31 +0000 (15:38 +0000)]
Advance the advertised window (rcv_adv) to the currently received data
(rcv_nxt) if we advertising a zero window.  This can be true when ACK'ing
a window probe whose one byte payload was accepted rather than dropped
because the socket's receive buffer was not completely full, but the
remaining space was smaller than the window scale.

This ensures that window probe ACKs satisfy the assumption made in r221346
and closes a window where rcv_nxt could be greater than rcv_adv.

Tested by: trasz, pho, trociny
Reviewed by: silby
MFC after: 1 week

13 years ago- Reduce diffs against i386.
Yoshihiro Takahashi [Mon, 13 Jun 2011 13:24:33 +0000 (13:24 +0000)]
- Reduce diffs against i386.
- Add snd_uaudio.

13 years ago- Merge r222980 from x86: add sound(4) and common device drivers.
Marius Strobl [Mon, 13 Jun 2011 12:45:19 +0000 (12:45 +0000)]
- Merge r222980 from x86: add sound(4) and common device drivers.
- Fix whitespace.

13 years agoUsing statfs.f_fstypename rather than statfs.f_type whilst performing fstype
Tai-hwa Liang [Mon, 13 Jun 2011 05:22:07 +0000 (05:22 +0000)]
Using statfs.f_fstypename rather than statfs.f_type whilst performing fstype
comparsion as nullfs will copy f_type from underlayer FS.

PR: bin/156258
Submitted by: Marcin Wisnicki <mwisnicki+freebsd@gmail.com>
MFC after: 1 month

13 years agoFix ath_ahb(4) bus attach and eeprom error handling.
Adrian Chadd [Mon, 13 Jun 2011 04:31:57 +0000 (04:31 +0000)]
Fix ath_ahb(4) bus attach and eeprom error handling.

Submitted by: Luiz Otavio O Souza <loos.br@gmail.com>

13 years agoApparently makefs needs a few more system headers to compile during
Dimitry Andric [Mon, 13 Jun 2011 01:04:00 +0000 (01:04 +0000)]
Apparently makefs needs a few more system headers to compile during
buildworld.

13 years agoUse swap32() right.
Xin LI [Sun, 12 Jun 2011 23:33:08 +0000 (23:33 +0000)]
Use swap32() right.

Submitted by: gcopper
MFC after: 2 weeks

13 years agoUnbreak usr.sbin/makefs after r223020.
Dimitry Andric [Sun, 12 Jun 2011 23:09:00 +0000 (23:09 +0000)]
Unbreak usr.sbin/makefs after r223020.

Pointy hat to: mckusick

13 years agosh: Save/restore changed variables in optimized command substitution.
Jilles Tjoelker [Sun, 12 Jun 2011 23:06:04 +0000 (23:06 +0000)]
sh: Save/restore changed variables in optimized command substitution.

In optimized command substitution, save and restore any variables changed by
expansions (${var=value} and $((var=assigned))), instead of trying to
determine if an expansion may cause such changes.

If $! is referenced in optimized command substitution, do not cause jobs to
be remembered longer.

This fixes $(jobs $!) again, simplifies the man page and shortens the code.

13 years agoUpdate to soft updates journaling to properly track freed blocks
Kirk McKusick [Sun, 12 Jun 2011 19:27:05 +0000 (19:27 +0000)]
Update to soft updates journaling to properly track freed blocks
that get claimed by snapshots.

Submitted by: Jeff Roberson
Tested by: Peter Holm

13 years agoDo not report CFA devices as ATAPI, even though IDENTIFY data look alike.
Alexander Motin [Sun, 12 Jun 2011 18:52:39 +0000 (18:52 +0000)]
Do not report CFA devices as ATAPI, even though IDENTIFY data look alike.

13 years agoDisable the soft updates journaling after a filesystem is successfully
Kirk McKusick [Sun, 12 Jun 2011 18:46:48 +0000 (18:46 +0000)]
Disable the soft updates journaling after a filesystem is successfully
downgraded to read-only. It will be restarted if the filesystem is
upgraded back to read-write.

13 years agoUpgrade our copy of llvm/clang to r132879, from upstream's trunk.
Dimitry Andric [Sun, 12 Jun 2011 18:01:31 +0000 (18:01 +0000)]
Upgrade our copy of llvm/clang to r132879, from upstream's trunk.

13 years agoVendor import of llvm trunk r132879:
Dimitry Andric [Sun, 12 Jun 2011 15:42:51 +0000 (15:42 +0000)]
Vendor import of llvm trunk r132879:
http://llvm.org/svn/llvm-project/llvm/trunk@132879

13 years agoI forgot what year it is, apparently.
Nathan Whitehorn [Sun, 12 Jun 2011 15:19:38 +0000 (15:19 +0000)]
I forgot what year it is, apparently.

Submitted by: brucec

13 years agosh: Add test for LC_COLLATE-based character ranges in case.
Jilles Tjoelker [Sun, 12 Jun 2011 12:55:46 +0000 (12:55 +0000)]
sh: Add test for LC_COLLATE-based character ranges in case.

13 years agosh: Fix locale-dependent ranges in bracket expressions.
Jilles Tjoelker [Sun, 12 Jun 2011 12:54:52 +0000 (12:54 +0000)]
sh: Fix locale-dependent ranges in bracket expressions.

When I added UTF-8 support in r221646, the LC_COLLATE-based ordering broke
because of sign extension of char.

Because of libc restrictions, this does not work for UTF-8. For UTF-8
locales, ranges always use character code order.

13 years ago- Use REG_NOSUB to bypass submatch counting when not necessary. This may
Gabor Kovesdan [Sun, 12 Jun 2011 12:51:58 +0000 (12:51 +0000)]
- Use REG_NOSUB to bypass submatch counting when not necessary. This may
  yield in somewhat better performance in a few cases.

Approved by: delphij (mentor)

13 years ago- Fix -w behavior
Gabor Kovesdan [Sun, 12 Jun 2011 12:44:02 +0000 (12:44 +0000)]
- Fix -w behavior
- Make -F and -w work together
- Fix --color to colorize all of the matches

PR: bin/156826
Submitted by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: delphij (mentor)

13 years agosh: Add test for case pattern matching with iso-8859-1 charset.
Jilles Tjoelker [Sun, 12 Jun 2011 12:27:17 +0000 (12:27 +0000)]
sh: Add test for case pattern matching with iso-8859-1 charset.

This also passes on stable/8.

13 years agosh: Read .profile from the home directory (or / if HOME is not set).
Jilles Tjoelker [Sun, 12 Jun 2011 10:13:48 +0000 (10:13 +0000)]
sh: Read .profile from the home directory (or / if HOME is not set).

In most cases, login shells are started from the home directory, but not in
all, such as xterm -ls.

This commit depends on r222957 for read_profile() performing parameter
expansion.

PR: bin/50569

13 years agoAdd an MBR to our release media to aid booting some IBM systems.
Nathan Whitehorn [Sun, 12 Jun 2011 00:14:57 +0000 (00:14 +0000)]
Add an MBR to our release media to aid booting some IBM systems.

13 years agoLong-overdue man page for bsdinstall.
Nathan Whitehorn [Sat, 11 Jun 2011 21:44:07 +0000 (21:44 +0000)]
Long-overdue man page for bsdinstall.

13 years ago- Remove $ipv6_gateway_enable check.
Hiroki Sato [Sat, 11 Jun 2011 21:41:44 +0000 (21:41 +0000)]
- Remove $ipv6_gateway_enable check.
- Use list_net_interfaces() instead of "ifconfig -l".

13 years agoAdd a helper function to check kern.features.* sysctls.
Hiroki Sato [Sat, 11 Jun 2011 21:40:37 +0000 (21:40 +0000)]
Add a helper function to check kern.features.* sysctls.

Discussed with: dougb

13 years agoAdd self
Chris Rees [Sat, 11 Jun 2011 21:27:14 +0000 (21:27 +0000)]
Add self

Approved by: rene (mentor)

13 years agoAdd self to calendar
Chris Rees [Sat, 11 Jun 2011 21:26:12 +0000 (21:26 +0000)]
Add self to calendar

Approved by: rene (mentor)

13 years agoMake three one line changes to the rc scripts so that
Rick Macklem [Sat, 11 Jun 2011 21:14:22 +0000 (21:14 +0000)]
Make three one line changes to the rc scripts so that
they work with the new NFS client being the default,
since the new NFS client's module name is nfscl and
not nfsclient.

13 years agoAssert that page is VPO_BUSY or page owner object is locked in
Konstantin Belousov [Sat, 11 Jun 2011 20:15:19 +0000 (20:15 +0000)]
Assert that page is VPO_BUSY or page owner object is locked in
vm_page_undirty(). The assert is not precise due to VPO_BUSY owner
to tracked, so assertion does not catch the case when VPO_BUSY is
owned by other thread.

Reviewed by: alc

13 years agoFix a bug in r222586. Lock the page owner object around the modification
Konstantin Belousov [Sat, 11 Jun 2011 20:13:28 +0000 (20:13 +0000)]
Fix a bug in r222586. Lock the page owner object around the modification
of the m->dirty.

Reported and tested by: nwhitehorn
Reviewed by: alc

13 years agoFollow up r222980 on PowerPC: add sound(4) and common device drivers
Nathan Whitehorn [Sat, 11 Jun 2011 12:34:08 +0000 (12:34 +0000)]
Follow up r222980 on PowerPC: add sound(4) and common device drivers
to PowerPC GENERIC (along with a small rearrangement).

13 years agoEnable sound support by default on i386 and amd64.
Joel Dahl [Sat, 11 Jun 2011 09:08:46 +0000 (09:08 +0000)]
Enable sound support by default on i386 and amd64.

The generic sound driver has been added, along with enough
device-specific drivers to support the most common audio
chipsets.

We've discussed enabling it from time to time over the years
and we've received numerous requests from users, so we decided
that shipping 9.0 with working audio by default would be the
best thing to do.

Bug reports should be sent to the multimedia@ mailing list, as
usual.

Approved by:    mav
No objection:   re

13 years agoMonitor and emit events for XenStore changes to XenBus trees
Justin T. Gibbs [Sat, 11 Jun 2011 04:59:01 +0000 (04:59 +0000)]
Monitor and emit events for XenStore changes to XenBus trees
of the devices we manage.  These changes can be due to writes
we make ourselves or due to changes made by the control domain.
The goal of these changes is to insure that all state transitions
can be detected regardless of their source and to allow common
device policies (e.g. "onlined" backend devices) to be centralized
in the XenBus bus code.

sys/xen/xenbus/xenbusvar.h:
sys/xen/xenbus/xenbus.c:
sys/xen/xenbus/xenbus_if.m:
Add a new method for XenBus drivers "localend_changed".
This method is invoked whenever a write is detected to
a device's XenBus tree.  The default implementation of
this method is a no-op.

sys/xen/xenbus/xenbus_if.m:
sys/dev/xen/netfront/netfront.c:
sys/dev/xen/blkfront/blkfront.c:
sys/dev/xen/blkback/blkback.c:
Change the signature of the "otherend_changed" method.
This notification cannot fail, so it should return void.

sys/xen/xenbus/xenbusb_back.c:
Add "online" device handling to the XenBus Back Bus
support code.  An online backend device remains active
after a front-end detaches as a reconnect is expected
to occur in the near future.

sys/xen/interface/io/xenbus.h:
Add comment block further explaining the meaning and
driver responsibilities associated with the XenBus
Closed state.

sys/xen/xenbus/xenbusb.c:
sys/xen/xenbus/xenbusb.h:
sys/xen/xenbus/xenbusb_back.c:
sys/xen/xenbus/xenbusb_front.c:
sys/xen/xenbus/xenbusb_if.m:
o Register a XenStore watch against the local XenBus tree
  for all devices.
o Cache the string length of the path to our local tree.
o Allow the xenbus front and back drivers to hook/filter both
  local and otherend watch processing.
o Update the device ivar version of "state" when we detect
  a XenStore update of that node.

sys/dev/xen/control/control.c:
sys/xen/xenbus/xenbus.c:
sys/xen/xenbus/xenbusb.c:
sys/xen/xenbus/xenbusb.h:
sys/xen/xenbus/xenbusvar.h:
sys/xen/xenstore/xenstorevar.h:
Allow clients of the XenStore watch mechanism to attach
a single uintptr_t worth of client data to the watch.
This removes the need to carefully place client watch
data within enclosing objects so that a cast or offsetof
calculation can be used to convert from watch to enclosing
object.

Sponsored by: Spectra Logic Corporation
MFC after: 1 week

13 years agoAdd "context" subcommand to fetch and display SGE context.
Navdeep Parhar [Sat, 11 Jun 2011 04:55:15 +0000 (04:55 +0000)]
Add "context" subcommand to fetch and display SGE context.

13 years ago- driver ioctl to get SGE context for any given queue.
Navdeep Parhar [Sat, 11 Jun 2011 04:50:54 +0000 (04:50 +0000)]
- driver ioctl to get SGE context for any given queue.
- sysctls to display the context id, cidx, and pidx of all kinds of queues.

MFC after: 3 days

13 years agoSupport SIGHUP for reloading /etc/rtadvd.conf.
Hiroki Sato [Sat, 11 Jun 2011 03:25:10 +0000 (03:25 +0000)]
Support SIGHUP for reloading /etc/rtadvd.conf.

13 years agoAdd the model number for the Montvale processor (marketed as Itanium 2 9100).
Marcel Moolenaar [Sat, 11 Jun 2011 02:22:11 +0000 (02:22 +0000)]
Add the model number for the Montvale processor (marketed as Itanium 2 9100).
At this time we're missing just one: Tukwila (Itanium 2 9300).

13 years agoAdd comments about the validation.
Xin LI [Sat, 11 Jun 2011 01:19:19 +0000 (01:19 +0000)]
Add comments about the validation.

13 years agoImplement fully asynchronous partial truncation with softupdates journaling
Jeff Roberson [Fri, 10 Jun 2011 22:48:35 +0000 (22:48 +0000)]
Implement fully asynchronous partial truncation with softupdates journaling
to resolve errors which can cause corruption on recovery with the old
synchronous mechanism.

 - Append partial truncation freework structures to indirdeps while
   truncation is proceeding.  These prevent new block pointers from
   becoming valid until truncation completes and serialize truncations.
 - On completion of a partial truncate journal work waits for zeroed
   pointers to hit indirects.
 - softdep_journal_freeblocks() handles last frag allocation and last
   block zeroing.
 - vtruncbuf/ffs_page_remove moved into softdep_*_freeblocks() so it
   is only implemented in one place.
 - Block allocation failure handling moved up one level so it does not
   proceed with buf locks held.  This permits us to do more extensive
   reclaims when filesystem space is exhausted.
 - softdep_sync_metadata() is broken into two parts, the first executes
   once at the start of ffs_syncvnode() and flushes truncations and
   inode dependencies.  The second is called on each locked buf.  This
   eliminates excessive looping and rollbacks.
 - Improve the mechanism in process_worklist_item() that handles
   acquiring vnode locks for handle_workitem_remove() so that it works
   more generally and does not loop excessively over the same worklist
   items on each call.
 - Don't corrupt directories by zeroing the tail in fsck.  This is only
   done for regular files.
 - Push a fsync complete record for files that need it so the checker
   knows a truncation in the journal is no longer valid.

Discussed with: mckusick, kib (ffs_pages_remove and ffs_truncate parts)
Tested by: pho

13 years agosh: Do parameter expansion on ENV before using it.
Jilles Tjoelker [Fri, 10 Jun 2011 22:42:00 +0000 (22:42 +0000)]
sh: Do parameter expansion on ENV before using it.

This is required by POSIX, and allows things like ENV=\$HOME/.shrc.

Note that tilde expansion is explicitly not performed.

13 years ago - Eliminate an incorrect include path from the mthca build.
Jeff Roberson [Fri, 10 Jun 2011 22:38:31 +0000 (22:38 +0000)]
 - Eliminate an incorrect include path from the mthca build.

13 years ago - Add support for referencing quota structures without needing the inode
Jeff Roberson [Fri, 10 Jun 2011 22:19:44 +0000 (22:19 +0000)]
 - Add support for referencing quota structures without needing the inode
   pointer for softupdates.

Submitted by: mckusick

13 years ago - If the fsync in ufs_direnter fails SUJ can later panic because we have
Jeff Roberson [Fri, 10 Jun 2011 22:18:25 +0000 (22:18 +0000)]
 - If the fsync in ufs_direnter fails SUJ can later panic because we have
   partially added a name.  Allow ufs_direnter() to continue in the
   hopes that it is a transient error.  If it is not, the directory
   is corrupted already from IO errors and writing this new block
   is not likely to make things worse.

13 years ago - When printing bufs with show buf the lblkno is often more useful than
Jeff Roberson [Fri, 10 Jun 2011 22:15:36 +0000 (22:15 +0000)]
 - When printing bufs with show buf the lblkno is often more useful than
   the blkno.  Print them both.

13 years agoInclude sys/xen in cscope tag file generation.
Justin T. Gibbs [Fri, 10 Jun 2011 20:51:41 +0000 (20:51 +0000)]
Include sys/xen in cscope tag file generation.

13 years ago- Fix races on detach handling of AAC_IFFLAGS_* mask
Attilio Rao [Fri, 10 Jun 2011 20:23:56 +0000 (20:23 +0000)]
- Fix races on detach handling of AAC_IFFLAGS_* mask
- Fix races on setting AAC_AIFFLAGS_ALLOCFIBS
- Remove some unused AAC_IFFLAGS_* bits.
  Please note that the kthread still makes a difference between the
  total mask and AAC_AIFFLAGS_ALLOCFIBS because more flags may be
  added in the future to aifflags.

Sponsored by: Sandvine Incorporated
Reported and reviewed by: emaste
MFC after: 2 weeks

13 years agoRemove C constructs that are incompatible with C++ from various
Justin T. Gibbs [Fri, 10 Jun 2011 20:10:30 +0000 (20:10 +0000)]
Remove C constructs that are incompatible with C++ from various
OpenSolaris and ZFS header files.  These changes are sufficient
to allow a C++ program to use the libzfs library.

Note: The majority of these files already included 'extern "C"'
      declarations, so the intention of providing C++ compatibility
      already existed even if it wasn't provided.

cddl/compat/opensolaris/include/assert.h:
Wrap our compatibility assert implementation in
'extern "C"'.  Since this is a compatibility header
I matched the Solaris style of doing this explicitly
rather than rely on FreeBSD's __BEGIN/END_DECLS macro.

sys/cddl/compat/opensolaris/sys/kstat.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h:
Rename parameters in function declarations that conflict
with C++ keywords.  This was the solution preferred by
members of the Illumos community.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h:
In C, nested structures are visible in the global namespace,
but in C++, they take on the namespace of the structure in
which they are contained.  Flatten nested structure
definitions within struct zfs_cmd so these structures are
visible in the global namespace when compiled in both
languages.

Sponsored by:  Spectra Logic Corporation

13 years agoMake sure to drop the IEEE80211_RATE_BASIC flag even for MCS rates.
Bernhard Schmidt [Fri, 10 Jun 2011 17:06:25 +0000 (17:06 +0000)]
Make sure to drop the IEEE80211_RATE_BASIC flag even for MCS rates.

Reported by: Maciej Milewski <milu at dat dot pl>
Tested by: Maciej Milewski <milu at dat dot pl>

13 years agoskel/.shrc: Improve commented CDPATH example for POSIX requirements.
Jilles Tjoelker [Fri, 10 Jun 2011 13:47:11 +0000 (13:47 +0000)]
skel/.shrc: Improve commented CDPATH example for POSIX requirements.

POSIX says an empty entry in CDPATH shall not result in the new directory
being printed, while any non-empty entry shall result in the new directory
being printed, including ".". Therefore, the value of CDPATH should almost
always start with a colon, not dot and colon.

Our sh does not print the name for empty entries as well as "." entries.

MFC after: 1 week

13 years agoFix some off-by-one errors with the ending address of candidate regions
John Baldwin [Fri, 10 Jun 2011 13:24:56 +0000 (13:24 +0000)]
Fix some off-by-one errors with the ending address of candidate regions
when attempting to grow a window.

13 years agoImplement BUS_ADJUST_RESOURCE() for the x86 drivers that sit between the
John Baldwin [Fri, 10 Jun 2011 12:30:16 +0000 (12:30 +0000)]
Implement BUS_ADJUST_RESOURCE() for the x86 drivers that sit between the
Host-PCI bridge drivers and nexus.

13 years agoObtain bswap64() function implementation from
Craig Rodrigues [Fri, 10 Jun 2011 01:13:15 +0000 (01:13 +0000)]
Obtain bswap64() function implementation from
version 1.3 of src/common/lib/libc/gen/bswap64.c in NetBSD.

Obtained from: NetBSD