]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/log
FreeBSD/stable/9.git
12 years agoMFC r227660:
kib [Fri, 25 Nov 2011 10:29:22 +0000 (10:29 +0000)]
MFC r227660:
Fix fd leak.

Approved by: re (bz)

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

12 years agoMFC r227930:
tuexen [Thu, 24 Nov 2011 18:51:31 +0000 (18:51 +0000)]
MFC r227930:

Move up the address to the top of the sctp_paddrthlds structure
like in all other structures. This avoids alignment problems.

Approved by: re@

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

12 years agoMFC r227290 and r227291:
rstone [Thu, 24 Nov 2011 18:44:09 +0000 (18:44 +0000)]
MFC r227290 and r227291:

r227290:
 Fix the DTrace pid return trap interrupt vector.  Previously we were using
 31, but that vector is reserved.

 Without this fix, running dtrace -p <pid> would either cause the target
 process to crash or the kernel to page fault

r227291:
 Replace fasttrap_copyout() with uwrite().  FreeBSD copyout() is not able to
 write to the .text section of a process.

Approved by: re (kib)

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

12 years agoMFC r227540:
tuexen [Thu, 24 Nov 2011 17:54:03 +0000 (17:54 +0000)]
MFC r227540:

Set the MTU of an path to an approriate value if the interface MTU
can't be determined.

Approved by: re@

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

12 years agoMFC r227486:
tuexen [Thu, 24 Nov 2011 17:21:52 +0000 (17:21 +0000)]
MFC r227486:

Don't copy uninitialized memory. Also simplify the comparison
of interface names.

Approved by: re@

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

12 years agoMFC r227110,r227111:
pjd [Thu, 24 Nov 2011 07:25:43 +0000 (07:25 +0000)]
MFC r227110,r227111:

r227110:

In zvol_open() if the spa_namespace_lock is already held, it means that
ZFS is trying to open and taste ZVOL as its VDEV. This is not supported,
so return an error instead of panicing on spa_namespace_lock recursion.

Reported by: Robert Millan <rmh@debian.org>
PR: kern/162008

r227111:

Correct typo in comment.

Reported by: Fabian Keil <fk@fabiankeil.de>

Approved by: re (kib)

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

12 years agoMFC r225849:
delphij [Wed, 23 Nov 2011 21:41:31 +0000 (21:41 +0000)]
MFC r225849:

Test if the interface is afif in dhcpif() and syncdhcpif(), as
done in ipv6_autoconfif.

This fixes a regression that causes e.g. ifconfig_DEFAULT="DHCP"
to run on non-afif interfaces like pfsync0, which in turn would
cause excessive delay on system startup.

Sponsored by: iXsystems, Inc.
Reviewed by: hrs (freebsd-rc@)
Approved by: re (bz)

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

12 years agoMFC r226938 (by kevlo):
bz [Wed, 23 Nov 2011 18:10:47 +0000 (18:10 +0000)]
MFC r226938 (by kevlo):

 Add missing PF_UNLOCK in pf_test

Approved by: re (kib)

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

12 years agoMFC r227061 (by mlaier):
bz [Wed, 23 Nov 2011 18:04:30 +0000 (18:04 +0000)]
MFC r227061 (by mlaier):

 Fix a use-after-free/redzone issue in the routing code.

Approved by: re (kib)

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

12 years agoMFC r227547:
bz [Wed, 23 Nov 2011 16:02:12 +0000 (16:02 +0000)]
MFC r227547:

 The maximum TSO frame size should be:
        maximum IP datagram size (65535 bytes) +
        Ethernet header size (14 bytes) +
        2 * VLAN tag size (4 bytes) [1].

 [1] We need to multiply by 2 to account for the double VLAN tag
     provision added in IEEE 802.1ad.

 Submitted by: David Somayajulu (david.somayajulu qlogic.com)

Approved by: re (kib)

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

12 years agoMFC r227058:
attilio [Wed, 23 Nov 2011 15:37:03 +0000 (15:37 +0000)]
MFC r227058:
Disable interrupt and preemption for smp_rendezvous() also in the
UP/!SMP case.

Sponsored by: Sandvine Incorporated
Approved by: re (kib)

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

12 years agoMFC r227481:
bz [Wed, 23 Nov 2011 15:10:15 +0000 (15:10 +0000)]
MFC r227481:

  Return the correct value for the IPV6_MULTICAST_HOPS getsockopt() call.

  Submitted by: rpaulo

Approved by: re (kib)

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

12 years agoMFC r227657:
kib [Wed, 23 Nov 2011 15:03:15 +0000 (15:03 +0000)]
MFC r227657:
Consistently use process spin lock for protection of the
p->p_boundary_count. Race could cause the execve(2) from the threaded
process to hung since thread boundary counter was incorrect and
single-threading never finished.

Approved by: re (bz)

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

12 years agoMFC r227769, 227770, 227771:
gjb [Wed, 23 Nov 2011 12:23:32 +0000 (12:23 +0000)]
MFC r227769, 227770, 227771:

- Add a note to src/Makefile that explains that 'rm' runs twice because
  thesecond invocation only needs to operate on files with the immutable
  flag set.

- Fix the note in r227769 to be less specific to the immutable flag.

- Replace 'chflags' with 'file flags' in a comment, since 'chflags'is a
  command, not a flag itself.

Approved by: re (kib)

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

12 years agoMFC r227604:
davidxu [Wed, 23 Nov 2011 00:01:45 +0000 (00:01 +0000)]
MFC r227604:
Pass CVWAIT flags to kernel, this should handle
Timeout correctly for pthread_cond_timedwait when
it uses kernel-based condition variable.

Approved by: re (kib)

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

12 years agoMFC: r227742
brueffer [Sun, 20 Nov 2011 17:11:11 +0000 (17:11 +0000)]
MFC: r227742

Add 2010 and 2011 copyrights.

Approved by: re (kib)

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

12 years agoMFC: r227466, r227480, r227516
brueffer [Sun, 20 Nov 2011 17:08:32 +0000 (17:08 +0000)]
MFC: r227466, r227480, r227516

