]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/log
FreeBSD/stable/8.git
14 years agoMFC r196456,r196457,r196458,r196662,r196702,r196703,r196919,r196927,r196928,
pjd [Tue, 15 Sep 2009 11:13:40 +0000 (11:13 +0000)]
MFC r196456,r196457,r196458,r196662,r196702,r196703,r196919,r196927,r196928,
r196943,r196944,r196947,r196950,r196953,r196954,r196965,r196978,r196979,
r196980,r196982,r196985,r196992,r197131,r197133,r197150,r197151,r197152,
r197153,r197167,r197172,r197177,r197200,r197201:

r196456:
- Give minclsyspri and maxclsyspri real values (consulted with kmacy).
- Honour 'pri' argument for thread_create().

r196457:
Set priority of vdev_geom threads and zvol threads to PRIBIO.

r196458:
- Hide ZFS kernel threads under zfskern process.
- Use better (shorter) threads names:
'zvol:worker zvol/tank/vol00' -> 'zvol tank/vol00'
'vdev:worker da0' -> 'vdev da0'

r196662:
Add missing mountpoint vnode locking.
This fixes panic on assertion with DEBUG_VFS_LOCKS and vfs.usermount=1 when
regular user tries to mount dataset owned by him.

r196702:
Remove empty directory.

r196703:
Backport the 'dirtying dbuf' panic fix from newer ZFS version.

Reported by: Thomas Backman <serenity@exscape.org>

r196919:
bzero() on-stack argument, so mutex_init() won't misinterpret that the
lock is already initialized if we have some garbage on the stack.

PR: kern/135480
Reported by: Emil Mikulic <emikulic@gmail.com>

r196927:
Changing provider size is not really supported by GEOM, but doing so when
provider is closed should be ok.
When administrator requests to change ZVOL size do it immediately if ZVOL
is closed or do it on last ZVOL close.

PR: kern/136942
Requested by: Bernard Buri <bsd@ask-us.at>

r196928:
Teach zdb(8) how to obtain GEOM provider size.

PR: kern/133134
Reported by: Philipp Wuensche <cryx-freebsd@h3q.com>

r196943:
- Avoid holding mutex around M_WAITOK allocations.
- Add locking for mnt_opt field.

r196944:
Don't recheck ownership on update mount. This will eliminate LOR between
vfs_busy() and mount mutex. We check ownership in vfs_domount() anyway.

Noticed by: kib
Reviewed by: kib

r196947:
Defer thread start until we set priority.

Reviewed by: kib

r196950:
Fix detection of file system being shared. Now zfs unshare/destroy/rename
command will properly remove exported file systems.

r196953:
When snapshot mount point is busy (for example we are still in it)
we will fail to unmount it, but it won't be removed from the tree,
so in that case there is no need to reinsert it.

Reported by: trasz

r196954:
If we have to use avl_find(), optimize a bit and use avl_insert() instead of
avl_add() (the latter is actually a wrapper around avl_find() + avl_insert()).
Fix similar case in the code that is currently commented out.

r196965:
Fix reference count leak for a case where snapshot's mount point is updated.

r196978:
Call ZFS_EXIT() after locking the vnode.

r196979:
On FreeBSD we don't have to look for snapshot's mount point,
because fhtovp method is already called with proper mount point.

r196980:
When we automatically mount snapshot we want to return vnode of the mount point
from the lookup and not covered vnode. This is one of the fixes for using .zfs/
over NFS.

r196982:
We don't export individual snapshots, so mnt_export field in snapshot's
mount point is NULL. That's why when we try to access snapshots over NFS
use mnt_export field from the parent file system.

r196985:
Only log successful commands! Without this fix we log even unsuccessful
commands executed by unprivileged users. Action is not really taken, but it is
logged to pool history, which might be confusing.

Reported by: Denis Ahrens <denis@h3q.com>

r196992:
Implement __assert() for Solaris-specific code. Until now Solaris code was
using Solaris prototype for __assert(), but FreeBSD's implementation.
Both take different arguments, so we were either core-dumping in assert()
or printing garbage.

Reported by: avg

r197131:
Tighten up the check for race in zfs_zget() - ZTOV(zp) can not only contain
NULL, but also can point to dead vnode, take that into account.

PR: kern/132068
Reported by: Edward Fisk <7ogcg7g02@sneakemail.com>, kris
Fix based on patch from: Jaakko Heinonen <jh@saunalahti.fi>

r197133:
- Protect reclaim with z_teardown_inactive_lock.
- Be prepared for dbuf to disappear in zfs_reclaim_complete() and check if
  z_dbuf field is NULL - this might happen in case of rollback or forced
  unmount between zfs_freebsd_reclaim() and zfs_reclaim_complete().
- On forced unmount wait for all znodes to be destroyed - destruction can be
  done asynchronously via zfs_reclaim_complete().

r197150:
There is a bug where mze_insert() can trigger an assert() of inserting
the same entry twice. This bug is not fixed yet, but leads to situation
where when try to access corrupted directory the kernel will panic.
Until the bug is properly fixed, try to recover from it and log that it
happened.

Reported by: marck
OpenSolaris bug: 6709336

r197151:
Be sure not to overflow struct fid.

r197152:
Extend scope of the z_teardown_lock lock for consistency and "just in case".

r197153:
When zfs.ko is compiled with debug, make sure that znode and vnode point at
each other.

r197167:
Work-around READDIRPLUS problem with .zfs/ and .zfs/snapshot/ directories
by just returning EOPNOTSUPP. This will allow NFS server to fall back to
regular READDIR.
Note that converting inode number to snapshot's vnode is expensive operation.
Snapshots are stored in AVL tree, but based on their names, not inode numbers,
so to convert inode to snapshot vnode we have to interate over all snalshots.
This is not a problem in OpenSolaris, because in their READDIRPLUS
implementation they use VOP_LOOKUP() on d_name, instead of VFS_VGET() on
d_fileno as we do.

PR: kern/125149
Reported by: Weldon Godfrey <wgodfrey@ena.com>
Analysis by: Jaakko Heinonen <jh@saunalahti.fi>

r197172:
Add missing \n.

Reported by: marck

r197177:
Support both case: when snapshot is already mounted and when it is not yet
mounted.

r197200:
Modify mount(8) to skip MNT_IGNORE file systems by default, just like df(1)
does. This is not POLA violation, because there is no single file system in the
base that use MNT_IGNORE currently, although ZFS snapshots will be mounted with
MNT_IGNORE after next commit.

Reviewed by: kib

r197201:
- Mount ZFS snapshots with MNT_IGNORE flag, so they are not visible in regular
  df(1) and mount(8) output. This is a bit smilar to OpenSolaris and follows
  ZFS route of not listing snapshots by default with 'zfs list' command.
- Add UPDATING entry to note that ZFS snapshots are no longer visible in
  mount(8) and df(1) output by default.

Reviewed by: kib

