]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/log
FreeBSD/stable/10.git
9 years agoMFC r268302:
mav [Tue, 15 Jul 2014 17:07:07 +0000 (17:07 +0000)]
MFC r268302:
Pass through iSCSI session ISID from LOGIN request to the CTL frontend.

ISID is an important part of initiator transport ID for iSCSI.  It is not
used now, but should be to properly implement persistent reservation.

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

9 years agoMFC r268293:
mav [Tue, 15 Jul 2014 17:06:10 +0000 (17:06 +0000)]
MFC r268293:
Burry devid port method, which was a gross hack.

Instead make ports provide wanted port and target IDs, and LUNs provide
wanted LUN IDs.  After that core Device ID VPD code only had to link all
of them together and add relative port and port group numbers.

LUN ID for iSCSI LUNs no longer created by CTL, but by ctld, and passed
to CTL as "scsiname" LUN option.  This makes LUNs to report the same set
of IDs, independently from the port through which it is accessed, as
required by SCSI specifications.

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

9 years agoMFC r268291:
mav [Tue, 15 Jul 2014 17:05:11 +0000 (17:05 +0000)]
MFC r268291:
Create separate CTL port for every iSCSI target (and maybe portal group).

Having single port for all iSCSI connections makes problematic implementing
some more advanced SCSI functionality in CTL, that require proper ports
enumeration and identification.

This change extends CTL iSCSI API, making ctld daemon to control list of
iSCSI ports in CTL.  When new target is defined in config fine, ctld will
create respective port in CTL.  When target is removed -- port will be
also removed after all active commands through that port properly aborted.
This change require ctld to be rebuilt to match the kernel.

As a minor side effect, this allows to have iSCSI targets without LUNs.
While that may look odd and not very useful, that is not incorrect.

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

9 years agoMFC r268288:
mav [Tue, 15 Jul 2014 17:01:39 +0000 (17:01 +0000)]
MFC r268288:
Improve CTL_BEARG_* flags support, including optional values copyout.

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

9 years agoMFC r268287:
mav [Tue, 15 Jul 2014 17:00:41 +0000 (17:00 +0000)]
MFC r268287:
Implement and use ctl_frontend_find().

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

9 years agoMFC r268284:
mav [Tue, 15 Jul 2014 16:59:46 +0000 (16:59 +0000)]
MFC r268284:
Introduce new IOCTL CTL_PORT_LIST reporting in more flexible XML format.

Leave old CTL_GET_PORT_LIST in place so far.  Garbage-collect it later.

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

9 years agoMFC r268280:
mav [Tue, 15 Jul 2014 16:58:38 +0000 (16:58 +0000)]
MFC r268280:
Make options KPI more generic to allow it to be used for ports too,
not only for LUNs.

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

9 years agoMFC r268266, r268275:
mav [Tue, 15 Jul 2014 16:57:30 +0000 (16:57 +0000)]
MFC r268266, r268275:
Separate concepts of frontend and port.

Before iSCSI implementation CTL had no knowledge about frontend drivers,
it had only frontends, which really were ports (alike to LUNs, if comparing
to backends).  But iSCSI added there ioctl() method, which does not belong
to frontend as a port, but belongs to a frontend driver.

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

9 years agoMFC r268265:
mav [Tue, 15 Jul 2014 16:55:13 +0000 (16:55 +0000)]
MFC r268265:
Remove targ_enable()/targ_disable() frontend methods.

Those methods were never implemented, and I believe that their concept is
wrong, since single frontend (SCSI port) can not handle several targets.

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

9 years agoMFC r268103:
mav [Tue, 15 Jul 2014 16:54:04 +0000 (16:54 +0000)]
MFC r268103:
Add support for REPORT TIMESTAMP command.

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

9 years agoMFC r268096, r268306, r268361:
mav [Tue, 15 Jul 2014 16:53:04 +0000 (16:53 +0000)]
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://svn.freebsd.org/base/stable/10@268674 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r267639:
mav [Tue, 15 Jul 2014 16:49:35 +0000 (16:49 +0000)]
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://svn.freebsd.org/base/stable/10@268673 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r268385:
kib [Tue, 15 Jul 2014 10:05:52 +0000 (10:05 +0000)]
MFC r268385:
Make this compilable on latest Linux'es without warnings.

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