Add mps(4) and mvs(4) to the hardware notes.

Approved by: re (kib)

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

12 years agoMFC: r227275
brueffer [Sun, 20 Nov 2011 17:05:25 +0000 (17:05 +0000)]
MFC: r227275

Add qlxgb(4) to the hardware notes.

Approved by: re (kib)

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

12 years agoMFC: r227465, r227515
brueffer [Sat, 19 Nov 2011 16:54:58 +0000 (16:54 +0000)]
MFC: r227465, r227515

- Grammar and mdoc cleanup.
- Remove list nesting in the hardware notes section, thus making it
  compatible with the hardware notes generation script.

Approved by: re (kib)

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

12 years agoMFC: r227578
marius [Sat, 19 Nov 2011 13:33:21 +0000 (13:33 +0000)]
MFC: r227578

Fix compilation with DEBUG defined.

Approved by: re (kib)

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

12 years agoMFC: r227539
marius [Sat, 19 Nov 2011 13:03:59 +0000 (13:03 +0000)]
MFC: r227539

Define curthread as an inline function that loads the thread pointer
directly from g7, the pcpu pointer. This guarantees correct behavior
when the thread migrates to a different CPU.
Commit message stolen from r205431. Additional testing by Peter Jeremy.

Approved by: re (kib)

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

12 years agoMFC: r227537
marius [Sat, 19 Nov 2011 12:55:32 +0000 (12:55 +0000)]
MFC: r227537

As it turns out, r186347 actually is insufficient to avoid the use of the
curthread-accessing part of mtx_{,un}lock(9) when using a r210623-style
curthread implementation on sparc64, crashing the kernel in its early
cycles as PCPU isn't set up, yet (and can't be set up as OFW is one of the
things we need for that, which leads to a chicken-and-egg problem). What
happens is that due to the fact that the idea of r210623 actually is to
allow the compiler to cache invocations of curthread, it factors out
obtaining curthread needed for both mtx_lock(9) and mtx_unlock(9) to
before the branch based on kobj_mutex_inited when compiling the kernel
without the debugging options. So change kobj_class_compile_static(9)
to just never acquire kobj_mtx, effectively restricting it to its
documented use, and add a kobj_init_static(9) for initializing objects
using a class compiled with the former and that also avoids using mutex(9)
(and malloc(9)). Also assert in both of these functions that they are
used in their intended way only.
While at it, inline kobj_register_method() and kobj_unregister_method()
as there wasn't much point for factoring them out in the first place
and so that a reader of the code has to figure out the locking for
fewer functions missing a KOBJ_ASSERT.
Tested on powerpc{,64} by andreast.

Reviewed by: nwhitehorn (earlier version), jhb
Approved by: re (kib)

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

12 years agoMFC r226549,r226550,r226551,r226552,r226553,r226554,r226568,r226569,r226611,
pjd [Sat, 19 Nov 2011 10:49:03 +0000 (10:49 +0000)]
MFC r226549,r226550,r226551,r226552,r226553,r226554,r226568,r226569,r226611,
    r226612:

r226549:

Remove redundant size calculation.

r226550:

Initialize 'rc' properly before using it. This error could lead to infinite
loop when data reconstruction was needed.

r226551:

Don't mark vdev as healthy too soon, so we won't try to use invalid vdevs.

r226552:

Never pass NULL block pointer when reading. This is neither expected nor
handled by lower layers like vdev_raidz, which uses bp for checksum
verification. This bug could lead to NULL pointer reference and resets
during boot.

r226553:

Always pass data size for checksum verification function, as using
physical block size declared in bp may not always be what we want.
For example in case of gang block header physical block size declared
in bp is much larger than SPA_GANGBLOCKSIZE (512 bytes) and checksum
calculation failed. This bug could lead to accessing unallocated
memory and resets/failures during boot.

r226554:

Fix missing return when LOADER_GPT_SUPPORT is defined, but LOADER_MBR_SUPPORT
is not.

r226568:

- Correctly read gang header from raidz.
- Decompress assembled gang block data if compressed.
- Verify checksum of a gang header.
- Verify checksum of assembled gang block data.
- Verify checksum of uber block.

Submitted by: avg

r226569:

With LOADER_MBR_SUPPORT defined and LOADER_GPT_SUPPORT undefined we would
never call disk_openmbr().

Submitted by: avg

r226611:

- Allow to specify multiple files to check, eg.

zfsboottest gpt/system0 gpt/system1 - /boot/kernel/kernel /boot/zfsloader

- Instead of printing file's content calculate MD5 hash of the file,
  so it can be easly compared to the hash calculated via file system.
- Some other minor improvements.

r226612:

Because ZFS boot code was very fragile in the past and real PITA to debug,
introduce zfsboottest.sh script that will verify if it will be possible to boot
from the given pool.

# zfsboottest.sh system

Where "system" is pool name of the pool we want to boot from.

What is being verified by the script:
- Does the pool exist?
- Does it have bootfs property configured?
- Is mountpoint property of the boot dataset set to 'legacy'?

Dataset configured in bootfs property has to be mounted to perform more
checks:
- Does the /boot directory in boot dataset exist?
- Is this dataset configured as root file system in /etc/fstab or set
  in vfs.root.mountfrom variable in /boot/loader.conf?

By using zfsboottest tool the script will read all the files in /boot
directory using ZFS boot code and calculate their checksums.
Then, it will walk /boot directory using find(1) though regular file sytem
and also read all the files in /boot directory and calculate their checksums.
If any of the files cannot be looked up, read or checksum is invalid it will
be reported and booting off of this pool is probably not possible.

Some additional checks may be interesting as well. For example if the disks
contain proper pmbr and gptzfsboot code or if all expected files in /boot/
are present.

When upgrading FreeBSD, one should snapshot datasets that contain operating
system, upgrade (install new world and kernel) and use zfsboottest.sh to verify
if it will be possible to boot from new configuration. If all is good one
should upgrade boot blocks, by eg.:

# gpart -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada1

If something is wrong, one should rollback datasets and report the problems.

Approved by: re (kib)

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