Approved by: re (bz)

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

14 years agoFix botched mergeinfo.
jhb [Mon, 14 Sep 2009 17:49:59 +0000 (17:49 +0000)]
Fix botched mergeinfo.

Approved by: re (kib, bz)

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

14 years agoMFC 197062:
jhb [Mon, 14 Sep 2009 16:13:12 +0000 (16:13 +0000)]
MFC 197062:
Don't malloc a buffer while holding the prison0 mutex.  Instead, use a loop
where we figure out the hostname length under the lock, malloc the buffer
with the lock dropped, then recheck the length under the lock and loop again
if the buffer is now too small.

Approved by: re (kib)

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

14 years agoMFC r197048:
rmacklem [Mon, 14 Sep 2009 15:16:17 +0000 (15:16 +0000)]
MFC r197048:
Add LK_NOWITNESS to the vn_lock() calls done on newly created nfs
vnodes, since these nodes are not linked into the mount queue and,
as such, the vn_lock() cannot cause a deadlock so LORs are harmless.

Suggested by: kib
Approved by: re (kensmith), kib (mentor)

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

14 years agoMFC r196921:
kib [Mon, 14 Sep 2009 11:01:15 +0000 (11:01 +0000)]
MFC r196921:
Do not decrement pfs_vncache_entries for the vnode that was not in the
pfs_vncache list.

Approved by: re (bz)

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

14 years agoMFC r196652: Fix the problem that the entry broke into two lines
ume [Sun, 13 Sep 2009 17:01:34 +0000 (17:01 +0000)]
MFC r196652: Fix the problem that the entry broke into two lines
with multi-byte AM/PM date format.

Approved by: re (kib)

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

14 years agoMFC r196651: AM/PM date format for ja_JP.eucJP and ja_JP.SJIS were
ume [Sun, 13 Sep 2009 17:00:21 +0000 (17:00 +0000)]
MFC r196651: AM/PM date format for ja_JP.eucJP and ja_JP.SJIS were
localized by r193869.  However, ja_JP.UTF-8 wasn't.  So, reflect it
to ja_JP.UTF-8 as well.

Approved by: re (kib)

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

14 years agoMFC r196475:
ume [Sun, 13 Sep 2009 11:34:33 +0000 (11:34 +0000)]
MFC r196475:
 - Add AS lookup functionality to traceroute6(8) as well.
 - Support for IPv6 transport for AS lookup.
 - Introduce $RA_SERVER to set whois server.
 - Support for 4 byte ASN.
 - ANSIfy function declaration in as.c.

Approved by: re (kib)

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

14 years agoMFC r196929: Suppress an options line when no bit is on.
ume [Sun, 13 Sep 2009 11:31:25 +0000 (11:31 +0000)]
MFC r196929: Suppress an options line when no bit is on.

Approved by: re (kib)

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

14 years agoMFC r196889:
nork [Sun, 13 Sep 2009 10:04:08 +0000 (10:04 +0000)]
MFC r196889:
Change 'dev.cpu.N.temperature', sysctl I (degC) to IK (Kelvin),
to match acpi_thermal(4) and amdtemp(4).

Approved by: re (rwatson)
Reviewed by: rpaulo
Suggested by: ume

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

14 years agoMFC r196861:
kib [Sat, 12 Sep 2009 18:16:46 +0000 (18:16 +0000)]
MFC r196861:
Handle zero size for posix_memalign. Return NULL or unique address
according to the 'V' option.

Approved by: re (kensmith)

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

14 years agoMFC r197046:
kib [Sat, 12 Sep 2009 18:11:48 +0000 (18:11 +0000)]
MFC r197046:
As was done in r196643 for i386 and amd64, swap the start/end virtual
addresses in pmap_invalidate_cache_range().

Approved by: re (kensmith)

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

14 years agoMFC 196610:
tuexen [Sat, 12 Sep 2009 18:08:44 +0000 (18:08 +0000)]
MFC 196610:
Fix a bug where vlan interfaces are not supported by SCTP.

Approved by: re, rrs (mentor)

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

14 years agoMFC r197031:
kib [Sat, 12 Sep 2009 18:05:57 +0000 (18:05 +0000)]
MFC r197031:
Unlock the image vnode around the call of pmc PMC_FN_PROCESS_EXEC hook.
The hook calls vn_fullpath(9), that should not be executed with a vnode
lock held.

Approved by: re (kensmith)

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

14 years agoMFC r197030:
kib [Sat, 12 Sep 2009 18:02:57 +0000 (18:02 +0000)]
MFC r197030:
In vfs_mark_atime(9), be resistent against reclaimed vnodes.
Assert that neccessary locks are taken, since vop might not be called.

Approved by: re (kensmith)

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

14 years agoThis fixes a bug where the value set by SCTP_PARTIAL_DELIVERY_POINT
tuexen [Sat, 12 Sep 2009 17:58:15 +0000 (17:58 +0000)]
This fixes a bug where the value set by SCTP_PARTIAL_DELIVERY_POINT
was not honored, if the socket buffer size was not 4 times that large.
MFC of 196509.