9 years agoMFC r268383:
kib [Tue, 15 Jul 2014 10:01:33 +0000 (10:01 +0000)]
MFC r268383:
Correct si_code for the SIGBUS signal generated by the alignment trap.

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

9 years agoMFC r268128: MFV r268122:
delphij [Tue, 15 Jul 2014 05:45:50 +0000 (05:45 +0000)]
MFC r268128: MFV r268122:

4929 want prevsnap property

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

9 years agoMFC r268126: MFV r268121:
delphij [Tue, 15 Jul 2014 05:42:09 +0000 (05:42 +0000)]
MFC r268126: MFV r268121:

4924 LZ4 Compression for metadata

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

9 years agoMFC r268123: MFV r268119:
delphij [Tue, 15 Jul 2014 05:39:22 +0000 (05:39 +0000)]
MFC r268123: MFV r268119:

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

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

9 years agoMFC r268086: MFV r267570:
delphij [Tue, 15 Jul 2014 05:36:26 +0000 (05:36 +0000)]
MFC r268086: MFV r267570:

4756 metaslab_group_preload() could deadlock

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

9 years agoMFC r268085: MFV r267569:
delphij [Tue, 15 Jul 2014 05:32:53 +0000 (05:32 +0000)]
MFC r268085: MFV r267569:

4897 Space accounting mismatch in L2ARC/zpool

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

9 years agoMFC r268084: MFV r267568:
delphij [Tue, 15 Jul 2014 05:28:58 +0000 (05:28 +0000)]
MFC r268084: MFV r267568:

4891 want zdb option to dump all metadata

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

9 years agoMFC r268082: MFV r267567:
delphij [Tue, 15 Jul 2014 05:12:16 +0000 (05:12 +0000)]
MFC r268082: MFV r267567:

4881 zfs send performance degradation when embedded block pointers are
     encountered

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

9 years agoMFC r268079: MFV r267566:
delphij [Tue, 15 Jul 2014 05:00:46 +0000 (05:00 +0000)]
MFC r268079: MFV r267566:

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

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

9 years agoMFC r268075: MFV r267565:
delphij [Tue, 15 Jul 2014 04:53:34 +0000 (04:53 +0000)]
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://svn.freebsd.org/base/stable/10@268649 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r260142: MFV r258972:
delphij [Tue, 15 Jul 2014 04:44:06 +0000 (04:44 +0000)]
MFC r260142: MFV r258972:

4373 add block contents print to zstreamdump

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

9 years agoMFC r266771: MFV r266766:
delphij [Tue, 15 Jul 2014 04:39:55 +0000 (04:39 +0000)]
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://svn.freebsd.org/base/stable/10@268647 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r267572: MFV r249332 (illumos-gate 14005:55fc53126003)
delphij [Tue, 15 Jul 2014 04:33:11 +0000 (04:33 +0000)]
MFC r267572: MFV r249332 (illumos-gate 14005:55fc53126003)

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

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

9 years agoRevert r268629:
pfg [Mon, 14 Jul 2014 20:13:24 +0000 (20:13 +0000)]
Revert r268629:

This was supposed to go to head first :(

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

9 years agofsck_msdosfs: be a bit more permissive
pfg [Mon, 14 Jul 2014 20:07:23 +0000 (20:07 +0000)]
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://svn.freebsd.org/base/stable/10@268629 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r268538:
pfg [Mon, 14 Jul 2014 15:54:50 +0000 (15:54 +0000)]
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://svn.freebsd.org/base/stable/10@268622 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r268354:
hselasky [Mon, 14 Jul 2014 07:30:04 +0000 (07:30 +0000)]
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://svn.freebsd.org/base/stable/10@268604 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f

9 years agoMFC r268290:
pfg [Sun, 13 Jul 2014 17:50:50 +0000 (17:50 +0000)]
MFC r268290:
Merge from OpenSolaris (24-Jul-2010):

6679140 asymmetric alloc/dealloc activity can induce dynamic variable drops
6679193 dtrace_dynvar walker produces flood of dtrace_dynhash_sink

This finishes a set of merges from the older OpenSolaris releases.
Still the FreeBSD port has many differences that are difficult to
account for but that seems normal given that the kernels are different.

Obtained from: OpenSolaris (through Illumos)

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

9 years agoMFC 267963:
jhb [Sun, 13 Jul 2014 17:49:27 +0000 (17:49 +0000)]
MFC 267963:
The latest versoin of file/libmagic identifes a filesystem image
is identified as "DOS/MBR boot sector" as opposed to "x86 boot sector".

This trips up vmrun.sh when using the new file(1) and makes it want to boot
into the installer instead.

Fix this by just looking for "boot sector" instead.

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

9 years agoMFC r268487:
kevlo [Sun, 13 Jul 2014 15:13:25 +0000 (15:13 +0000)]
MFC r268487:

Enable 8051 before downloading firmware.

Tested by: Carlos Jacobo Puga Medina <cpm at fbsd dot es

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

9 years agoMFC: r268008
rmacklem [Sun, 13 Jul 2014 00:19:39 +0000 (00:19 +0000)]
MFC: r268008
There might be a potential race condition for the NFSv4 client
when a newly created file has another open done on it that
update the open mode. This patch moves the code that updates
the open mode up into the block where the mutex is held to
ensure this cannot happen. No bug caused by this potential
race has been observed, but this fix is a safety belt to ensure
it cannot happen.

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

9 years agoMFC 267929, 267937, 267939, 267940, 267941, 267942, 267987, 268006:
rpaulo [Sat, 12 Jul 2014 22:56:41 +0000 (22:56 +0000)]
MFC 267929, 267937, 267939, 267940, 267941, 267942, 267987, 268006:

 2915 DTrace in a zone should see "cpu", "curpsinfo", et al
 2916 DTrace in a zone should be able to access fds[]
 2917 DTrace in a zone should have limited provider access
 4477 DTrace should speak JSON
 Add stubs for CTF functions which are not yet implemented.
 4474 DTrace Userland CTF Support
 4475 DTrace userland Keyword
 4476 DTrace tests should be better citizens
 4479 pid provider types
 4480 dof emulation is missing checks
 4471 DTrace count() with histogram
 4472 DTrace full width distribution histograms
 4473 DTrace frequency trails

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

9 years agoMFC r268130, r268224, r268230, r268231:
pfg [Sat, 12 Jul 2014 18:23:35 +0000 (18:23 +0000)]
MFC r268130, r268224, r268230, r268231:

Various DTrace Merges from OpenSolaris/Illumos:

15-Sep-2008:
6735480 race between probe enabling and provider registration

20-Apr-2008:
6822482 DOF validation needs to handle loadable sections flagged as unloadable

22-Apr-2009:
6823388 DTrace ioctl handlers must validate all structure members

30-Jun-2009:
6851093 system drops to kmdb with anonymous dtrace probes + kmdb

Obtained from: OpenSolaris

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

9 years agoMFC r268272:
pfg [Sat, 12 Jul 2014 17:39:13 +0000 (17:39 +0000)]
MFC r268272:

minor perf enhancement for UTF-8

Reduce some duplicate code.

Reference:
https://www.illumos.org/issues/628

Obtained from: Illumos

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

9 years agoMFC r268286: Fix compile-time errors when NO_WERROR and WITHOUT_INET6_SUPPORT
cy [Sat, 12 Jul 2014 05:59:19 +0000 (05:59 +0000)]
MFC r268286: Fix compile-time errors when NO_WERROR and WITHOUT_INET6_SUPPORT
(NO_INET6) are specified.

Approved by: glebius (mentor)

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

9 years agoMFC r267643, r267873, r268391, r268398:
mav [Sat, 12 Jul 2014 04:34:39 +0000 (04:34 +0000)]
MFC r267643, r267873, r268391, r268398:
Introduce fine-grained CTL locking to improve SMP scalability.

Split global ctl_lock, historically protecting most of CTL context:
 - remaining ctl_lock now protects lists of fronends and backends;
 - per-LUN lun_lock(s) protect LUN-specific information;
 - per-thread queue_lock(s) protect request queues.
This allows to radically reduce congestion on ctl_lock.

Create multiple worker threads, depending on number of CPUs, and assign
each LUN to one of them.  This allows to spread load between multiple CPUs,
still avoiging congestion on queues and LUNs locks.

On 40-core server, exporting 5 LUNs, each backed by gstripe of SATA SSDs,
accessed via 6 iSCSI connections, this change improves peak request rate
from 250K to 680K IOPS.

Sponsored by: iXsystems, Inc.

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

9 years agoMFC r268283:
mav [Sat, 12 Jul 2014 02:40:25 +0000 (02:40 +0000)]
MFC r268283:
Improve readability of XML generated by CTL_LUN_LIST.

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

9 years agoMFC r268392:
mav [Sat, 12 Jul 2014 02:33:03 +0000 (02:33 +0000)]
MFC r268392:
Do not return statuses for aborted iSCSI commands.

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

9 years agoMFC r268204:
mav [Sat, 12 Jul 2014 02:29:33 +0000 (02:29 +0000)]
MFC r268204:
Use separate memory type M_CTLIO for I/Os.

CTL allocate large amount of RAM.  This change give some more stats.

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

9 years agoMFC r267933:
mav [Sat, 12 Jul 2014 02:28:11 +0000 (02:28 +0000)]
MFC r267933:
Simplify statistics calculation.

Instead of trying to guess size of disk I/O operations (it just won't work
that way for newly added commands, and is equal to data move size for old
ones), account data move traffic.  If disk I/Os are that interesting, then
backends have to account and provide that information.

Block backend already exports the information about disk I/Os via devstat,
so having it here too is excessive.

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

9 years agoMFC r267906:
mav [Sat, 12 Jul 2014 02:26:11 +0000 (02:26 +0000)]
MFC r267906:
Allow MODE SENSE commands through Write Exclusive persistent reservation,
as required by SPC-4.

Report that fact in persistent reservation capabilities.

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

9 years agoMFC r267905:
mav [Sat, 12 Jul 2014 02:24:52 +0000 (02:24 +0000)]
MFC r267905:
Add READ BUFFER and improve WRITE BUFFER SCSI commands support.

This gives some use to 512KB per-LUN buffers, allocated for Copan-specific
processor code and not used.  It allows, for example, to test transport
performance and/or correctness without accessing the media, as supported
by Linux version of sg3_utils.

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

9 years agoMFC r267877:
mav [Sat, 12 Jul 2014 02:17:10 +0000 (02:17 +0000)]
MFC r267877:
Lock devstat updates in block backend to make it usable.  Polish lock names.

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

9 years agoMFC r268419:
mav [Sat, 12 Jul 2014 02:03:29 +0000 (02:03 +0000)]
MFC r268419:
Fix use-after-free on XPT_RESET_BUS.

That command is not queued, so does not use later status update.

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

9 years agoMFC r267986:
mav [Sat, 12 Jul 2014 01:59:07 +0000 (01:59 +0000)]
MFC r267986:
Remove odd practice of inverting error codes.

-EPERM is equal to ERESTART, returning which from ioctl() handler causes
infinite syscall restart.

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

9 years agoMFC r267984:
delphij [Fri, 11 Jul 2014 00:26:57 +0000 (00:26 +0000)]
MFC r267984:

Use Intel's official name (Secure Key) per Intel® Digital Random Number
Generator (DRNG) Software Implementation Guide.

Reviewed by: kib
Approved by: so

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

9 years agoCorrect memset size.
delphij [Fri, 11 Jul 2014 00:14:29 +0000 (00:14 +0000)]
Correct memset size.

Submitted by: Sascha Wildner (swildner at dragonflybsd dot org)
Reviewed by: Kashyap Desai <kashyap.desai avagotech.com>

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

9 years agoMFC r267886:
delphij [Fri, 11 Jul 2014 00:11:24 +0000 (00:11 +0000)]
MFC r267886:

Use correct length for buffer.

Submitted by: Sascha Wildner <swildner dragonflybsd org>

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

9 years agoMFC r267887:
delphij [Fri, 11 Jul 2014 00:08:13 +0000 (00:08 +0000)]
MFC r267887:

Correct buffer size.

Submitted by: Sascha Wildner <swildner dragonflybsd org>

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

9 years agoMFC r267897: MFV r267843:
delphij [Fri, 11 Jul 2014 00:00:00 +0000 (00:00 +0000)]
MFC r267897: MFV r267843:

Update file/libmagic to 5.19.

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

9 years agoMFC r268212:
kib [Thu, 10 Jul 2014 09:09:37 +0000 (09:09 +0000)]
MFC r268212:
Note that most errors are possible for all syscalls from utimes(2)
family.  Minor wording corrections.

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

9 years agoMFC r268211:
kib [Thu, 10 Jul 2014 09:08:02 +0000 (09:08 +0000)]
MFC r268211:
Micro-manage clang to get the expected inlining for cpu_search().

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

9 years agoBump __FreeBSD_version after last SA-14:17.kmem so we have something
peter [Wed, 9 Jul 2014 00:12:15 +0000 (00:12 +0000)]
Bump __FreeBSD_version after last SA-14:17.kmem so we have something
to test against in the freebsd.org cluster.

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

9 years agoDocument FreeBSD-SA-14:17.kmem
gjb [Tue, 8 Jul 2014 23:07:09 +0000 (23:07 +0000)]
Document FreeBSD-SA-14:17.kmem

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

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

9 years agoFix kernel memory disclosure in control message and SCTP notifications.
delphij [Tue, 8 Jul 2014 21:54:50 +0000 (21:54 +0000)]
Fix kernel memory disclosure in control message and SCTP notifications.

Security: FreeBSD-SA-14:17.kmem
Security: CVE-2014-3952, CVE-2014-3953

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

9 years agoDocument r268091, disklabel64 partition scheme.
gjb [Tue, 8 Jul 2014 15:11:33 +0000 (15:11 +0000)]
Document r268091, disklabel64 partition scheme.

Sponsored by: The FreeBSD Foundation

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

9 years agoDocument r268161, mkimg(1) merged to stable/10.
gjb [Tue, 8 Jul 2014 15:09:55 +0000 (15:09 +0000)]
Document r268161, mkimg(1) merged to stable/10.

Sponsored by: The FreeBSD Foundation

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

9 years agoRegen src.conf(5) after r268399
emaste [Tue, 8 Jul 2014 14:11:28 +0000 (14:11 +0000)]
Regen src.conf(5) after r268399

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

9 years agoMFC r268022: Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT
emaste [Tue, 8 Jul 2014 14:04:36 +0000 (14:04 +0000)]
MFC r268022: Rename the WITHOUT_VT_SUPPORT knob to WITHOUT_VT

  The _SUPPORT knobs have a consistent meaning which differs from the
  behaviour controlled by this knob.  As the knob is opt-out and has not
  appeared in a release the impact should be low.

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

9 years agoMFC r268393: [mdoc] Fix previous.
pluknet [Tue, 8 Jul 2014 13:16:03 +0000 (13:16 +0000)]
MFC r268393: [mdoc] Fix previous.

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

9 years agoMFC r268059: Add missing VT_ kernel config knobs
emaste [Tue, 8 Jul 2014 09:47:52 +0000 (09:47 +0000)]
MFC r268059: Add missing VT_ kernel config knobs

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

9 years agoMFC r268090:
ae [Tue, 8 Jul 2014 01:01:30 +0000 (01:01 +0000)]
MFC r268090:
  Document all aliases supported by GEOM_PART class.

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

9 years agoMFC r268089:
ae [Tue, 8 Jul 2014 00:59:35 +0000 (00:59 +0000)]
MFC r268089:
  Linux uses its own UUID for data partitions.

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

9 years agoTemporary disable build of vt_efifb vt(4) driver, not all parts of UEFI support
ray [Mon, 7 Jul 2014 21:27:47 +0000 (21:27 +0000)]
Temporary disable build of vt_efifb vt(4) driver, not all parts of UEFI support
here yet.
This direct commit to STABLE-10, because HEAD already support UEFI FB.

Sponsored by: The FreeBSD Foundation

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

9 years agoMFC of r263873.
ray [Mon, 7 Jul 2014 19:31:02 +0000 (19:31 +0000)]
MFC of r263873.

Pointed by:     Ivan Klymenko <fidaj@ukr.net>

Sponsored by: The FreeBSD Foundation

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

9 years agoMFC r268049:
ume [Mon, 7 Jul 2014 15:31:46 +0000 (15:31 +0000)]
MFC r268049:
Fix ifconfig to show pltime and vltime with -L option,
again after usage change from time_second to time_uptime.

PR: 188520
Submitted by: Guy Yur <guyyur__at__gmail.com>

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

9 years ago267622 Log:
ray [Mon, 7 Jul 2014 14:16:05 +0000 (14:16 +0000)]
267622 Log:
  Rename vt(4) vga module to dismiss interference with syscons(4) vga module.
267623 Log:
  Remove stale link to deleted vt(4) xboxfb driver.
267624 Log:
  syscons(4) and vt(4) can be built together now.
267625 Log:
  Allow to disable syscons(4) if "hw.syscons.disable" kenv is set.
267626 Log:
  Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
267965 by emaste@ Log:
  Use a common tunable to choose between vt(4)/sc(4)
  With this change and previous work from ray@ it will be possible to put
  both in GENERIC, and have one enabled by default, but allow the other to
  be selected via the loader.
  (The previous implementation had separate kern.vt.disable and
  hw.syscons.disable tunables, and would panic if both drivers were
  compiled in and neither was explicitly disabled.)
268175 by emaste@ Log:
  Fix vt(4) detection in kbdcontrol and vidcontrol
  As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence
  of a vt(4) sysctl is not sufficient to determine that vt(4) is in use.
  Reported by:  Trond Endrestøl
268045 by emaste@ Log:
  Add vt(4) to GENERIC and retire the separate VT config
  vt(4) and sc(4) can now coexist in the same kernel.  To choose the vt
  driver, set the loader tunable kern.vty=vt .

Sponsored by: The FreeBSD Foundation

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

9 years agoMFC 267756:
ache [Mon, 7 Jul 2014 05:31:50 +0000 (05:31 +0000)]
MFC 267756:

Merge intermediate OpenBSD v1.25 changes (almost identical to ours)
to reduce diff and bump OpenBSD patch level to v1.26.

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

9 years agoMFC r267745, r268268:
pfg [Mon, 7 Jul 2014 02:47:41 +0000 (02:47 +0000)]
MFC r267745, r268268:
getopt(3): recognize option:: as GNU extension for "optional options".

Also ANSIfy a function declaration.

While here update the OpenBSD patch level in getopt_long.c as we
already have the corresponding change.

Obtained from: NetBSD
MFC after: 2 weeks

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

9 years agoMFC r268002:
mjg [Sun, 6 Jul 2014 23:27:13 +0000 (23:27 +0000)]
MFC r268002:

Call fdcloseexec right after fdunshare.

No functional changes.

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

9 years agoMFH: r264781, r267669, r267670
bapt [Sun, 6 Jul 2014 23:24:06 +0000 (23:24 +0000)]
MFH: r264781, r267669, r267670

Simplify reading pw.conf(5) by using getline(3)

Removed compatibility with pre FreeBSD 2.2 pw_mkdb command [1]
Fix some broken indentattion [1]

Fix changing the username [2]

PR: 189172 [1], 189173 [2]
Submitted by: fullermd@over-yonder.net [1][2]

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

9 years agoMFC r268001:
mjg [Sun, 6 Jul 2014 23:23:01 +0000 (23:23 +0000)]
MFC r268001:
Make fdunshare accept only td parameter.

Proc had to match the thread anyway and 2 parameters were inconsistent
with the rest.

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

9 years agoMFC r268000:
mjg [Sun, 6 Jul 2014 23:20:48 +0000 (23:20 +0000)]
MFC r268000:

Make sure to always clear p_fd for process getting rid of its filetable.

Filetable can be shared with other processes. Previous code failed to
clear the pointer for all but the last process getting rid of the table.
This is mostly cosmetics.

Get rid of 'This should happen earlier' comment. Clearing the pointer in
this place is fine as consumers can reliably check for files availability
by inspecting fd_refcnt and vnodes availabity by NULL-checking them.

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

9 years agoAdd mergeinfo missed in r268335-r268341
mjg [Sun, 6 Jul 2014 23:17:21 +0000 (23:17 +0000)]
Add mergeinfo missed in r268335-r268341

Prodded by: gjb

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

9 years agoMFC r267947:
mjg [Sun, 6 Jul 2014 23:01:29 +0000 (23:01 +0000)]
MFC r267947:

Check lower bound of cmsg_len.

If passed cm->cmsg_len was below cmsghdr size the experssion:
datalen = (caddr_t)cm + cm->cmsg_len - (caddr_t)data;

would give negative result. However, in practice it would not
result in a crash because the kernel would try to obtain garbage fds
for given process and would error out with EBADF.

PR: 124908
Submitted by: campbell mumble.net (modified a little)

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

9 years agoMFC r267760:
mjg [Sun, 6 Jul 2014 22:58:53 +0000 (22:58 +0000)]
MFC r267760:
Tidy up fd-related functions called by do_execve

o assert in each one that fdp is not shared
o remove unnecessary NULL checks - all userspace processes have fdtables
and kernel processes cannot execve
o remove comments about the danger of fd_ofiles getting reallocated - fdtable
is not shared and fd_ofiles could be only reallocated if new fd was about to be
added, but if that was possible the code would already be buggy as setugidsafety
work could be undone

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

9 years agoMFC r267755:
mjg [Sun, 6 Jul 2014 22:56:34 +0000 (22:56 +0000)]
MFC r267755:

Don't take filedesc lock in fdunshare().

We can read refcnt safely and only care if it is equal to 1.

If it could suddenly change from 1 to something bigger the code would be
buggy even in the previous form and transitions from > 1 to 1 are equally racy
and harmless (we copy even though there is no need).

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

9 years agoMFC r267710:
mjg [Sun, 6 Jul 2014 22:54:17 +0000 (22:54 +0000)]
MFC r267710:

fd: replace fd_nfiles with fd_lastfile where appropriate

fd_lastfile is guaranteed to be the biggest open fd, so when the intent
is to iterate over active fds or lookup one, there is no point in looking
beyond that limit.

Few places are left unpatched for now.

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

9 years agoMFC r267708:
mjg [Sun, 6 Jul 2014 22:51:53 +0000 (22:51 +0000)]
MFC r267708:

do_dup: plug redundant adjustment of fd_lastfile

By that time it was already set by fdalloc, or was there in the first place
if fd is replaced.

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

9 years agoMFC r265247:
mjg [Sun, 6 Jul 2014 22:49:07 +0000 (22:49 +0000)]
MFC r265247:
Request a non-exiting process in sysctl_kern_proc_{o,}filedesc

This fixes a race with exit1 freeing p_textvp.

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

9 years agoMFC r265206:
mjg [Sun, 6 Jul 2014 22:47:18 +0000 (22:47 +0000)]
MFC r265206:

Ignore the error from pipespace_new when creating a pipe.

It can fail if pipe map is exhausted (as a result of too many pipes created),
but it is not fatal and could be provoked by unprivileged users. The only
consequence is worse performance with given pipe.

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

9 years agoMFC r268193, r268203:
pfg [Sun, 6 Jul 2014 17:29:19 +0000 (17:29 +0000)]
MFC r268193, r268203:

Fix sed(1) usage: the -i extension is not an optional.

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

9 years agoMFC r268125:
pfg [Sun, 6 Jul 2014 17:18:48 +0000 (17:18 +0000)]
MFC r268125:

Small merges from OpenSolaris:

These have no effect on FreeBSD, in fact they are ifdef'ed,
but make easier future merges:

6699767 panic in spec_open()

6718877 crgetzoneid() use can cause problems when forking processes with
USDT providers in a non global zone

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

9 years agoMFC r268232:
gjb [Sun, 6 Jul 2014 03:31:01 +0000 (03:31 +0000)]
MFC r268232:
  The u-boot tarball needed for some boards, BEAGLEBONE for
  example, explicitly hard-code gcc(1) as the compiler.

  Partially revert r264703, which did a post-chroot install
  of gcc(1).  This was initially removed because gcc(1) fails
  to build usr.bin/dtc/ causing the xdev target to fail.  So
  this time, move the gcc(1) installation after xdev is built.

  This change is likely applicable to stable/10 arm build
  failures, as well.

Sponsored by: The FreeBSD Foundation

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

9 years agoMFC r268012, r268196:
bryanv [Sat, 5 Jul 2014 03:48:22 +0000 (03:48 +0000)]
MFC r268012, r268196:

  - Remove some write only variables
  - Give each interrupt a descriptive name when using MSIX

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

9 years agoMFC r268178:
mav [Sat, 5 Jul 2014 01:14:14 +0000 (01:14 +0000)]
MFC r268178:
Fix bug in sync control in new "dev" mode of ZVOL (r265678).

Don't check ZVOL_WCE flag, used in Solaris to control device "write cache".
It is not applicable on FreeBSD and by default set to "disable".

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

9 years agoMFC r267648:
mav [Fri, 4 Jul 2014 16:17:15 +0000 (16:17 +0000)]
MFC r267648:
serial_num and device_id fields are not necessarily null-terminated.

Before this it was impossible to use all 16 bytes of serial number, and
client always got serial number NULL-terminated, that is not required.

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

9 years agoMFC r267641:
mav [Fri, 4 Jul 2014 16:11:30 +0000 (16:11 +0000)]
MFC r267641:
Add some more CTL_FLAG_ABORT check points.

This should allow to abort commands doing mostly disk I/O, such as VERIFY
or WRITE SAME.  Before this change CTL_FLAG_ABORT was only checked around
data moves, which for these commands may not happen for a very long time.

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

9 years agoMFC r267637:
mav [Fri, 4 Jul 2014 16:10:14 +0000 (16:10 +0000)]
MFC r267637:
Add iSCSI Target Name ID descriptor to VPD 83h.

It shall/should be there according to SPC-4, and istgt also provides it.

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

9 years agoMFC r267610 (by trasz):
mav [Fri, 4 Jul 2014 16:09:09 +0000 (16:09 +0000)]
MFC r267610 (by trasz):
Rework session termination in iSCSI target to actually wait
for any outstanding commands to be properly aborted by CTL.
Without it, in some cases (such as files backing the LUNs
stored on failing disk drives), terminating a busy session
would result in panic.

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

9 years agoMFC r267574 (by trasz):
mav [Fri, 4 Jul 2014 16:07:57 +0000 (16:07 +0000)]
MFC r267574 (by trasz):
Make cs_terminating a bool; no functional changes.

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

9 years agoMFC r267547, r267551 (by trasz):
mav [Fri, 4 Jul 2014 16:06:56 +0000 (16:06 +0000)]
MFC r267547, r267551 (by trasz):
Add LUN-associated name to VPD, to make Hyper-V Failover Cluster happy.

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

9 years agoMFC r267051:
mav [Fri, 4 Jul 2014 15:09:56 +0000 (15:09 +0000)]
MFC r267051:
- Add support for SG_GET_SG_TABLESIZE IOCTL to report that we don't support
scatter/gather lists.
- Return error for still unsupported SG 3.x API read/write calls.

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

9 years agoMFC: r268095
marius [Fri, 4 Jul 2014 13:57:58 +0000 (13:57 +0000)]
MFC: r268095

Actually pro AMD chipsets, making r244146 work.

Sponsored by: Bally Wulff Games & Entertainment GmbH

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

9 years agoMFC r267960:
hselasky [Fri, 4 Jul 2014 06:03:54 +0000 (06:03 +0000)]
MFC r267960:
Don't hide zero-length strings when doing sysctl listings.

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

9 years agoMFC r267909: Document EINVAL.
pluknet [Thu, 3 Jul 2014 17:35:01 +0000 (17:35 +0000)]
MFC r267909: Document EINVAL.

PR: 191382

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

9 years agoMFC r267955 and r268209:
hselasky [Thu, 3 Jul 2014 16:13:44 +0000 (16:13 +0000)]
MFC r267955 and r268209:
- Add proper rangechecks in "axge_rx_frame()" function and
fix receive loop header parsing.
- Disable hardware checksumming until it is properly tested.

PR: 191432

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