196057 Commits

Author SHA1 Message Date
pfg
5df04fd537 MFC r268097:
MFV	r260708
4427 pid provider rejects probes with valid UTF-8 names

This make use of Solaris' u8_validate() which we happen to
use since r185029 for ZFS.
Use of u8_textprep.c required -Wno-cast-qual for powerpc.

Illumos Revision:	1444d846b126463eb1059a572ff114d51f7562e5

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

Obtained from:	Illumos
2014-07-16 02:02:46 +00:00
wblock
1f33481bdb MFC r268381
Make synopsis version of -3 flag match other uses in the page.
2014-07-16 00:41:47 +00:00
wblock
48cb0b5107 MFC r268187:
Improve markup, change references to nonexistent vt_vga(4), remove some
language redundancy, and move the examples so sections are in the
standard order.
2014-07-16 00:36:55 +00:00
wblock
d8d95145c2 MFC r267617:
Fix spelling, typos, missing articles, contractions.  Expanded version
of patch supplied with PR.
2014-07-15 23:20:25 +00:00
wblock
f454bd908f MFC r267618:
Fix syntax error.
2014-07-15 22:44:10 +00:00
mav
a96d167707 Document CTL and iSCSI ABI breakages. 2014-07-15 18:41:30 +00:00
mav
93a30afd01 Fix build on stable/10. 2014-07-15 18:27:18 +00:00
mav
3f163cf88f MFC r268388:
Add XPT_ABORT support to iSCSI initiator.

While CAM does not use it normally, it is useful for targets testing.
2014-07-15 18:23:14 +00:00
mav
b47c885e2c MFC r268370:
Make XPT_GET_TRAN_SETTINGS to report CAM that command queueing is enabled,
but make couple changes to handle non-queued commands too, if happen.
2014-07-15 18:22:17 +00:00
mav
e6aad79578 MFC r268326:
Make iSCSI initiator keep Initiator Session ID (ISID) across reconnects.

Previously ISID was changed every time, that made impossible correct
persistent reservation, because reconnected session was identified as
completely new one.
2014-07-15 18:21:26 +00:00
mav
2c6230a1ad MFC r268240 (by ken):
Add persistent reservation support to camcontrol(8).

camcontrol(8) now supports a new 'persist' subcommand that allows users to
issue SCSI PERSISTENT RESERVE IN / OUT commands.
2014-07-15 17:26:43 +00:00
mav
c0be426ce6 MFC r268447:
Add LUN options to specify 64-bit EUI and NAA identifiers.
2014-07-15 17:20:40 +00:00
mav
68cf85bc2c MFC r268421:
Remove status setting from datamove() path.  Leave that to other places.
2014-07-15 17:19:43 +00:00
mav
1e9a14c2c4 MFC r268418:
Enable TAS feature: notify initiator if its command was aborted by other.

That should make operation more kind to multi-initiator environment.
Without this, other initiators may find out that something bad happened
to their commands only via command timeout.
2014-07-15 17:18:50 +00:00
mav
05919e7e4c MFC r268387:
Fix task management functions status: task not found is not an error,
while not implemented function is.
2014-07-15 17:17:52 +00:00
mav
870d4a24fe MFC r268364:
Fix "use after free" on port creation error in r268291.
2014-07-15 17:16:58 +00:00
mav
7bd4e3c249 MFC r268363:
Add support for READ FULL STATUS action of PERSISTENT RESERVE IN command.
2014-07-15 17:16:06 +00:00
mav
342f128143 MFC r268362:
Teach ctl_add_initiator() to dynamically allocate IIDs from pool.

If port passed negative IID value, the function will try to allocate IID
from the pool of unused, based on passed wwpn or name arguments.  It does
all its best to make IID unique and persistent across reconnects.

This makes persistent reservation properly work for iSCSI.  Previously,
in case of reconnects, reservation could be unexpectedly lost, or even
migrate between intiators.
2014-07-15 17:14:53 +00:00
mav
14a59860bb MFC r268356, r268357:
When new connection comes in, check whether we already have session from
the same intiator (Name+ISID).  If so -- terminate the old session and let
the new one take its place, as required by iSCSI RFC.
2014-07-15 17:13:49 +00:00
mav
a0bee6cdf5 MFC r268353:
Implement ABORT TASK SET and I_T NEXUS RESET task management functions.

