MFC r268354:
Improve support for Intel Lynx Point USB 3.0 controllers by masking
the port routing bits like done in Linux.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC	r268538:

Avoid hardcoding "gcc" in the DTrace tests.

At least one test doesn't work yet without gcc, however gcc is
not always available in base. Using the environment compiler
is more trustable and will also work with an external compiler.

Reviewed by:	markj


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
fsck_msdosfs: be a bit more permissive

The free space value in the FSInfo block is merely unitialized when it is
0xffffffff. This fixes a bug found in NetBSD.

It must be noted that we never supported all the checks that NetBSD does
as some of them would cause failures with a freshly created FAT32
from MS-Windows.

While here, bring some space fixes.

Obtained from:	NetBSD (rev. 1.22)


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268629 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revert r268629:

This was supposed to go to head first :(


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268630 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r267572: MFV r249332 (illumos-gate 14005:55fc53126003)

Illumos ZFS issues:
  3654 zdb should print number of ganged blocks


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268645 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r266771: MFV r266766:

Add a new zfs property, "redundant_metadata" which can have values "all" or
"most".  The default will be "all", which is the current behavior.  When set
to all, ZFS stores an extra copy of all metadata.  If a single on-disk block
is corrupt, at worst a single block of user data (which is recordsize bytes
long) can be lost.

Setting to "most" will cause us to only store 1 copy of level-1 indirect
blocks of user data files.  This can improve performance of random writes,
because less metadata has to be written.  In practice,  at worst about
100 blocks (of recordsize bytes each) of user data can be lost if a single
on-disk block is corrupt.

The exact behavior of which metadata blocks are stored redundantly may change
in future releases.

Illumos issue: 3835 zfs need not store 2 copies of all metadata


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268647 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r260142: MFV r258972:

4373 add block contents print to zstreamdump


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268648 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268075: MFV r267565:

4757 ZFS embedded-data block pointers ("zero block compression")
4913 zfs release should not be subject to space checks


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268649 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268079: MFV r267566:

4390 i/o errors when deleting filesystem/zvol can lead to space map
     corruption


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268650 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268082: MFV r267567:

4881 zfs send performance degradation when embedded block pointers are
     encountered


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268651 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268084: MFV r267568:

4891 want zdb option to dump all metadata


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268653 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268085: MFV r267569:

4897 Space accounting mismatch in L2ARC/zpool


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268654 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268086: MFV r267570:

4756 metaslab_group_preload() could deadlock


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268656 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268123: MFV r268119:

4914 zfs on-disk bookmark structure should be named *_phys_t


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268657 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268126: MFV r268121:

4924 LZ4 Compression for metadata


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268658 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268128: MFV r268122:

4929 want prevsnap property


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268659 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268383:
Correct si_code for the SIGBUS signal generated by the alignment trap.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268661 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268385:
Make this compilable on latest Linux'es without warnings.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268663 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r267639:
Increase CTL_DEVID_LEN from 16 to 64 bytes.

SPC-4 recommends T10 vendor ID based LUN ID was created by concatenating
product name and serial number (and istgt follows that).  But product name
is 16 bytes long by itself, so 16 bytes total length is clearly not enough
to fit both.

To keep compatibility with existing configurations, pad short device IDs
to old length of 16, same as before.

This change probably breaks CTL user-level ABI, so control tools should
be rebuilt after this change.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268673 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
MFC r268096, r268306, r268361:
Add more formal and strict command parsing and validation.

For every supported command define CDB length and mask of bits that are
allowed to be set.  This allows to remove bunch of checks through the code
and still make the validation more strict.  To properly do it for commands
supporting multiple service actions, formalize their parsing by adding
subtables for each of such commands.

As visible effect, this change allows to add support for REPORT SUPPORTED
OPERATION CODES command, reporting to client all the data about supported
SCSI commands, except timeouts.


git-svn-id: svn+ssh://svn.freebsd.org/base/stable/10@268674 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f