Approved by: re, rrs (mentor)`

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

14 years agoThis fixes kern/138516, an mbuf leak in both the em
jfv [Fri, 11 Sep 2009 16:53:12 +0000 (16:53 +0000)]
This fixes kern/138516, an mbuf leak in both the em
and igb driver, when a transmit fails the packet/mbuf
was not being requeued. Thanks to those that pointed
this problem out.

Approved by:  re

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

14 years agoMFC r196932:
syrinx [Fri, 11 Sep 2009 15:07:36 +0000 (15:07 +0000)]
MFC r196932:

When joining a multicast group, the inp_lookup_mcast_ifp call
does a KASSERT that the group address is multicast, so the
check if this is indeed true and eventually return a EINVAL if not,
should be done before calling inp_lookup_mcast_ifp. This fixes a kernel
crash when calling setsockopt (sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,...)
with invalid group address.

Reviewed by: bms
Approved by: re (kib)

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

14 years agoMFC r196942:
kensmith [Fri, 11 Sep 2009 13:46:28 +0000 (13:46 +0000)]
MFC r196942:
> Bring the layout of package-split.py more in line with where we're going
> with packages on the release media.  It looks like we'll be putting just
> the doc packages on the new "memory stick" image as well as disc1.  There
> will be no other packages on the CDROM-sized media.  The DVD sized media
> will include the doc packages plus whatever other packages we decide to
> make part of the release.
>
> This commit just brings the basic structure in line with being able to
> do this.  We still need to discuss with various people exactly which
> packages will be included on the DVD.
>
> If the environement variable "PKG_DVD" is set a tree suitable for the
> DVD media is generated.  Otherwise a tree suitable for the "memory stick"
> and disc1 is generated.

Approved by: re (kib)

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

14 years agoMFC r196966:
kib [Fri, 11 Sep 2009 12:56:13 +0000 (12:56 +0000)]
MFC r196966:
Lock Giant around vn_open_cred().
Remove innocent unnecessary call to NDFREE().

Approved by: re (kensmith)

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

14 years agoMove mergeinfo for 196772 up to sys/.
jhb [Thu, 10 Sep 2009 14:24:11 +0000 (14:24 +0000)]
Move mergeinfo for 196772 up to sys/.

Approved by: re (kib)

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

14 years agoRemove extra debugging support that is turned on for head but turned off
kensmith [Thu, 10 Sep 2009 14:04:00 +0000 (14:04 +0000)]
Remove extra debugging support that is turned on for head but turned off
for stable branches:

- shift to MALLOC_PRODUCTION
- turn off automatic crash dumps
- Remove kernel debuggers, INVARIANTS*[1], WITNESS* from
  GENERIC kernel config files[2]

[1] INVARIANTS* left on for ia64 by request marcel
[2] sun4v was left as-is

Reviewed by: marcel, kib
Approved by: re (implicit)

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

14 years agoMFC r196920:
kib [Thu, 10 Sep 2009 12:42:36 +0000 (12:42 +0000)]
MFC r196920:
insmntque_stddtr() clears vp->v_data and resets vp->v_op to
dead_vnodeops before calling vgone(). Revert r189706 and corresponding
part of the r186560.

Approved by: re (kensmith)

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

14 years agoMFC r196916:
attilio [Thu, 10 Sep 2009 11:27:07 +0000 (11:27 +0000)]
MFC r196916:
Fix a list overrun.

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

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

14 years agoMFC r196887:
kib [Wed, 9 Sep 2009 13:28:18 +0000 (13:28 +0000)]
MFC r196887:
In fhopen, vfs_ref() the mount point while vnode is unlocked, to prevent
vn_start_write(NULL, &mp) from operating on potentially freed or reused
struct mount *.

Remove unmatched vfs_rel() in cleanup.

Approved by: re (kensmith)

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

14 years agoMFC of r196581 r196582 r197000
edwin [Wed, 9 Sep 2009 12:19:43 +0000 (12:19 +0000)]
MFC of r196581 r196582 r197000
Import of tzdata 2009k, 2009l and 2009m

- Changes in Mauritius and Bangladesh
- No leapsecond at the end of December 2009

- Egypt will go to Wintertime on 21 August 2009

- Samoa will go in DST on 4 October 2009 till 28 March 2010
- Palestine will go back from DST on 4 September 2009

Approved by: re (kostik)

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

14 years agoUse traditional td_unusedX names for the padding members.
kib [Wed, 9 Sep 2009 10:31:09 +0000 (10:31 +0000)]
Use traditional td_unusedX names for the padding members.

Suggested by: julian
Approved by: re (kensmith)

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

14 years agoAdaptive spinning for locking primitives, in read-mode, have some tuning
attilio [Wed, 9 Sep 2009 09:34:13 +0000 (09:34 +0000)]
Adaptive spinning for locking primitives, in read-mode, have some tuning
SYSCTLs which are inappropriate for a daily use of the machine (mostly
useful only by a developer which wants to run benchmarks on it).
Remove them before the release as long as we do not want to ship with
them in.

Now that the SYSCTLs are gone, instead than use static storage for some
constants, use real numeric constants in order to avoid eventual compiler
dumbiness and the risk to share a storage (and then a cache-line) among
CPUs when doing adaptive spinning together.

Pleasse note that the sys/linker_set.h inclusion in lockmgr and sx lock
support could have been gone, but re@ preferred them to be in order to
minimize the risk of problems on future merging.

Please note that this patch is not a MFC, but an 'edge case' as commit
directly to stable/8, which creates a diverging from HEAD.

Tested by:      Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
Approved by: re (kib)

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

14 years agoMFC r196772:
attilio [Wed, 9 Sep 2009 09:17:31 +0000 (09:17 +0000)]
MFC r196772:
fix adaptive spinning in lockmgr by using correctly GIANT_RESTORE and
continue statement and improve adaptive spinning for sx lock by just
doing once GIANT_SAVE.

Approved by: re (kib)

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

14 years agoMake LRO turned off uncategorically for devices
jfv [Tue, 8 Sep 2009 23:25:39 +0000 (23:25 +0000)]
Make LRO turned off uncategorically for devices
attached to the bridge, rather than just in the case
when some device cannot do TSO. Customer tests have
shown that even when all devices can do TSO that LRO
will cause problems when bridging.

Approved by:  re

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

14 years agoMFC 196745:
jhb [Tue, 8 Sep 2009 21:50:34 +0000 (21:50 +0000)]
MFC 196745:
Don't attempt to bind the current thread to the CPU an IRQ is bound to
when removing an interrupt handler from an IRQ during shutdown.  During
shutdown we are already bound to CPU 0 and this was triggering a panic.

Approved by: re (kib)

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

14 years agoMFC r196835:
jamie [Tue, 8 Sep 2009 19:18:02 +0000 (19:18 +0000)]
MFC r196835:
  Allow a jail's name to be the same as its jid (which is the default if
  no name is specified), and let a numeric name specify the jid for a new
  jail when the jid isn't otherwise set.  Still disallow other numeric
  names.

Reviewed by: zec
Approved by: re (kib), bz (mentor)

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

14 years agoMFC r196730:
kib [Tue, 8 Sep 2009 15:31:23 +0000 (15:31 +0000)]
MFC r196730:
Remove the altkstacks, instead instantiate threads with kernel stack
allocated with the right size from the start. For the thread that has
kernel stack cached, verify that requested stack size is equial to the
actual, and reallocate the stack if sizes differ.

Introduce separate kernel stack cache that keeps some limited amount of
preallocated kernel stacks to lower the latency of thread allocation.

Not a merge: instead of removing td_altkstack* members of struct thread,
replace them with placeholders to keep struct thread layout on the
stable branch.

Also, record r196640, r196644 and r196648 as merged.

Approved by: re (kensmith)

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

14 years agoMFC r196692:
kib [Tue, 8 Sep 2009 14:43:42 +0000 (14:43 +0000)]
MFC r196692:
Make the mnt_writeopcount and mnt_secondary_writes counters,
used by the suspension code, not greater then mnt_ref reference
counter value.

MFC r196733:
Fix mount reference leak when V_XSLEEP is specified to vn_start_write().

Approved by: re (kensmith)

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

14 years agoMFC r196717:
sam [Mon, 7 Sep 2009 16:41:18 +0000 (16:41 +0000)]
MFC r196717:
    fix beacon timers on resume in sta mode so raoming works

Approved by: re (kensmith)

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

14 years agoMFC r196785:
sam [Mon, 7 Sep 2009 16:33:27 +0000 (16:33 +0000)]
MFC r196785:
    correct timeout for doing NOL processing; need a ticks-relative value

Approved by: re (kensmith)

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

14 years agoMFC r196579:
pjd [Mon, 7 Sep 2009 16:25:09 +0000 (16:25 +0000)]
MFC r196579:

Fix an obvious topology lock leak.

Approved by: re (kib)

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

14 years agoMFC r196787
remko [Mon, 7 Sep 2009 14:10:55 +0000 (14:10 +0000)]
MFC r196787

  Do the first step in removing lukemftpd from the base system. Disconnect
  it from the build.

  If you are using the FTP daemon, please consider using the port ftp/tnftpd
  which is the same FTP server, but newer and might have more/better
  functionality.

  This results in us providing only one ftp daemon by default.

  Reviewed by:        bz
  Approved by:        imp (mentor, implicit)
  MFC after:        3 days
  Silence from:        obrien

Approved by: re (kib), imp (mentor, implicit)

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

14 years agoMFC r196831:
mav [Sun, 6 Sep 2009 14:05:01 +0000 (14:05 +0000)]
MFC r196831:
Add to `camcontrol cmd` support for sending arbitrary ATA commands.

It could be used for broad range of tasks, such as configuring drive
power management, caching, security and any other features and tasks,
not supported by existing drivers.

Approved by: re (ATA-CAM blanket)

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

14 years agoMFC of r196477
julian [Sun, 6 Sep 2009 06:05:23 +0000 (06:05 +0000)]
MFC of r196477
 Don't delete copies of nthread_create(9) we find inthe filesystem.
 we now link it to kproc_create(9), it's new name.

Approved by: re (kib)

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

14 years agoMFC r196871
qingli [Sat, 5 Sep 2009 20:35:18 +0000 (20:35 +0000)]
MFC r196871

The addresses that are assigned to the loopback interface
should be part of the kernel routing table.

Reviewed by: bz
Approved by: re

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

14 years agoMFC r196864
qingli [Sat, 5 Sep 2009 17:40:27 +0000 (17:40 +0000)]
MFC r196864

This patch fixes the following issues:
- Interface link-local address is not reachable within the
  node that owns the interface, this is due to the mismatch
  in address scope as the result of the installed interface
  address loopback route. Therefore for each interface
  address loopback route, the rt_gateway field (of AF_LINK
  type) will be used to track which interface a given
  address belongs to. This will aid the address source to
  use the proper interface for address scope/zone validation.
- The loopback address is not reachable. The root cause is
  the same as the above.
- Empty nd6 entries are created for the IPv6 loopback addresses
  only for validation reason. Doing so will eliminate as much
  of the special case (loopback addresses) handling code
  as possible, however, these empty nd6 entries should not
  be returned to the userland applications such as the
  "ndp" command.
Since both of the above issues contain common files, these
files are committed together.

Reviewed by: bz
Approved by: re

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

14 years agoMFC r196865
qingli [Sat, 5 Sep 2009 17:35:31 +0000 (17:35 +0000)]
MFC r196865

This patch fixes an address scope violation. Considering the
scenario where an anycast address is assigned on one interface,
and a global address with the same scope is assigned on another
interface. In other words, the interface owns the anycast
address has only the link-local address as one other address.
Without this patch, "ping6" the anycast address from another
station will observe the source address of the returned ICMP6
echo reply has the link-local address, not the global address
that exists on the other interface in the same node.

Reviewed by:    bz
Approved by: re

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

14 years agoMFC r196866:
bz [Sat, 5 Sep 2009 17:29:08 +0000 (17:29 +0000)]
MFC r196866:
  In the NEXTADDR macro use SA_SIZE() rather than directly using
  sizeof(), as introduced in r186119, for advancing the current
  position into the buffer.
  See comment in net/route.h for a description of the difference.
  This makes ndp -s work again.

   Reviewed by: qingli

Approved by: re (kib)

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

14 years agoMFC r196740:
trasz [Sat, 5 Sep 2009 15:01:56 +0000 (15:01 +0000)]
MFC r196740:

Fix regression introduced with NFSv4 ACL support - make acl_to_text(3)
and acl_calc_mask(3) return error instead of crashing when acl passed
to them is NULL.

Submitted by: markus
Reviewed by: rwatson
Approved by: re (kib)

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

14 years agoMFC r196689:
kib [Sat, 5 Sep 2009 13:10:54 +0000 (13:10 +0000)]
MFC r196689:
Remove spurious pfs_unlock().

Approved by: re (rwatson)

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

14 years agoMFC r196529:
imp [Sat, 5 Sep 2009 08:03:29 +0000 (08:03 +0000)]
MFC r196529:
  Rather than having enabled/disabled, implement a max queue depth.
  While usually not an issue, this firewalls bugs in the code that may
  run us out of memory.

  Fix a memory exhaustion in the case where devctl was disabled, but the
  link was bouncing.  The check to queue was in the wrong place.

  Implement a new sysctl hw.bus.devctl_queue to control the depth.  Make
  compatibility hacks for hw.bus.devctl_disable to ease transition.

  Reviewed by: emaste@
  Approved by: re@ (kib)
  MFC after: asap

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

14 years agoMFC r196777, r196796:
mav [Sat, 5 Sep 2009 06:24:28 +0000 (06:24 +0000)]
MFC r196777, r196796:
ATI SB600 can't handle 256 sectors transfers with FPDMA (NCQ).

Approved by: re (ATA-CAM blanket)

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

14 years agoReady for BETA4.
kensmith [Sat, 5 Sep 2009 00:50:08 +0000 (00:50 +0000)]
Ready for BETA4.

Approved by: re (implicit)

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

14 years agoThis patch seperates the control of header split from LRO (which it
jfv [Fri, 4 Sep 2009 22:37:03 +0000 (22:37 +0000)]
This patch seperates the control of header split from LRO (which it
was previously dependent on), LRO gets turned off when bridging but
its been found that header split is still a performance win in that case.

Secondly, there was some interface specific control in stats code that
has been missing, and a logic error that resulted in bogus reporting.
Thanks to Manish and John of LineRateSystems for the report and help in
this code.

Approved by: re

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

14 years agoMFC r196721:
yongari [Fri, 4 Sep 2009 16:41:17 +0000 (16:41 +0000)]
MFC r196721:
  Make sure rx descriptor ring align on 16 bytes. I guess the
  alignment requirement could be multiple of 4 bytes but I think
  using descriptor size would make intention clearer.
  Previously the size of rx descriptor was not power of 2 so it
  caused panic in bus_dmamem_alloc(9).

  Reported by: Jeff Blank (jb000003 <> mr-happy dot com)
Approved by: re (kib)

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

14 years ago- MFC r196568:
stas [Fri, 4 Sep 2009 11:32:05 +0000 (11:32 +0000)]
- MFC r196568:
  - Add quirk for Sony DSC digital cameras.  This umass devices fail
    to attach without these quirks applied.

Approved by: re (kib)

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

14 years agoMFC r196450
julian [Fri, 4 Sep 2009 07:13:07 +0000 (07:13 +0000)]
MFC r196450

   Add clarifications to the kproc and kthread manpages and link
   the kthread_create(9) man page to the kproc(9) page as it has migrated and
   people looking for it may need a hand to find its new name.

Approved by: re (kib)

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

14 years agoMFC r196809:
weongyo [Fri, 4 Sep 2009 05:37:49 +0000 (05:37 +0000)]
MFC r196809:
  fix a TX issue on big endian machines like powerpc or sparc64.  Now
  zyd(4) should work on all architectures.

  Obtained from: OpenBSD

Approved by: re (kib)

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

14 years agoMFC 196705 and 196707:
jhb [Thu, 3 Sep 2009 13:54:58 +0000 (13:54 +0000)]
MFC 196705 and 196707:
- Improve pmap_change_attr() on i386 so that it is able to demote a large
  (2/4MB) page into 4KB pages as needed.  This should be fairly rare in
  practice.
- Simplify pmap_change_attr() a bit:
  - Always calculate the cache bits instead of doing it on-demand.
  - Always set changed to TRUE rather than only doing it if it is false.

Approved by: re (kib)

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

14 years agoMFC r196738:
bz [Wed, 2 Sep 2009 16:35:57 +0000 (16:35 +0000)]
MFC r196738:
  In case an upper layer protocol tries to send a packet but the
  L2 code does not have the ethernet address for the destination
  within the broadcast domain in the table, we remember the
  original mbuf in `la_hold' in arpresolve() and send out a
  different packet with an arp request.
  In case there will be more upper layer packets to send we will
  free an earlier one held in `la_hold' and queue the new one.

  Once we get a packet in, with which we can perfect our arp table
  entry we send out the original 'on hold' packet, should there
  be any.
  Rather than continuing to process the packet that we received,
  we returned without freeing the packet that came in, which
  basically means that we leaked an mbuf for every arp request
  we sent.

  Rather than freeing the received packet and returning, continue
  to process the incoming arp packet as well.
  This should (a) improve some setups, also proxy-arp, in case it was an
  incoming arp request and (b) resembles the behaviour FreeBSD had
  from day 1, which alignes with RFC826 "Packet reception" (merge case).

  Rename 'm0' to 'hold' to make the code more understandable as
  well as diffable to earlier versions more easily.

  Handle the link-layer entry 'la' lock comepletely in the block
  where needed and release it as early as possible, rather than
  holding it longer, down to the end of the function.

  Found by: pointyhat, ns1
  Bug hunting session with: erwin, simon, rwatson
  Tested by: simon on cluster machines
  Reviewed by: ratson, kmacy, julian

Approved by: re (kib)

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

14 years agoMFC r196653:
bz [Wed, 2 Sep 2009 10:39:46 +0000 (10:39 +0000)]
MFC r196653:
  Make sure FreeBSD binaries without .note.ABI-tag section work
  correctly and do not match a colliding Debian GNU/kFreeBSD
  brandinfo statements.
  For this mark the Debian GNU/kFreeBSD brandinfo that it must have
  an .note.ABI-tag section and ignore the old EI_OSABI brandinfo
  when comparing a possibly colliding set of options.

  Due to SYSINIT we add the brandinfo in a non-deterministic order,
  so native FreeBSD is not always first. We may want to consider
  to force native FreeBSD to come first as well.

  The only way a problem could currently be noticed is when running an
  i386 binary without the .note.ABI-tag on amd64 and the Debian GNU/kFreeBSD
  brandinfo  was matched first,  as the fallback to ld-elf32.so.1 does
  not exist in that case.

Reported and tested by: ticso
In collaboration with: kib
MFC after: 3 days
Approved by: re (rwatson)

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

14 years agoMFC: r196489,196498
alfred [Wed, 2 Sep 2009 02:12:07 +0000 (02:12 +0000)]
MFC: r196489,196498
Critical USB bugfixes for 8.0

Approved by:    re

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

14 years agoMFC r196460
jilles [Tue, 1 Sep 2009 20:58:41 +0000 (20:58 +0000)]
MFC r196460

  Fix the conformance of poll(2) for sockets after r195423 by
  returning POLLHUP instead of POLLIN for several cases. Now, the
  tools/regression/poll results for FreeBSD are closer to that of the
  Solaris and Linux.

  Also, improve the POSIX conformance by explicitely clearing POLLOUT
  when POLLHUP is reported in pollscan(), making the fix global.

  Submitted by: bde
  Reviewed by: rwatson

MFC r196556

  Fix poll() on half-closed sockets, while retaining POLLHUP for fifos.

  This reverts part of r196460, so that sockets only return POLLHUP if both
  directions are closed/error. Fifos get POLLHUP by closing the unused
  direction immediately after creating the sockets.

  The tools/regression/poll/*poll.c tests now pass except for two other
  things:
  - if POLLHUP is returned, POLLIN is always returned as well instead of
    only when there is data left in the buffer to be read
  - fifo old/new reader distinction does not work the way POSIX specs it

  Reviewed by: kib, bde

MFC r196554

  Add some tests for poll(2)/shutdown(2) interaction.

Approved by: re (kensmith)

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

14 years agoMFC 196643
rnoland [Tue, 1 Sep 2009 16:41:28 +0000 (16:41 +0000)]
MFC 196643

Swap the start/end virtual addresses in pmap_invalidate_cache_range().

This fixes the functionality on non SelfSnoop hardware.

Found by: rnoland
Submitted by: alc
Reviewed by: kib
Approved by: re (rwatson)

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

14 years agoMFC 196637:
jhb [Tue, 1 Sep 2009 15:50:07 +0000 (15:50 +0000)]
MFC 196637:
Mark the fake pages constructed by the OBJT_SG pager valid.  This was
accidentally lost at one point during the PAT development.  Without this
fix vm_pager_get_pages() was zeroing each of the pages.

Approved by: re (kib)

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

14 years agoMFC r196657:
mav [Tue, 1 Sep 2009 12:04:43 +0000 (12:04 +0000)]
MFC r196657:
ATA_FLUSHCACHE is a 28bit format command, not 48.

MFC r196658:
Improve camcontrol ATA support:
 - Tune protocol version reporting,
 - Add supported DMA/PIO modes reporting.
 - Fix IDENTIFY request for ATAPI devices.
 - Remove confusing "-" for NCQ status.

MFC r196659:
Short ATA command format has 28bit address, not 36bit.
Rename ata_36bit_cmd() into ata_28bit_cmd(), while it didn't become legacy.

Approved by: re (ATA-CAM blanket)

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

14 years agoMFC r196656, r196660:
mav [Tue, 1 Sep 2009 11:44:30 +0000 (11:44 +0000)]
MFC r196656, r196660:
Update ahci driver:
 - Add Command Completion Coalescing support.
 - Add SNTF support.
 - Add two more power management modes (4, 5), implemented on driver level.
 - Fix interface mode setting.
 - Reduce interface reset time.
 - Do not report meaningless protocol/transport versions.
 - Report CAP2 register content.
 - Some performance optimizations.

Approved by: re (ATA-CAM blanket)

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

14 years agoMFC r196655:
mav [Tue, 1 Sep 2009 11:13:31 +0000 (11:13 +0000)]
MFC r196655:
Update siis driver:
 - Add SNTF support.
 - Do not report meaningless transport/protocol versions.

Approved by: re (ATA-CAM blanket)

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

14 years agoAdd a temporary workaround which just lets init die instead of
marius [Mon, 31 Aug 2009 19:16:58 +0000 (19:16 +0000)]
Add a temporary workaround which just lets init die instead of
causing a panic if it is killed due to a unsolved stack overflow
seen very late during shutdown on sparc64 when the gmirror worker
process exists, which is a regression introduced in 8.0.

Reviewed by: kib
Approved by: re (rwatson)

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

14 years agoMFC r196592:
jamie [Mon, 31 Aug 2009 14:13:45 +0000 (14:13 +0000)]
MFC r196592:
  Fix a LOR between allprison_lock and vnode locks by releasing
  allprison_lock before releasing a prison's root vnode.

PR: kern/138004
Reviewed by: kib
Approved by: re (rwatson), bz (mentor)

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

14 years agoMFC r196558: Don't try to mmap the contents of empty files. This behaviour
cperciva [Mon, 31 Aug 2009 13:02:21 +0000 (13:02 +0000)]
MFC r196558: Don't try to mmap the contents of empty files.  This behaviour
was harmless prior to r195693, when mmap(2) changed from silently ignoring
requests for mapping zero bytes to returning EINVAL; this commit can be seen
as adjusting for the change in mmap(2) in order to make look(1) act like it
did previously.

Reviewed by: jhb
Approved by: re (kib)

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

14 years agoMFC r196455:
rpaulo [Mon, 31 Aug 2009 12:25:04 +0000 (12:25 +0000)]
MFC r196455:
 Make dev.asmc.N.light.control writable by everyone.

Submitted by: Patrick Lamaiziere <patfbsd at davenulle.org>
Approved by: re (rwatson)

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

14 years agoMFC r196635:
zec [Mon, 31 Aug 2009 09:46:09 +0000 (09:46 +0000)]
MFC r196635:

  Fix a few panics in linuxulator + VIMAGE due to curvnet not being set.

  This change affects only options VIMAGE builds.

  Reviewed by:  julian

Approved by: re (rwatson)

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

14 years agoMFC r196633:
zec [Mon, 31 Aug 2009 09:44:07 +0000 (09:44 +0000)]
MFC r196633:

  Introduce a separate sx lock for protecting lists of vnet sysinit
  and sysuninit handlers.

  Previously, sx_vnet, which is a lock designated for protecting
  the vnet list, was (ab)used for protecting vnet sysinit / sysuninit
  handler lists as well.  Holding exclusively the sx_vnet lock while
  invoking sysinit and / or sysuninit handlers turned out to be
  problematic, since some of the handlers may attempt to wake up
  another thread and wait for it to walk over the vnet list, hence
  acquire a shared lock on sx_vnet, which in turn leads to a deadlock.
  Protecting vnet sysinit / sysuninit lists with a separate lock
  mitigates this issue, which was first observed with
  flowtable_flush() / flowtable_cleaner() in sys/net/flowtable.c.

  Reviewed by:  rwatson, jhb
  MFC after:    3 days

Approved by: re (rwatson)

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

14 years agoMFC r196560:
kib [Mon, 31 Aug 2009 09:08:14 +0000 (09:08 +0000)]
MFC r196560:
Honor the vfs.timestamp_precision sysctl settings for utimes(path, NULL)
and similar calls.

Approved by: re (rwatson)

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

14 years agoAs part of r196609, a call to "rtalloc" did not take the fib into
qingli [Mon, 31 Aug 2009 00:18:17 +0000 (00:18 +0000)]
As part of r196609, a call to  "rtalloc" did not take the fib into
account. So call the appropriate "rtalloc_ign_fib()" instead of
calling "rtalloc_ign()".

Reviewed by: pointed out by bz
Approved by: re

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

14 years agoMFC r196649
qingli [Sun, 30 Aug 2009 22:44:12 +0000 (22:44 +0000)]
MFC r196649

Prefix on-link verification is being performed on statically
configured prefixes. Since these statically configured prefixes
do not have any associated advertising routers, these prefixes
are treated as unreachable and those prefix routes are deleted
from the routing table. Therefore bypass prefixes that are not
learned from router advertisements during prefix on-link check.

Reviewed by: hrs
Approved by: re

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

14 years agoMFC r196609
qingli [Sun, 30 Aug 2009 22:42:32 +0000 (22:42 +0000)]
MFC r196609

In ip_output(), the flow-table module must not try to cache L2/L3
information for interface of IFF_POINTOPOINT or IFF_LOOPBACK type.
Since the L2 information (rt_lle) is invalid for these interface
types, accidental caching attempt will trigger panic when the invalid
rt_lle reference is accessed.

When installing a new route, or when updating an existing route, the
user supplied gateway address may be an interface address (this is
particularly true for point-to-point interface related modules such
as ppp, if_tun, if_gif). Currently the routing command handler always
set the RTF_GATEWAY flag if the gateway address is given as part of the
command paramters. Therefore the gateway address must be verified against
interface addresses or else the route would be treated as an indirect
route, thus making that route unusable.

Reviewed by: kmacy, julian, rwatson
Approved by: re

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

14 years agoMFC r196608
qingli [Sun, 30 Aug 2009 22:39:49 +0000 (22:39 +0000)]
MFC r196608

Do not try to free the rt_lle entry of the cached route in
ip_output() if the cached route was not initialized from the
flow-table. The rt_lle entry is invalid unless it has been
initialized through the flow-table.

Reviewed by: kmacy, rwatson
Approved by: re

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

14 years agoMFC r196569
qingli [Sun, 30 Aug 2009 22:36:46 +0000 (22:36 +0000)]
MFC r196569

When multiple interfaces exist in the system, with each interface having
an IPv6 address assigned to it, and if an incoming packet received on
one interface has a packet destination address that belongs to another
interface, the routing table is consulted to determine how to reach this
packet destination. Since the packet destination is an interface address,
the route table will return a host route with the loopback interface as
rt_ifp. The input code must recognize this fact, instead of using the
loopback interface, the input code performs a search to find the right
interface that owns the given IPv6 address.

Reviewed by: bz, gnn, kmacy
Approved by: re

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

14 years agoMFC 196478:
dougb [Sat, 29 Aug 2009 19:45:03 +0000 (19:45 +0000)]
MFC 196478:

Prior to the dire warning about values of network_interfaces other than
AUTO the biggest mistake users made was leaving lo0 off the list. Since
lo0 is effectively mandatory, check for it and add it to the list if
it's not there.

MFC 196523:
Improve the case test to detect the presence of lo0 in the list of
network_interfaces.
Submitted by: Christoph Mallon <christoph.mallon@gmx.de>

Approved by: re (kib)

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

14 years agoMFC r196547
thompsa [Sat, 29 Aug 2009 15:42:06 +0000 (15:42 +0000)]
MFC r196547

 It is possible for all the kthreads to exit (hci modules unloaded) which in
 turn ends our usb process. This means the proc pointer becomes invalid and will
 panic if a new kthread is added. Count the number of threads and clear the proc
 pointer on the last one.

Approved by: re (kib)

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

14 years agoMFC r196474:
simon [Sat, 29 Aug 2009 15:21:50 +0000 (15:21 +0000)]
MFC r196474:

  Merge DTLS fixes from vendor-crypto/openssl/dist:

  - Fix memory consumption bug with "future epoch" DTLS records.
  - Fix fragment handling memory leak.
  - Do not access freed data structure.
  - Fix DTLS fragment bug - out-of-sequence message handling which could
    result in NULL pointer dereference in
    dtls1_process_out_of_seq_message().

  Note that this will not get FreeBSD Security Advisory as DTLS is
  experimental in OpenSSL.

  Security: CVE-2009-1377 CVE-2009-1378 CVE-2009-1379 CVE-2009-1387

Approved by: re (kib)

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

14 years agoMFC r196530: Document that ppp handles pipe(2) descriptors specially in
brian [Sat, 29 Aug 2009 04:15:37 +0000 (04:15 +0000)]
MFC r196530: Document that ppp handles pipe(2) descriptors specially in
             -direct mode.

Approved by: re (kib)

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

14 years agoMerge r196559 from head to stable/8:
rwatson [Fri, 28 Aug 2009 21:14:04 +0000 (21:14 +0000)]
Merge r196559 from head to stable/8:

  Add IFNET_HOLD reserved pointer value for the ifindex ifnet array,
  which allows an index to be reserved for an ifnet without making
  the ifnet available for management operations.  Use this in if_alloc()
  while the ifnet lock is released between initial index allocation and
  completion of ifnet initialization.

  Add ifindex_free() to centralize the implementation of releasing an
  ifindex value.  Use in if_free() and if_vmove(), as well as when
  releasing a held index in if_alloc().

  Reviewed by:  bz

Approved by: re (kib)

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

14 years agoMerge r196553 from head to stable/8:
rwatson [Fri, 28 Aug 2009 21:12:38 +0000 (21:12 +0000)]
Merge r196553 from head to stable/8:

  Break out allocation of new ifindex values from if_alloc() and if_vmove(),
  and centralize in a single function ifindex_alloc().  Assert the
  IFNET_WLOCK, and add missing IFNET_WLOCK in if_alloc().  This does not
  close all known races in this code.

  Reviewed by:  bz

Approved by: re (kib)

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

14 years agoMerge r196535 from head to stable/8:
rwatson [Fri, 28 Aug 2009 21:10:26 +0000 (21:10 +0000)]
Merge r196535 from head to stable/8:

  Use locks specific to the lltable code, rather than borrow the ifnet
  list/index locks, to protect link layer address tables.  This avoids
  lock order issues during interface teardown, but maintains the bug that
  sysctl copy routines may be called while a non-sleepable lock is held.

  Reviewed by:  bz, kmacy, qingli

Approved by: re (kib)

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

14 years agoMerge r196510 from head to stable/8:
rwatson [Fri, 28 Aug 2009 21:07:43 +0000 (21:07 +0000)]
Merge r196510 from head to stable/8:

  Make if_grow static -- it's not used outside of if.c, and with the
  internals destined to change, it's better if it remains that way.

Approved by: re (kib)

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

14 years agoMFC r196551:
mlaier [Fri, 28 Aug 2009 20:26:00 +0000 (20:26 +0000)]
MFC r196551:
  Fix argument ordering to memcpy as well as the size of the copy in the
  (theoretical) case that pfi_buffer_cnt should be greater than ~_max.

  Submitted by: pjd
  Reviewed by: {krw,sthen,markus}@openbsd.org

Approved by: re (kib)

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

14 years agoMerge r196482 from head to stable/8:
rwatson [Fri, 28 Aug 2009 20:07:38 +0000 (20:07 +0000)]
Merge r196482 from head to stable/8:

  Rather than using IFNET_RLOCK() when iterating over (and modifying) the
  ifnet list during if_ef load, directly acquire the ifnet_sxlock
  exclusively.  That way when if_alloc() recurses the lock, it's a write
  recursion rather than a read->write recursion.

  This code structure is arguably a bug, so add a comment indicating that
  this is the case.  Post-8.0, we should fix this, but this commit
  resolves panic-on-load for if_ef.

  Discussed with:       bz, julian
  Reported by:  phk

Approved by: re (kib)

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

14 years agoMerge r196481 from head to stable/8:
rwatson [Fri, 28 Aug 2009 20:06:02 +0000 (20:06 +0000)]
Merge r196481 from head to stable/8:

  Rework global locks for interface list and index management, correcting
  several critical bugs, including race conditions and lock order issues:

  Replace the single rwlock, ifnet_lock, with two locks, an rwlock and an
  sxlock.  Either can be held to stablize the lists and indexes, but both
  are required to write.  This allows the list to be held stable in both
  network interrupt contexts and sleepable user threads across sleeping
  memory allocations or device driver interactions.  As before, writes to
  the interface list must occur from sleepable contexts.

  Reviewed by:  bz, julian

Approved by: re (kib)

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

14 years agoMFC r196525:
delphij [Fri, 28 Aug 2009 19:48:06 +0000 (19:48 +0000)]
MFC r196525:

Consider flag == 0 as the same of flag == R_NEXT.  This change will restore
a historical behavior that has been changed by revision 190491, and has seen
to break exim.

Approved by: re (kib)

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

14 years agoMFC r196504:
zec [Fri, 28 Aug 2009 19:18:20 +0000 (19:18 +0000)]
MFC r196504:

  When moving ifnets from one vnet to another, and the ifnet
  has ifaddresses of AF_LINK type which thus have an embedded
  if_index "backpointer", we must update that if_index backpointer
  to reflect the new if_index that our ifnet just got assigned.

  This change affects only options VIMAGE builds.

  Submitted by: bz
  Reviewed by:  bz
  Approved by:  re (rwatson), julian (mentor)

Approved by: re (rwatson)

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

14 years agoMFC r196505:
zec [Fri, 28 Aug 2009 19:15:17 +0000 (19:15 +0000)]
MFC r196505:

  When "jail -c vnet" request fails, the current code actually creates and
  leaves behind an orphaned vnet.  This change ensures that such vnets get
  released.

  This change affects only options VIMAGE builds.

  Submitted by: jamie
  Discussed with:       bz
  Approved by:  re (rwatson), julian (mentor)

Approved by: re (rwatson)

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

14 years agoMFC r196503:
zec [Fri, 28 Aug 2009 19:12:44 +0000 (19:12 +0000)]
MFC r196503:

  Fix NFS panics with options VIMAGE kernels by apropriately setting curvnet
  context inside the RPC code.

  Temporarily set td's cred to mount's cred before calling socreate() via
  __rpc_nconf2socket().

  Submitted by: rmacklem (in part)
  Reviewed by:  rmacklem, rwatson
  Discussed with:       dfr, bz
  Approved by:  re (rwatson), julian (mentor)

Approved by: re (rwatson)

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

14 years agoMFC r196502:
zec [Fri, 28 Aug 2009 19:10:58 +0000 (19:10 +0000)]
MFC r196502:

  Introduce a div_destroy() function which takes over per-vnet cleanup tasks
  from the existing modevent / MOD_UNLOAD handler, and register div_destroy()
  in protosw as per-vnet .pr_destroy() handler for options VIMAGE builds.  In
  nooptions VIMAGE builds, div_destroy() will be invoked from the modevent
  handler, resulting in effectively identical operation as it was prior this
  change.  div_destroy() also tears down hashtables used by ipdivert, which
  were previously left behind on ipdivert kldunloads.

  For options VIMAGE builds only, temporarily disable kldunloading of ipdivert,
  because without introducing additional locking logic it is impossible to
  atomically check whether all ipdivert instances in all vnets are idle, and
  proceed with cleanup without opening a race window for a vnet to open an
  ipdivert socket while ipdivert tear-down is in progress.

  While here, staticize div_init(), because it is not used outside of
  ip_divert.c.

  In cooperation with:  julian
  Approved by:  re (rwatson), julian (mentor)

Approved by: re (rwatson)

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

14 years agoMFC r196501:
zec [Fri, 28 Aug 2009 19:08:56 +0000 (19:08 +0000)]
MFC r196501:

  When registering a protocol to an existing protocol domain via
  pf_proto_register(), iterate over all existing vnets to call protosw_init()
  and thus the appropriate .pr_init() handler in the context of each vnet.
  NB in the future we probably want to separate pr_init() handlers into
  two, i.e. per-vnet and global, functions.

  This change has no impact on nooptions VIMAGE builds.

  Approved by:  re (rwatson), julian (mentor)

Approved by: re (rwatson)

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

14 years agoMFC r196517:
yongari [Fri, 28 Aug 2009 18:01:37 +0000 (18:01 +0000)]
MFC r196517:
  Don't try to power down PHY when alc(4) failed to map the device.
  This fixes system crash when mapping alc(4) device failed in device
  attach.

  Reported by: Jim < stapleton.41 <> gmail DOT com >
Approved by: re (kib)

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

14 years agoMFC r196516:
yongari [Fri, 28 Aug 2009 17:34:22 +0000 (17:34 +0000)]
MFC r196516:
  Add RTL8168DP/RTL8111DP device id. While I'm here append "8111D" to
  the description of RTL8168D as RL_HWREV_8168D can be either
  RTL8168D or RTL8111D.

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

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

14 years agoMFC r196508:
ed [Fri, 28 Aug 2009 10:25:26 +0000 (10:25 +0000)]
MFC r196508:
  Our implementation of granpt(3) could be valid in the future.

  When I wrote the pseudo-terminal driver for the MPSAFE TTY code, Robert
  Watson and I agreed the best way to implement this, would be to let
  posix_openpt() create a pseudo-terminal with proper permissions in place
  and let grantpt() and unlockpt() be no-ops.

  This isn't valid behaviour when looking at the spec. Because I thought
  it was an elegant solution, I filed a bug report at the Austin Group
  about this. In their last teleconference, they agreed on this subject.
  This means that future revisions of POSIX may allow grantpt() and
  unlockpt() to be no-ops if an open() on /dev/ptmx (if the implementation
  has such a device) and posix_openpt() already do the right thing.

  I'd rather put this in the manpage, because simply mentioning we don't
  comply to any standard makes it look worse than it is. Right now we
  don't, but at least we took care of it.

  Approved by:  re (kib)

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

14 years agoMFC 196589:
dougb [Thu, 27 Aug 2009 17:53:25 +0000 (17:53 +0000)]
MFC 196589:

In the loop through the list of interfaces in network6_interface_setup()
rtsol_interface gets reset to "yes" each time through the loop, but
rtsol_available does not. If a user has lo0 first in their list of
interfaces rtsol_available will get set to "no" the first time through
the loop and subsequent interfaces will not get rtsol'ed when they should.

Therefore change the conditional for the is_wired() test to _interface.

Approved by: re (kib)

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

14 years agoMFC r196512:
bz [Thu, 27 Aug 2009 17:34:13 +0000 (17:34 +0000)]
MFC r196512:

  Fix handling of .note.ABI-tag section for GNU systems [1].
  Handle GNU/Linux according to LSB Core Specification 4.0,
  Chapter 11. Object Format, 11.8. ABI note tag.

  Also check the first word of desc, not only name, according to
  glibc abi-tags specification to distinguish between Linux and
  kFreeBSD.

  Add explicit handling for Debian GNU/kFreeBSD, which runs
  on our kernels as well [2].

  In {amd64,i386}/trap.c, when checking osrel of the current process,
  also check the ABI to not change the signal behaviour for Linux
  binary processes, now that we save an osrel version for all three
  from the lists above in struct proc [2].

  These changes make it possible to run FreeBSD, Debian GNU/kFreeBSD
  and Linux binaries on the same machine again for at least i386 and
  amd64, and no longer break kFreeBSD which was detected as GNU(/Linux).

PR: kern/135468
Submitted by: dchagin [1] (initial patch)
Suggested by: kib [2]
Tested by: Petr Salinger (Petr.Salinger seznam.cz) for kFreeBSD
Reviewed by: kib
Approved by: re (kensmith)

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

14 years agoMFC 196522:
jhb [Thu, 27 Aug 2009 17:25:58 +0000 (17:25 +0000)]
MFC 196522:
Invoke the recently added mm-mtree.sh release script to store a pre-built
mergemaster mtree database in the 'base' dist.

Approved by: re (kib)

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

14 years agoMFC 196521:
jhb [Thu, 27 Aug 2009 17:16:23 +0000 (17:16 +0000)]
MFC 196521:
Fix a few issues with the lib32 dist so that it includes ldd32.
- Use a better find invocation to purge empty directories from all the dist
  trees during a release build.  The previous version did not purge
  directories whose contents were all empty directories.
- Explicitly blacklist a few files from the lib32 dist instead of using a
  whitelist.  A better longterm solution is to fix the few offenders to not
  install data files during a lib32 install.

Approved by: re (kib)

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