Use the last one to terminate active commands on iSCSI session termination.
Previous code was aborting only commands doing some data moves.
2014-07-15 17:12:37 +00:00
mav
ebf361d529 MFC r268330:
Make gcc happy, init idlen2.
2014-07-15 17:11:42 +00:00
mav
100d0f0aa6 MFC r268328:
Close race in r268291 between port destruction, delayed by sessions
teardown, and new port creation during `service ctld restart`.

Close it by returning iSCSI port internal state, that allows to identify
dying ports, which should not be counted as existing, from really alive.
2014-07-15 17:10:48 +00:00
mav
247c4d2053 MFC r268309:
Add support for SCSI Ports (88h) VPD page.
2014-07-15 17:09:52 +00:00
mav
938fb0a5f5 MFC r268308:
Make REPORT TARGET PORT GROUPS command report realistic data instead of
hardcoded garbage.
2014-07-15 17:09:02 +00:00
mav
6cb3a6ad50 MFC r268307:
Move lun_map() method from command nexus to port.

Previous implementation made impossible to do some things, such as calling
it for ports other then one through which command arrived.
2014-07-15 17:08:04 +00:00
mav
0468376762 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.
2014-07-15 17:07:07 +00:00
mav
f1200cac15 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.
2014-07-15 17:06:10 +00:00
mav
b40b547aa1 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.
2014-07-15 17:05:11 +00:00
mav
5df1093df8 MFC r268288:
Improve CTL_BEARG_* flags support, including optional values copyout.
2014-07-15 17:01:39 +00:00
mav
c09a8b3510 MFC r268287:
Implement and use ctl_frontend_find().
2014-07-15 17:00:41 +00:00
mav
7da5c8a0d6 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.
2014-07-15 16:59:46 +00:00
mav
639ef1613c MFC r268280:
Make options KPI more generic to allow it to be used for ports too,
not only for LUNs.
2014-07-15 16:58:38 +00:00
mav
8bfe00fd8a 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.
2014-07-15 16:57:30 +00:00
mav
e396aeead5 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.
2014-07-15 16:55:13 +00:00
mav
75f2a98771 MFC r268103:
Add support for REPORT TIMESTAMP command.
2014-07-15 16:54:04 +00:00
mav
da977d4032 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.
2014-07-15 16:53:04 +00:00
mav
a64cd56a0c 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.
2014-07-15 16:49:35 +00:00
kib
caf3a68af9 MFC r268385:
Make this compilable on latest Linux'es without warnings.
2014-07-15 10:05:52 +00:00
kib
c2d1e1826f MFC r268383:
Correct si_code for the SIGBUS signal generated by the alignment trap.
2014-07-15 10:01:33 +00:00
delphij
a62685c6c1 MFC r268128: MFV r268122:
4929 want prevsnap property
2014-07-15 05:45:50 +00:00
delphij
4af6f088fb MFC r268126: MFV r268121:
4924 LZ4 Compression for metadata
2014-07-15 05:42:09 +00:00
delphij
5cce10db7b MFC r268123: MFV r268119:
4914 zfs on-disk bookmark structure should be named *_phys_t
2014-07-15 05:39:22 +00:00
delphij
4d09e20b95 MFC r268086: MFV r267570:
4756 metaslab_group_preload() could deadlock
2014-07-15 05:36:26 +00:00
delphij
f8b96a7c88 MFC r268085: MFV r267569:
4897 Space accounting mismatch in L2ARC/zpool
2014-07-15 05:32:53 +00:00
delphij
bfdd43f2b5 MFC r268084: MFV r267568:
4891 want zdb option to dump all metadata
2014-07-15 05:28:58 +00:00
delphij
66efdb2ba0 MFC r268082: MFV r267567:
4881 zfs send performance degradation when embedded block pointers are
     encountered
2014-07-15 05:12:16 +00:00
delphij
91643324a9 MFC r268079: MFV r267566:
4390 i/o errors when deleting filesystem/zvol can lead to space map
     corruption
2014-07-15 05:00:46 +00:00
delphij
9d1dc5bcc9 MFC r268075: MFV r267565:
4757 ZFS embedded-data block pointers ("zero block compression")
4913 zfs release should not be subject to space checks
2014-07-15 04:53:34 +00:00
delphij
5ed76404fe MFC r260142: MFV r258972:
4373 add block contents print to zstreamdump
2014-07-15 04:44:06 +00:00
delphij
38554d6064 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
2014-07-15 04:39:55 +00:00