12 years agoMFC r226617:
pjd [Sat, 19 Nov 2011 10:28:06 +0000 (10:28 +0000)]
MFC r226617:

zfs vdev_file_io_start: validate vdev before using vdev_tsd

vdev_tsd can be NULL for certain vdev states.
At least in userland testing with ztest.

Submitted by: avg
Approved by: re (kib)

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

12 years agoMFC r226613,r226615,r226616:
pjd [Sat, 19 Nov 2011 10:26:34 +0000 (10:26 +0000)]
MFC r226613,r226615,r226616:

r226613:

libzpool task_alloc: pass only valid flags to kmem_alloc

tqflags may contain other flags besided those that are suitable for
kmem_alloc == umem_alloc

Submitted by: avg

r226615:

thr_create: new_thread_ID may be NULL

Submitted by: avg

r226616:

zdb: access dp_free_bpobj only if pool version is >= SPA_VERSION_DEADLISTS

Submitted by: avg

Approved by: re (kib)

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

12 years agoMFC r226620:
pjd [Sat, 19 Nov 2011 10:24:46 +0000 (10:24 +0000)]
MFC r226620:

Update per-thread I/O statistics collection in ZFS.
This allows to see processes I/O activity in 'top -m io' output.

PR kern/156218
Reported by: Marcus Reid <marcus@blazingdot.com>
Patch by: avg
Approved by: re (kib)

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

12 years agoMFC r227416:
dougb [Fri, 18 Nov 2011 21:10:13 +0000 (21:10 +0000)]
MFC r227416:

Document that flock can return ENOLCK

Approved by: re (kib)

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

12 years agoMFC r226863:
dougb [Fri, 18 Nov 2011 20:47:14 +0000 (20:47 +0000)]
MFC r226863:

Fix svnversion for svn 1.7.x by not looking for .svn in ${SYSDIR}
(since it no longer exists). Instead, run svnversion if we can find
the binary and test that the output looks like a version string.

Approved by: re (kib)

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

12 years agoMFC r227391:
fabient [Fri, 18 Nov 2011 14:41:48 +0000 (14:41 +0000)]
MFC r227391:
Import gcc fix for -fstack-protector that produces segfaulting
binaries on arm/armel.

Related gcc bug:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35965

Author kindly accepted that all of his patches can be use as GPLv2.

PR: 161128
Approved by: re (kib)

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

12 years agoMFC: r227059
rmacklem [Thu, 17 Nov 2011 16:08:46 +0000 (16:08 +0000)]
MFC: r227059
Both a crash reported on freebsd-current on Oct. 18 under the
subject heading "mtx_lock() of destroyed mutex on NFS" and
PR# 156168 appear to be caused by clnt_dg_destroy() closing
down the socket prematurely. When to close down the socket
is controlled by a reference count (cs_refs), but clnt_dg_create()
checks for sb_upcall being non-NULL to decide if a new socket
is needed. I believe the crashes were caused by the following race:
  clnt_dg_destroy() finds cs_refs == 0 and decides to delete socket
  clnt_dg_destroy() then loses race with clnt_dg_create() for
    acquisition of the SOCKBUF_LOCK()
  clnt_dg_create() finds sb_upcall != NULL and increments cs_refs to 1
  clnt_dg_destroy() then acquires SOCKBUF_LOCK(), sets sb_upcall to
    NULL and destroys socket

This patch fixes the above race by changing clnt_dg_destroy() so
that it acquires SOCKBUF_LOCK() before testing cs_refs.

Tested by: bz
Reviewed by: dfr
Approved by: re (kib)

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

12 years agoRecord the merge of r227457, which was done as part of r227565 but not mentioned...
eadler [Thu, 17 Nov 2011 14:05:59 +0000 (14:05 +0000)]
Record the merge of r227457, which was done as part of r227565 but not mentioned in the commit log

PR: kern/142999
PR: kern/151365
Submitted by: Takefu Kenji <takefu@airport.fm>
Submitted by: Joerg Niendorf <f5d10a@internode.on.net>
Approved by: re (kib)

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

12 years agoMFC: r227448
brueffer [Thu, 17 Nov 2011 12:27:20 +0000 (12:27 +0000)]
MFC: r227448

Reword a sentence in the HARDWARE section a little to make it more suitable
for automatic hardware notes generation.

Approved by: re (kib)

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

12 years agoMFC: r227276
brueffer [Thu, 17 Nov 2011 12:25:15 +0000 (12:25 +0000)]
MFC: r227276

Add qlxgb(4).

Approved by: re (kib)

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

12 years agoMFC: r227271
brueffer [Thu, 17 Nov 2011 12:22:09 +0000 (12:22 +0000)]
MFC: r227271

Write QLogic consistently.

Approved by: re (kib)

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

12 years agoMFC r227112:
dim [Thu, 17 Nov 2011 08:07:16 +0000 (08:07 +0000)]
MFC r227112:

Whenever you boot with nfsv4_server_enable=NO (the default) in rc.conf,
the /etc/rc.d/nfsd script sets vfs.nfsd.server_max_nfsvers to 3.

Then, when you set nfsv4_server_enable=YES in rc.conf, and restart nfsd
via the rc.d script, without rebooting, the sysctl does *not* get reset
to max version 4, so NFSv4 still doesn't work.

Fix this by explicitly setting vfs.nfsd.server_max_nfsvers to 4 when
NFSv4 is requested.

I also added resetting of the nfs_privport sysctls, since this has the
same issue: nfs_reserved_port_only=YES in rc.conf sets the nfs_privport
sysctl to 1, but in the other case, the sysctl doesn't get reset to 0.

Reviewed by: rmacklem
Silence from: rc@
Approved by: re (kib)

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

12 years agoMFC r226679:
bschmidt [Wed, 16 Nov 2011 17:39:59 +0000 (17:39 +0000)]
MFC r226679:
Let net80211 also know about stopped BA sessions. This fixes some issues
where the driver assumed that BA resources are still available due to
net80211 saying so.

PR: 161407, 159768
Tested by: cperciva, rene
Approved by: re (kib)

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

12 years agoMFC r226404:
eadler [Wed, 16 Nov 2011 16:27:53 +0000 (16:27 +0000)]
MFC r226404:

- add support for I-O DATA RSA-PCI2/R

PR: kern/142999
Submitted by: Takefu Kenji <takefu@airport.fm>
Approved by: jhb
Approved by: re (kib)

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

12 years agoMFC r227272:
ae [Wed, 16 Nov 2011 15:36:53 +0000 (15:36 +0000)]
MFC r227272:
  Add reference to gpart(8).

MFC r227280:
  Initialize "acc" value inside the loop to reset failed attempts.

  PR:           misc/162262

MFC r227292:
  Improve error reporting when MBR can not be written.
  Remove obsolete code which uses DIOCSMBR ioctl.
  When writing MBR first check that GEOM_MBR is available, if it is not
  available, then try write MBR directly to provider. If both are failed,
  then recommend to use gpart(8).

MFC r227295:
  Fix multi-line comment formatting.

  Pointed by:   jh

Approved by: re (kib)

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

12 years agoMFC rr227273:
ae [Wed, 16 Nov 2011 15:35:05 +0000 (15:35 +0000)]
MFC rr227273:
  Add reference to gpart(8).

Approved by: re (kib)

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

12 years agoMFC r227231:
ae [Wed, 16 Nov 2011 15:32:32 +0000 (15:32 +0000)]
MFC r227231:
  To be in sync with GEOM_PART_BSD limit the maximum number of supported
  partitions to 20.

MFC r227248:
  bsdlabel(8) could automatically fill many of disklabel's deprecated
  fields, but user could specify some of those fields when edits disklabel
  with `bsdlabel -e`. But without -A flag these fields might be
  overwritten with default values from the virgin disklabel.
  So, don't overwrite such fields if they are not zero. Also add checks
  to prevent creating disklabel with less than DEFPARTITIONS and more
  than MAXPARTITIONS partitions.

  PR: bin/162332
  Tested by: Eugene Grosbein

MFC r227262:
  Remove unneeded checks.

MFC r227270:
  Add recommendation to use gpart(8) when user tries write disklabel
  or bootcode to already opened provider.

MFC r227296:
  Fix multi-line comment formatting.

Approved by: re (kib)

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

12 years agoMFC r227274:
ae [Wed, 16 Nov 2011 15:23:19 +0000 (15:23 +0000)]
MFC r227274:
  Add reference to gpart(8).

MFC r227298:
  Remove a note about disabling of GEOM protection mechanism.
  boot0cfg should work without such hack.

Approved by: re (kib)

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

12 years agoMFC r227409:
delphij [Tue, 15 Nov 2011 17:30:03 +0000 (17:30 +0000)]
MFC r227409:

Do a dummy read to flush the interrupt ACK that we just performed,
ensuring that everything is really, truly consistent.

This fixes certain cases where one will see various:
  mfi0: COMMAND 0xffffffXXXXXXXXXX TIMEOUT AFTER XX SECONDS

Submitted by: scottl
Ok'ed by: jhb
Approved by: re (kib)

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

12 years agoThe releng/9.0 release branch has been created so convert stable/9 over
kensmith [Mon, 14 Nov 2011 00:45:25 +0000 (00:45 +0000)]
The releng/9.0 release branch has been created so convert stable/9 over
to our standard "Politically Correct" name for the balance of the 9.0-RELEASE
release cycle.

Approved by: re (implicit)

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

12 years agoMFC r227449:
trociny [Fri, 11 Nov 2011 14:42:05 +0000 (14:42 +0000)]
MFC r227449:

Fix false positive EADDRINUSE that could be returned by bind, due to
the typo made in r227207.

Reported by: kib
Tested by: kib

Approved by: re (kib)

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

12 years agoMFC r227204, 227206, 227207:
trociny [Thu, 10 Nov 2011 20:28:30 +0000 (20:28 +0000)]
MFC r227204, 227206, 227207:

r227204:

Fix the typo made in r157474.

r227206:

Before dereferencing intotw() check for NULL, the same way as it is
done for in_pcb (see r157474).

r227207:

Cache SO_REUSEPORT socket option in inpcb-layer in order to avoid
inp_socket->so_options dereference when we may not acquire the lock on
the inpcb.

This fixes the crash due to NULL pointer dereference in
in_pcbbind_setup() when inp_socket->so_options in a pcb returned by
in_pcblookup_local() was checked.

Reported by: dave jones <s.dave.jones@gmail.com>, Arnaud Lacombe <lacombar@gmail.com>
Suggested by: rwatson
Glanced by: rwatson
Tested by: dave jones <s.dave.jones@gmail.com>

Approved by: re (kib)

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

12 years agoMFC 227320:
tuexen [Thu, 10 Nov 2011 19:54:00 +0000 (19:54 +0000)]
MFC 227320:
When loading addresses from INITs, always use the correct
local address.

Approved by: re@

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

12 years agoMFC 227266:
tuexen [Thu, 10 Nov 2011 19:36:19 +0000 (19:36 +0000)]
MFC 227266:
Initialize all components of the sent COOKIE.

Approved by: re@

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

12 years agoBack out r226299 (MFC of r226105) which caused a number of ports
andre [Thu, 10 Nov 2011 19:10:53 +0000 (19:10 +0000)]
Back out r226299 (MFC of r226105) which caused a number of ports
that depend on the incorrect IP length field.  The fix stays in
HEAD and ports should test for it.

Requested by: glebius
Approved by:    re (kib)

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

12 years agoMFC r226740
alc [Thu, 10 Nov 2011 16:50:36 +0000 (16:50 +0000)]
MFC r226740
  Speed up vm_page_cache() and vm_page_remove() by checking for a few
  common cases that can be handled in constant time.

Approved by: re (kib)

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

12 years agoMFC r226971
pho [Wed, 9 Nov 2011 18:51:41 +0000 (18:51 +0000)]
MFC r226971
Added missing cache purge of from argument.

Approved by: re (kensmith)

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

12 years agoMFC 226748:
jhb [Wed, 9 Nov 2011 18:26:19 +0000 (18:26 +0000)]
MFC 226748:
- Add a new header for the x86 boot code that defines various structures
  and constants related to the BIOS Enhanced Disk Drive Specification.
