The first byte in CDB USAGE DATA should be the opcode number and not 0xFF

When we build the CDB USAGE DATA field for a REPORT SUPPORTED OPCODES reply
we must set the first byte of the field to the opcode itself, and not
to 0xFF as we currently do.

SPC4:
...
The CDB USAGE DATA field contains information about the CDB for the command being queried.
The first byte of the CDB USAGE FIELD field shall contain the operation code for the command being queried.
...

A test for this is available in the libiscsi test utility :

./bin/iscsi-test-cu iscsi://127.0.0.1/iqn.ronnie.test/1 --test=SCSI.ReportSupportedOpcodes.OneCommand

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tgt 1.0.45

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
spc: Support NAA IEEE Registered Extended field in VPD page 0x83

Enables support for the NAA IEEE Registered Extended field in the
inquiry VPD page 0x83. This field is used by multi-pathing
software for device persistency.

Signed-off-by: Dennis Cullison <Dennis.Cullison@Teradata.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Add support for gluster backing store

Gluster is a distributed file system (www.gluster.org). The
backing store gives block access protocols such as iSCSI
access to data within gluster.

Gluster data resides on volumes which are physically located
on servers. A "LUN" is represented by a file within
a volume. To specify which file to use:

--bstype=glfs
--backing-store="volume@hostname:filename"

Optionally, logs may be specified. See README.glfs

All I/Os are synchronous.  This is based off the rdrw and
rbd backend storage drivers.

Signed-off-by: Dan Lambright <dlambrig@redhat.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
tgtd: fix leak of task_in_scsi flag

When target_mgmt_request() function receives unknown or unsupported
task management function code or task was already completed for
ABORT_TASK request, iscsi_tm_execute() and iser_tm_exec() functions
exit without clearing task_in_scsi flag even though scsi command is
not in processing.

This is because the current implementation of target_mgmt_request()
function returns -EINVAL or -EEXIST for the above cases and
iscsi_tm_execute() and iser_tm_exec() do not handle these return
codes.

This fixes the issue by changing the return value of
target_mgmt_request() to MGMT_REQ_FAILED for such cases.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>