MFC r245104:
Protect the p->p_pgrp dereference with the process lock.


git-svn-id: svn://svn.freebsd.org/base/stable/9@245218 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244750:
  Add net.link.stf.permit_rfc1918 sysctl variable. It can be used to allow
  the use of private IPv4 addresses with stf(4).

MFC r244752:
  Add an ability to set net.link.stf.permit_rfc1918 from the loader.


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

Replace our version of the pwcache(3) API with NetBSD's implementation.

This adds two features:
 * uid_from_user() and gid_from_group() as the reverse of user_from_uid()
   and groups_from_gid().
 * pwcache_userdb() and pwcache_groupdb() which allow alternative lookup
   functions to be used.  For example lookups from passwd and group
   databases in a non-standard location.


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

Document the output of the show command.  Modified version of patch
provided by Bas Smeelen <b.smeelen@ose.nl>.  Use of 'gpart list'
suggested by by Andrey V. Elsukov <ae@FreeBSD.org>.

PR:		docs/174270
Submitted by:	Ronald F.Guilmette <rfg@tristatelogic.com>
Reviewed by:	ae (block sizes)


git-svn-id: svn://svn.freebsd.org/base/stable/9@245270 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC 244756 + 244757:

Add Simplified Chinese catalogs.


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

Use DEVMETHOD_END.


git-svn-id: svn://svn.freebsd.org/base/stable/9@245279 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244787, 244796:

Add DEVICE_IDENTIFY method for wbwd(4), required on most of recent
Supermicro motherboards.

Tested on X8STi and X8DTH boards.

Sponsored by:	iXsystems, Inc.


git-svn-id: svn://svn.freebsd.org/base/stable/9@245280 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244795:
Make it possible to atomically resume writes on the mount and account
the write start, by adding a variation of the vfs_write_resume(9) which
accepts flags.

Use the new function to prevent a deadlock between parallel suspension
and snapshotting a UFS mount.


git-svn-id: svn://svn.freebsd.org/base/stable/9@245282 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244925:
Add yet another flag for the vfs_write_resume_flags() to avoid calling
suspension cleanup handler after the suspend is lifted, and use it in
the ffs_snapshot() call to vfs_write_resume.


git-svn-id: svn://svn.freebsd.org/base/stable/9@245283 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r245236:
 - Update where porters handbook lives.


git-svn-id: svn://svn.freebsd.org/base/stable/9@245320 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r245113:
lockmgr: unlock interlock (if requested) when dealing with upgrade/downgrade
requests for LK_NOSHARE locks, just like for shared locks.

PR:		kern/174969


git-svn-id: svn://svn.freebsd.org/base/stable/9@245351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r245262:
When nullfs mount is forcibly unmounted and nullfs vnode is reclaimed,
get back the leased write reference from the lower vnode.  There is no
other path which can correct v_writecount on the lowervp.


git-svn-id: svn://svn.freebsd.org/base/stable/9@245352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r245004:
Add the "nocache" nullfs mount option.

MFC r245033:
Fix reversed condition in the assertion.


git-svn-id: svn://svn.freebsd.org/base/stable/9@245353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r245005:
Allow to specify "cache" and "nocache" as an option for
mount_nullfs(8).


git-svn-id: svn://svn.freebsd.org/base/stable/9@245354 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
ext2fs: cleanup the dinode structure.

It was plagued with style errors and the offsets had been lost.
While here took the time to update the fields according to the
latest ext4 documentation.

Reviewed by:	bde


git-svn-id: svn://svn.freebsd.org/base/stable/9@245356 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244719:
  Add the NO_SYNC_CACHE quirk for all Apple USB MSC devices, as they
  typically do not handle the SYNCHRONIZE_CACHE command - they either
  return an error or the firmware enters a reset loop.

Approved by:	rstone (co-mentor)


git-svn-id: svn://svn.freebsd.org/base/stable/9@245358 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244995 r244996 r244997.

MFC r244995:
  Fix a typo in an error message.

MFC r244996:
  Have -n imply -r, since dry-run mode obviously doesn't require root
  privileges.

MFC r244997:
  Make sure to update the mtime of a logfile after archiving it. This
  ensures that the next rotation happens at the correct time when using
  interval-based rotations.

Approved by:	rstone (co-mentor)


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

Add an ugly hack to libgcc's unwind code, to make it behave properly at
runtime on amd64, when it is compiled by clang.  Some versions of clang
don't save and restore all callee registers, if a __builtin_eh_return()
intrinsic is used in a function.  This is particularly bad on amd64.

Until the problem gets fixed by upstream, use an asm statement to force
clang to assume the registers in question are clobbered, when invoking
__builtin_eh_return(), so it will emit code to save and restore them.

This should fix the crashes reported on -current with some C++ programs,
particularly those that throw exceptions over multiple function
boundaries.

Reported by:	stefanf


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

if PACKAGESITE url scheme is not 'file://', always try to revolv SRV records and
use them if any. It allows the bootstrap to use directly pkg.FreeBSD.org instead
of pkgbeta.FreeBSD.org


git-svn-id: svn://svn.freebsd.org/base/stable/9@245394 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r244383:
- Set memorylocked limit to 64Kb for default login class.
  This prevents unprivileged users to lock too much memory.
- Set memorylocked limit to 64Mb for daemon login class.
  Some daemons such as amd(8) and watchdogd(8) calls mlockall(2) on
  startup, they are run from init(8) which uses daemon login class.
- Set memorylocked limit to unlimited for root login class.

Approved by:	kib (mentor)


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