- Use this header instead of magic numbers and various duplicate structure
  definitions for doing I/O.
- Use an actual structure for the request to fetch drive parameters in
  drvsize() rather than a gross hack of a char array with some magic
  size.  While here, change drvsize() to only pass the 1.1 version of
  the structure and not request device path information.  If we want
  device path information you have to set the length of the device
  path information as an input (along with probably checking the actual
  EDD version to see which size one should use as the device path
  information is variable-length).  This fixes data smashing problems
  from passing an EDD 3 structure to BIOSes supporting EDD 4.

Approved by: re (kib)

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

12 years agoMFC 226302:
jhb [Wed, 9 Nov 2011 18:12:42 +0000 (18:12 +0000)]
MFC 226302:
If an allocation for a specific resource range fails because it is not in
a decoded range for an ACPI Host-PCI bridge, try to allocate it from the
ACPI system resource range.  If that works, permit the resource allocation
regardless.

Approved by: re (kib)

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

12 years agoStart up 9.0-RC2.
kensmith [Tue, 8 Nov 2011 14:24:33 +0000 (14:24 +0000)]
Start up 9.0-RC2.

Approved by: re (implicit)

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

12 years agoMFC: r227006, r227281, r227282
marius [Mon, 7 Nov 2011 13:40:54 +0000 (13:40 +0000)]
MFC: r227006, r227281, r227282

Add a PCI front-end to esp(4) allowing it to support AMD Am53C974 and
replace amd(4) with the former in the amd64, i386 and pc98 GENERIC kernel
configuration files. Besides duplicating functionality, amd(4), which
previously also supported the AMD Am53C974, unlike esp(4) is no longer
maintained and has accumulated enough bit rot over time to always cause
a panic during boot as long as at least one target is attached to it
(see PR 124667).

PR: 124667
Approved by: re (kib)
Obtained from: NetBSD (based on)

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

12 years agoMFC: r226947, r226949, r227284
marius [Mon, 7 Nov 2011 13:16:51 +0000 (13:16 +0000)]
MFC: r226947, r226949, r227284

- Use device_t rather than the NetBSDish struct device.
- Move esp_devclass to ncr53c9x.c in order to allow different bus front-ends
  to use it.
- Use KOBJMETHOD_END.
- Remove the gl_clear_latched_intr hook as it's not needed for any of the
  chips nor the front-ends supported in FreeBSD and likely never will be.
- Correct the DMA constraints and only limit the tag used for the transfer
  buffers to 32-bit DMA as that address is written into a 32-bit register.
- The ESP200 also only supports up to 64k transfers.
- Don't let the DMA and SBus front-end supply a maximum transfer size larger
  than MAXPHYS as that's the maximum the upper layers use and we otherwise
  just waste resources unnecessarily.
- Initialize the ECB callout and don't zero the handle when returning ECBs
  to the free list so that ncr53c9x_callout() actually is called with the
  driver lock held.
- On detach the driver lock should be held across cam_sim_free() according
  to isp(4) and a panic received.
- Check the return value of NCRDMA_SETUP(), i.e. bus_dmamap_load(9), and try
  to handle failures gracefully.
- In ncr53c9x_action() replace N calls to xpt_done() in a switch with just
  one at the end.
- On XPT_PATH_INQ report "NCR" rather than "Sun" as the vendor as the former
  is somewhat more correct as well as the maximum supported transfer size via
  maxio in order to take advantage of controllers that that can handle more
  than DFLTPHYS.
- Freeze the device queue if a request didn't complete without error and
  isn't already frozen.
- Print the number of MESSAGE (EXTENDED) rejected.
- Fix the path encoded in the multiple inclusion protection of ncr53c9xvar.h.
- Correct the DMA constraints used in the LSI64854 core to not exceed the
  maximum supported transfer size and include the boundary so we don't need
  to check on every setup of a DMA transfer.
- Let the bus DMA map callbacks do nothing in case of an error.
- Correctly handle > 64k transfers for FAS366 in the LSI64854. A new feature
  flag NCR_F_LARGEXFER was introduced so we just need to check for this one
  and not for individual controllers supporting large transfers in several
  places.
- Let the LSI64854 core load transfer buffers using BUS_DMA_NOWAIT as the
  NCR53C9x core can't handle EINPROGRESS. Due to lack of bounce buffers
  support, sparc64 doesn't actually use EINPROGRESS and likely never will,
  as an example for writing additional front-ends for the NCR53C9x core it
  makes sense to set BUS_DMA_NOWAIT anyway though.
- Some minor cleanup.

Approved by: re (kib)

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

12 years agoMFC: r226995, r227042
marius [Sun, 6 Nov 2011 21:09:10 +0000 (21:09 +0000)]
MFC: r226995, r227042

- Import the common MII bitbang'ing code from NetBSD and convert drivers to
  take advantage of it instead of duplicating it. This reduces the size of
  the i386 GENERIC kernel by about 8k. The only potential in-tree users left
  unconverted are ed(4) and xe(4). Xe(4) generally should be changed to use
  miibus(4) instead of implementing PHY handling on its own, as otherwise it
  makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to it
  just for the MII bitbang'ing code. Ed(4) has some chip specific things
  interwinded with the MII bitbang'ing code and it's unclear whether it can
  be converted to common code, at least not without thorough testing of all
  the various chips supported by ed(4).
  The common MII bitbang'ing code also is useful in the embedded space for
  using GPIO pins to implement MII access.
- Based on lessons learnt with dc(4) (see r185750), add bus barriers to the
  MII bitbang read and write functions of the other drivers converted in
  order to ensure the intended ordering. Given that register access via an
  index register as well as register bank/window switching is subject to the
  same problem, also add bus barriers to the respective functions of smc(4),
  tl(4) and xl(4).
- Sprinkle some const.

Thanks to the following testers:
Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4))
Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4).

Reviewed by: yongari (subset of drivers)
Approved by: re (kib)
Obtained from: NetBSD (partially)

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

12 years agoMFC r227064:
bz [Sun, 6 Nov 2011 20:29:18 +0000 (20:29 +0000)]
MFC r227064:

  Add QLogic 10 Gigabit Ethernet & CNA Adapter Driver version 1.30
  for 3200 and 8200 series cards.

  Submitted by: David C Somayajulu (david.somayajulu@qlogic.com),
                Qlogic Corporation

Approved by: re (kib)

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

12 years agoMFC r227085:
bz [Sun, 6 Nov 2011 17:31:57 +0000 (17:31 +0000)]
MFC r227085:

  Always use the opt_*.h options for ipfw.ko, not just when
  compiled into the kernel.
  Do not try to build the module in case of no INET support but
  keep #error calls for now in case we would compile it into the
  kernel.

  This should fix an issue where the module would fail to enable
  IPv6 support from the rc framework, but also other INET and INET6
  parts being silently compiled out without giving a warning in the
  module case.

  While here garbage collect unneeded opt_*.h includes.
  opt_ipdn.h is not used anywhere but we need to leave the DUMMYNET
  entry in options for conditional inclusion in kernel so keep the
  file with the same name.

  Reported by:  pluknet
  Reviewed by:  plunket, jhb

Approved by: re (kib)

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

12 years agoMFC: r227001
marius [Sun, 6 Nov 2011 17:25:22 +0000 (17:25 +0000)]
MFC: r227001

Increase the IOC port initialization timeouts by ten times to what the
corresponding Linux driver uses. This allows mpt(4) to still recognize
all good SATA devices in presence of a defective one, which takes about
45 seconds.
In the long term we probably should implement the logic used by mpt2sas(4)
allowing IOC port initialization to complete at a later time.

Submitted by: Andrew Boyer
Approved by: re (kib)

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

12 years agoMFC: r226154, r226165
marius [Sun, 6 Nov 2011 17:23:49 +0000 (17:23 +0000)]
MFC: r226154, r226165

- Follow the lead of dcphy(4) and pnphy(4) and move the reminder of the PHY
  drivers that only ever attach to a particular MAC driver, i.e. inphy(4),
  ruephy(4) and xlphy(4), to the directory where the respective MAC driver
  lives and only compile it into the kernel when the latter is also there,
  also removing it from miibus.ko and moving it into the module of the
  respective MAC driver.
- While at it, rename exphy.c, which comes from NetBSD where the MAC driver
  it corresponds to also is named ex(4) instead of xl(4) but that in FreeBSD
  actually identifies itself as xlphy(4), and its function names accordingly
  for consistency.
- Additionally while at it, fix some minor style issues like whitespace
  in the register headers and add multi-inclusion protection to inphyreg.h.

Approved by: re (kib)

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

12 years agoMFC r226985:
mav [Sun, 6 Nov 2011 16:54:23 +0000 (16:54 +0000)]
MFC r226985:
Workaround the problem introduced by combination of r162200 and r215687.
r162200 delays provider orphanization until all running requests complete,
to workaround broken orphan() method implementation in some classes.
r215687 removes persistent periodic (10Hz) event thread wake ups.
Together these changes can indefinitely delay orphanization until some
other event wake up the event thread. One consequence of this is inability
of CAM to destroy device disconnected when busy and, as consequence, create
new one after reconnection.

While the best solution would be to revert r162200, it is not easy, as
some classes still broken in that way. Instead conditionally wake up event
thread if there are some providers waiting for orphanization.

Approved by: re (kib)

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

12 years agoMFC r226666,226739,226741:
nwhitehorn [Sun, 6 Nov 2011 16:37:50 +0000 (16:37 +0000)]
MFC r226666,226739,226741:
Avoid showing the user some spurious error messages from GEOM [1] and do
provide error messages instead of silent failure if there are no disks
or no network interfaces in the system [2].

PR: bin/161926 [1], bin/161926 [2]
Approved by: re (kib)

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

12 years agoMFC r226439:
nwhitehorn [Sun, 6 Nov 2011 16:36:54 +0000 (16:36 +0000)]
MFC r226439:
Place quotes around the output of kbdmap(1), designed to be pasted into
/etc/rc.conf.

PR: bin/161711
Submitted by: manolis
Approved by: re (kib)

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

12 years agoMFC 227118:
jpaetzel [Sun, 6 Nov 2011 15:58:56 +0000 (15:58 +0000)]
MFC 227118:

Roll up several patches used by PC-BSD.

- Fix an issue with gmirror.
- Allow IPv4 DHCP and IPv6 SLAAC concurrently.
- Fix zpool options using the wrong device name.

Approved by: re
Obtained from: kris@pcbsd.org

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

12 years agoMFC r227075:
hselasky [Sun, 6 Nov 2011 15:06:04 +0000 (15:06 +0000)]
MFC r227075:
Fix for panic at USB controller attach failure during cold boot.

Approved by: re (kib)

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

12 years agoMFC r227062:
kib [Sun, 6 Nov 2011 13:06:31 +0000 (13:06 +0000)]
MFC r227062:
Fix kernel panic when d_fdopen csw method is called for NULL fp.
This may happen when kernel consumer calls VOP_OPEN().

Approved by: re (kensmith)

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

12 years agoMFC: r226937
brueffer [Sun, 6 Nov 2011 12:37:44 +0000 (12:37 +0000)]
MFC: r226937

Fix a misplaced parenthesis.

Approved by: re (kib)

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

12 years agoLast revision should have said:
dougb [Sun, 6 Nov 2011 07:50:25 +0000 (07:50 +0000)]
Last revision should have said:

MFC r226927:
Add birth date for Ken Thompson
Add birth and death dates for Steve Jobs
Update birth and add death date for Dennis Ritchie

MFC r226942:
Fix typo from r226927

Approved by: re (kensmith)

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

12 years agoMFC r227013:
dougb [Sun, 6 Nov 2011 07:47:38 +0000 (07:47 +0000)]
MFC r227013:

1. Add a new option, --run-updates, to always or never run the newalises,
   pwd_mkdb, etc. updates at the end of the comparison.

2. Add an update to the end to handle /etc/localtime, if it exists.
   If /var/db/zoneinfo exists, automatically update /etc/localtime,
   which should (hopefully) be safe to do. If not, prompt the user
   to run tzsetup.

3. Update run_it_now(), the function that handles input for the updates,
   to make sure that we got a valid answer, and to handle the --run-updates
   option if supplied.

Approved by: re (kensmith)

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

12 years agoMFC r227011:
dougb [Sun, 6 Nov 2011 07:35:08 +0000 (07:35 +0000)]
MFC r227011:

If the user is moving from any other time zone to UTC we need
to delete any old /var/db/zoneinfo file that may exist so that
tzsetup -r does the right thing.

Approved by: re (kensmith)

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

12 years agoApproved by: re (kensmith)
dougb [Sun, 6 Nov 2011 07:29:51 +0000 (07:29 +0000)]
Approved by: re (kensmith)

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

12 years agoMFC r226909:
dougb [Sun, 6 Nov 2011 07:18:19 +0000 (07:18 +0000)]
MFC r226909:

Add a reminder about quarterly status report due dates

Approved by: re (kensmith)

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

12 years agoMFC r226898:
dougb [Sun, 6 Nov 2011 07:02:13 +0000 (07:02 +0000)]
MFC r226898:

Fix the text and attribution of the poem "Youth" by Samuel Ullman.

Our copy was a bastardization of the "older" (probably original?) and
shorter version of the poem; and the "newer" version that is better
known, and arguably more popular. Standardize on the latter.

Cf. http://www.bartleby.com/73/2099.html

Approved by: re (kensmith)

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

12 years agoMFC: r226702
obrien [Sun, 6 Nov 2011 02:10:40 +0000 (02:10 +0000)]
MFC: r226702
   * Don't give the impression that this compiler is GPLv3.
     (It is "well known" that GCC 4.2.2 is GPLv3.)
   * Don't give the impression that this compiler isn't "trustable".
   * Fix dependency nit.

Approved by: re (kib)

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

12 years agoMFC r226896:
kib [Sat, 5 Nov 2011 18:27:47 +0000 (18:27 +0000)]
MFC r226896:
Fix an implicit dependency between the MFI driver and CAM that had grown due
to an API change in CAM.  It's once again possible to link a static kernel
with 'mfi' without requiring 'scbus' as well.  Ditto for KLD loading.

Approved by: re (bz)

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

12 years agoMFC r226889,226895:
ache [Fri, 4 Nov 2011 11:14:04 +0000 (11:14 +0000)]
MFC r226889,226895:

"or" word in '}' description gives false impression that newline can be
replaced by space. Reflect reality and POSIX.

PR:             96236
Submitted by:   dougb
Approved by:    re (kib)

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

12 years agoMFC r226880:
ae [Fri, 4 Nov 2011 06:14:18 +0000 (06:14 +0000)]
MFC r226880:
  Our geom withering function could take some time before geom with its
  providers and consumers will be destroyed.  Before take some actions
  with a geom, check that it is not destroyed at the moment.

  Tested by: nwhitehorn

Approved by: re (kib)

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

12 years agoMFC r226951:
dim [Wed, 2 Nov 2011 18:55:26 +0000 (18:55 +0000)]
MFC r226951:

Pull in r143305 and r143312 from upstream clang trunk, so using "clang
-march=native" on AMD K10 family processors no longer errors out with
"unknown target CPU 'amdfam10'".  This also enables use of SSE4A.

Reported by: David Marec <david.marec@davenulle.org>
Approved by: re (kib)

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

12 years agoMerge r226860 from head:
gavin [Wed, 2 Nov 2011 13:51:29 +0000 (13:51 +0000)]
Merge r226860 from head:
  Update the example rules in devfs.conf to reflect the changes since
  ATA_CAM.  While here, add another example rule, as many applications
  these days expect to find /dev/dvd instead.

Approved by: re (kib)

_M   etc
M    etc/devfs.conf

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

12 years agoMFC r226836:
pluknet [Wed, 2 Nov 2011 08:23:40 +0000 (08:23 +0000)]
MFC r226836:
Fix the manual section number for a cross-reference to open(2) and sort it.

Approved by: re (kib)

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

12 years agoMFC 226710
qingli [Tue, 1 Nov 2011 22:22:46 +0000 (22:22 +0000)]
MFC 226710

The host-id/interface-id can have a specific value and is properly
masked out when adding a prefix route through the "route" command.
However, when deleting the route, simply changing the command keyword
from "add" to "delete" does not work. The failoure is observed in
both IPv4 and IPv6 route insertion. The patch makes the route command
behavior consistent between the "add" and the "delete" operation.

Approved by: re (kib)

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

12 years agoMFC r226903, r225777, r226221 and r226534:
hselasky [Tue, 1 Nov 2011 22:00:49 +0000 (22:00 +0000)]
MFC r226903, r225777, r226221 and r226534:
Add some new USB device IDs and some USB device quirks.
Improve the USB mass storage auto quirk detection.

PR: usb/161798, usb/160911
Approved by: re (kib)

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

12 years agoMFC 226451
qingli [Tue, 1 Nov 2011 21:21:36 +0000 (21:21 +0000)]
MFC 226451

The IPv6 code was influx at the time of r196865 due to the L2/L3
separation rewrite changes. r196865 was committed to fix a scope
violation problem in the following test scenario:

  box-1# ifconfig em0 inet6 2001:db8:1:: prefixlen 64 anycast
  box-1# ifconfig em1 inet6 2001:db8:2::1 prefixlen 64

  box-2# ifconfig re0 inet6 2001:db8:1::6 prefixlen 64

  em0 and re0 are on the same link.

  box-2# ping6 2001:db8:1::
  PING6(56=40+8+8 bytes) 2001:db8:1::6 --> 2001:db8:1::

the ICMPv6 response should have a source address of em1, which
is 2001:db8:2::1, not the link-local address of em0.

That code is no longer necessary and breaks the IPv6-Ready logo
testing, so revert it now.

Reviewed by: hrs
Approved by: re (kib)

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

12 years agoMFC 226713
qingli [Tue, 1 Nov 2011 18:29:06 +0000 (18:29 +0000)]
MFC 226713

Exclude host routes when checking for prefix coverage on multiple
interfaces. A host route has a NULL mask so check for that condition.
I have also been told by developers who customize the packet output
path with direct manipulation of the route entry (or the outgoing
interface to be specific). This patch checks for the route mask
explicitly to make sure custom code will not panic.

PR: kern/161805
Approved by: re (kib)

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

12 years agoMFC r226790:
pluknet [Tue, 1 Nov 2011 16:11:44 +0000 (16:11 +0000)]
MFC r226790:
Fix typo in timer_getoverrun cross-reference.

Approved by: re (kib)

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

12 years agoMFC r226688:
kib [Tue, 1 Nov 2011 15:41:55 +0000 (15:41 +0000)]
MFC r226688:
The use of VOP_ISLOCKED() without a check for the return values can cause
false positives. Replace the #ifdef block with the proper
ASSERT_VOP_UNLOCKED() assert.

Approved by: re (bz)

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

12 years agoMFC r226687:
kib [Tue, 1 Nov 2011 15:38:41 +0000 (15:38 +0000)]
MFC r226687:
The only possible error return from null_nodeget() is due to insmntque1
failure (the getnewvnode cannot return an error). In this case, the
null_insmntque_dtr() already unlocked the reclaimed vnode, so VOP_UNLOCK()
in the nullfs_mount() after null_nodeget() failure is wrong.

Approved by: re (bz)

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

12 years agoMFC r226686:
kib [Tue, 1 Nov 2011 15:34:52 +0000 (15:34 +0000)]
MFC r226686:
The covered vnode must be reloced if it was unlocked. Remove VOP_ISLOCKED
test because of this and also because it can lead to false positives.

Approved by: re (bz)

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

12 years agoMFC r226887:
delphij [Mon, 31 Oct 2011 20:02:11 +0000 (20:02 +0000)]
MFC r226887:

Don't expose a constant array into global namespace.

Reported by: Ruslan Yakovlev <quazi bk ru> via yongari
Approved by: re (kib)

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

12 years agoMFC 226869:
tuexen [Mon, 31 Oct 2011 09:27:10 +0000 (09:27 +0000)]
MFC 226869:
When adding a new remote address using sctp_add_remote_addr(),
return the correct net if requested.

Approved by: re@

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

12 years agoMFC r226681:
pho [Mon, 31 Oct 2011 09:18:01 +0000 (09:18 +0000)]
MFC r226681:
Only unlock if the lock is exclusive.

Approved by: re (kib)
PR: kern/161956

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

12 years agoMFC 226868:
tuexen [Mon, 31 Oct 2011 08:48:27 +0000 (08:48 +0000)]
MFC 226868:
Send out control chunks which have no specific destination.

Approved by: re@

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

12 years agoMFC r226647:
marcel [Mon, 31 Oct 2011 03:47:23 +0000 (03:47 +0000)]
MFC r226647:
Add support for Boot Camp. The support is defined as follows:
o   Detect when Boot Camp is enabled (i.e. the MBR mirrors the GPT).
o   When Boot Camp is enabled, update the MBR whenever we write the GPT.
o   Creation of a Boot Camp enabled GPT is not supported.
o   Automatically disable Boot Camp when the GPT has been changed so that
    there's either no EFI partition or no HFS+ partition.
o   The first 4 partitions (by index) get mirrored in the MBR.

Requested by, discussed with and tested by: kris@pcbsd.org
Approved by: re (bz@, kib@)

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

12 years agoMFC r226512:
mm [Sun, 30 Oct 2011 20:58:53 +0000 (20:58 +0000)]
MFC r226512:

Import fix for Illumos bug #1475 to reduce diff against upstream.

Panic caused by this bug was already partially fixed by pjd@
in p4 CH 185940 and 185942.

Reference:
1475 zfs spill block hold can access invalid spill blkptr
https://www.illumos.org/issues/1475

Reviewed by: delphij
Obtained from: Illumos (issue 1475, changeset 13469:b8e89e5c4167)
Approved by: re (kib)

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

12 years agoMFC r226724, r226732:
mm [Sun, 30 Oct 2011 20:56:54 +0000 (20:56 +0000)]
MFC r226724, r226732:

MFC r226724:
Update copyright information in several ZFS files, as the clause 3.3
of the CDDL licence explicitly requires every Contributor to add
a copyright notice.

This also reflects the copyright notices for the changes recently
added by Illumos.

MFC r226732: [1]
Fix typo in copyright notice introduced in r226724
(missing character in e-mail adress)

Reported by: pjd [1]
Approved by: re (kib)

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

12 years agoMFC: r226522
marius [Sun, 30 Oct 2011 12:23:00 +0000 (12:23 +0000)]
MFC: r226522

Allow to dump on Solaris swap partitions.

PR: 161764
Submitted by: Peter Jeremy
Approved by: re (kib)

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

12 years agoMFC r226828:
trociny [Sun, 30 Oct 2011 08:35:19 +0000 (08:35 +0000)]
MFC r226828:

Fix a memory leak in tzload().

PR: bin/161425
Reviewed by: kib
Approved by: re (kib)

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

12 years agoMFC: r226381
marius [Sat, 29 Oct 2011 23:53:53 +0000 (23:53 +0000)]
MFC: r226381

Merge from NetBSD:
- Remove clause 3 and 4 from TNF licenses.
- Fix memset usage.
- Various cleanup.
- Kill caddr_t.

Approved by: re (kib)

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

12 years agoMerge from r225950:
marius [Sat, 29 Oct 2011 22:06:53 +0000 (22:06 +0000)]
Merge from r225950:

Set the sense residual properly.

Reviewed by: ken
Approved by: re (kib)

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

12 years agoMFC r226673:
marcel [Sat, 29 Oct 2011 16:38:04 +0000 (16:38 +0000)]
MFC r226673:
Don't terminate the interactive root mount prompt on mount failure.
This restores the previous behaviour. While here, match '?' and '.'
inputs exactly and improve the error message.

Requested by: avg@
Derived from a patch by: Arnaud Lacombe <lacombar@gmail.com>
Approved by: re (kib@)

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