Nicholas A. Bellinger | 28 Feb 11:35 2015

[PATCH 0/9] target: Add WRITE_STRIP + READ_INSERT support

From: Nicholas Bellinger <nab <at> linux-iscsi.org>

Hi MKP, Sagi, & Co,

This series adds support for internal WRITE_STRIP + READ_INSERT
DIX operations using existing target_core_sbc.c DIF emulation.

It's useful in order for T10-PI fabrics to interoperate between
backend devices that don't have protection available or enabled yet.
This should be able to be done both internally using target DIF
emulation, or by the fabric driver's own HBA/NIC hardware offloads
outside of target_core_mod code.

This series includes initial tcm_loop support using a new endpoint
'fabric_prot_type' configfs attribute, and is able to successful
register SCSI LUNs and process I/Os in TYPE1 mode against a FILEIO
backend with pi_prot_type=0 set.

Here's how it looks in action:

scsi host6: TCM_Loopback
scsi 6:0:1:0: Direct-Access     LIO-ORG  FILEIO           4.0 PQ: 0 ANSI: 5
sd 6:0:1:0: [sda] Enabling DIF Type 1 protection
sd 6:0:1:0: Attached scsi generic sg1 type 0
sd 6:0:1:0: [sda] 4194304 512-byte logical blocks: (2.14 GB/2.00 GiB)
sd 6:0:1:0: [sda] Write Protect is off
sd 6:0:1:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
sd 6:0:1:0: [sda] Enabling DIX T10-DIF-TYPE1-CRC protection
sd 6:0:1:0: [sda] DIF application tag size 2
sd 6:0:1:0: [sda] Attached SCSI disk
(Continue reading)

Olaf Hering | 26 Feb 10:26 2015
Picon

crash in pscsi_get_device_type


While attempting to understand the Xen scsi backend driver I got this
crash using the script shown below:

....
[  145.495887] Rounding down aligned max_sectors from 4294967295 to 4294967288
[  145.554864] Unable to load target_core_user
[  145.661446] BUG: unable to handle kernel NULL pointer dereference at 00000000000000a8
[  145.661468] IP: [<ffffffffa024f17b>] pscsi_get_device_type+0xb/0x20 [target_core_pscsi]
[  145.661475] PGD 64121a067 PUD 6427e1067 PMD 0 
[  145.661479] Oops: 0000 [#1] SMP 
[  145.661482] Modules linked in: target_core_pscsi target_core_file target_core_iblock xen_scsiback target_core_mod bridge stp llc loop ipv6 usb_storage tpm_tis i2c_i801 joydev tpm xen_blkfront xen_netfront mptsas mptscsih mptbase scsi_transport_sas
[  145.661503] CPU: 6 PID: 5930 Comm: cat Not tainted 3.19.0-1.olh.4-kernel-linux-3_19 #1
[  145.661507] Hardware name: Intel Corporation S5520UR/S5520UR, BIOS S5500.86B.01.00.0050.050620101605 05/06/2010
[  145.661512] task: ffff88063b8f0760 ti: ffff88063d740000 task.ti: ffff88063d740000
[  145.661515] RIP: e030:[<ffffffffa024f17b>]  [<ffffffffa024f17b>] pscsi_get_device_type+0xb/0x20 [target_core_pscsi]
[  145.661521] RSP: e02b:ffff88063d743e48  EFLAGS: 00010292
[  145.661524] RAX: 0000000000000000 RBX: ffff8800080b9000 RCX: ffff88000809a5a8
[  145.661527] RDX: ffff8800080b9000 RSI: ffff8800080b9000 RDI: ffff88000809a000
[  145.661530] RBP: ffff88063d743e48 R08: ffffffffa01fd390 R09: 0000000000000000
[  145.661533] R10: 0000000000000000 R11: 0000000000000100 R12: ffff880641e7b1e0
[  145.661536] R13: ffffffffa020ed40 R14: ffffffffa020fc20 R15: ffff88000809a6f8
[  145.661543] FS:  00007f8e447a5700(0000) GS:ffff88064b780000(0000) knlGS:0000000000000000
[  145.661546] CS:  e033 DS: 0000 ES: 0000 CR0: 000000008005003b
[  145.661549] CR2: 00000000000000a8 CR3: 000000063d753000 CR4: 0000000000002660
[  145.661552] Stack:
[  145.661554]  ffff88063d743e68 ffffffffa01fd3b0 ffff88063d743e68 fffffffffffffff4
[  145.661559]  ffff88063d743e78 ffffffffa01fcd48 ffff88063d743ed8 ffffffff811a90a5
[  145.661563]  000000002c495760 ffff88063d743f48 0000000000008000 000000000060d000
[  145.661568] Call Trace:
(Continue reading)

Christoph Hellwig | 22 Feb 17:48 2015
Picon

simplify fileio I/O path

We can now read and write files using bvecs as input.  Use this
to avoid kmapping the whole request for reads and writes and
dramatically simplify the write_same code path.

Chris Moore | 19 Feb 20:23 2015

Have you seen this stack trace in isert?

We're running RHEL 7.1 kernel plus the patches that Sagi helped port for me.  On the target we're getting the
stack trace below (list_del corruption).

Leading up to the stack trace we get a bunch of:
Feb 10 16:47:28 target-1 kernel: ib_post_send() failed for IB_WR_RDMA_READ
Feb 10 16:47:28 target-1 kernel: ib_post_send failed with -12

Followed by a bunch of aborts:
Feb 10 16:48:30 target-1 kernel: ABORT_TASK: Found referenced iSCSI task_tag: 26
Feb 10 16:48:30 target-1 kernel: ABORT_TASK: ref_tag: 26 already complete, skipping
Feb 10 16:48:30 target-1 kernel: ABORT_TASK: Sending TMR_TASK_DOES_NOT_EXIST for ref_tag: 26

I'm working on tracking down the cause of the ib_post_send failure.  Has anyone seen the list_del
corruption issue?

Feb 10 16:50:19 target-1 kernel: ------------[ cut here ]------------
Feb 10 16:50:19 target-1 kernel: WARNING: at lib/list_debug.c:59 __list_del_entry+0xa1/0xd0()
Feb 10 16:50:19 target-1 kernel: list_del corruption. prev->next should be ffff8800c10b5040, but was ffff8802f35fb640
Feb 10 16:50:19 target-1 kernel: Modules linked in: tcp_lp target_core_pscsi target_core_file
target_core_iblock 8021q garp mrp bnep bluetooth rfkill fuse xt_CHECKSUM iptable_mangle
ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4
nf_defrag_ipv4 xt_conntrack nf_conntrack ipt_REJECT iptable_filter ip_tables tun bridge stp llc
xprtrdma sunrpc ib_isert(F) iscsi_target_mod ib_iser libiscsi scsi_transport_iscsi ib_srpt
target_core_mod ib_srp scsi_transport_srp scsi_tgt ib_ipoib rdma_ucm ib_ucm ib_uverbs ib_umad
rdma_cm ib_cm iw_cm ib_sa ib_mad iTCO_wdt iTCO_vendor_support ocrdma ib_core ib_addr lpc_ich
serio_raw shpchp wmi mfd_core dm_mirror dm_region_hash dm_log dm_mod intel_powerclamp ipmi_devintf
coretemp pcspkr kvm_intel kvm dcdbas crct10dif_pclmul crc3
 2_pclmul crc32c_intel ghash_clmulni_intel
Feb 10 16:50:19 target-1 kernel: aesni_intel lrw gf128mul glue_helper ablk_helper cryptd ipmi_si
ipmi_msghandler acpi_power_meter uinput i7core_edac edac_core ext4 mbcache jbd2 sd_mod crc_t10dif
(Continue reading)

Oliver Rath | 17 Feb 23:18 2015
Picon

test if initiator exists anymore?

Hi list,

how can I test if an initiator is already active?

I.e. a computer boots a windows image over linux-iscsi target and then
the user powers off the computer in a hard way. How can I see this on
iscsi-target state? Ping doesnt work properly, because windows filters
ping echo per default. Maybe an arp request?

Are there any status information files in
/sys/kernel/config/target/iscsi/... for this?

Tfh!

Regards,
Oliver

Sl Sh | 17 Feb 14:52 2015
Picon

Clear dynamic cached ACLs and generated ACLs

Hi all,
Is there any way so I can clear the dynamic cached ACLs and generated ACLs?

For example,
If I create a target with:

/iscsi/target/tpg1/ set attribute authentication=0
demo_mode_write_protect=0 generate_node_acls=1 cache_dynamic_acls=1

Login with some initiator.
logout from that initiator.
Now, i want to clear the ACLs, change the attributes to:
 generate_node_acls=0 demo_mode_discovery=0
Now I want the login to fail.

Thanks!

--

-- 

Thank you in advance,

Slava Shwartsman
Slava Shwartsman | 17 Feb 13:58 2015
Picon

Clear dynamic cached ACLs and generated ACLs

Hi all,
Is there any way so I can clear the dynamic cached ACLs and generated ACLs?

For example,
If I create a target with:

/iscsi/target/tpg1/ set attribute authentication=0 demo_mode_write_protect=0
generate_node_acls=1 cache_dynamic_acls=1

Login with some initiator.
logout from that initiator.
Now, i want to clear the ACLs, change the attributes to:
  generate_node_acls=0 demo_mode_discovery=0
Now I want the login to fail.

Chris Boot | 16 Feb 00:46 2015
Picon

Re: synchronize files between two initiators

On 15 Feb 2015, at 23:34, ayaka <ayaka <at> soulik.info> wrote:
> 
> 
> 
> 在 2015年02月16日 07:24, Chris Boot 写道:
>> On 15 Feb 2015, at 22:48, ayaka <ayaka <at> soulik.info> wrote:
>>> 
>>> Hi: I have a problem with that, there are two initiators
>>> connected to the same target, I copy some files(write some data)
>>> into the target in a initiator, then the other initiator can't
>>> know that. What is the problem? The file system is XFS. Thank
>>> you
>> 
>> Hi ayaka,
>> 
>> The problem is that you are not using a cluster-aware filesystem.
>> 
>> Traditional filesystems like ext2/3/4, XFS, JFS and friends are
>> designed to be used by a single machine per disk - pointing two
>> machines at the same disk will not work. This is because they don’t
>> know about other nodes and assume they can cache data in ways that
>> break down when there are more nodes. Mounting the same disk in two
>> places will lead to some very nasty filesystem corruption.
>> 
> I see, then the solution uses Linux-HA, DRBD and iscsitarget in
> network seems really a bad idea, in those example, they use ext3/4.

Hi ayaka,

Those examples probably never mount the filesystem from more than one place at a time. It’s perfectly
(Continue reading)

ayaka | 15 Feb 23:48 2015

synchronize files between two initiators

Hi:
  I have a problem with that, there are two initiators connected to
the same target, I copy some files(write some data) into the target in
a initiator, then the other initiator can't know that. What is the
problem? The file system is XFS.
Thank you

===============configure of target====================
{
  "fabric_modules": [],
  "storage_objects": [
    {
      "attributes": {
        "block_size": 512,
        "emulate_3pc": 1,
        "emulate_caw": 1,
        "emulate_dpo": 0,
        "emulate_fua_read": 0,
        "emulate_fua_write": 1,
        "emulate_model_alias": 1,
        "emulate_rest_reord": 0,
        "emulate_tas": 1,
        "emulate_tpu": 0,
        "emulate_tpws": 0,
        "emulate_ua_intlck_ctrl": 0,
        "emulate_write_cache": 0,
        "enforce_pr_isids": 1,
        "fabric_max_sectors": 8192,
        "force_pr_aptpl": 0,
        "is_nonrot": 0,
(Continue reading)

Nicholas A. Bellinger | 14 Feb 04:27 2015

[PATCH 0/8] target: Fixes for SPC/SBC device emulation

From: Nicholas Bellinger <nab <at> linux-iscsi.org>

Hi all,

The following patch series contains a number of target SPC/SBC
related emulation fixes that address failures occurring while
using Ronnie Sahlberg's excellent libiscsi test suite.

The first two are the important ones.  Patch #1 adds a missing
end-of-device sanity check for WRITE_SAME emulation, that Bart
had reported earlier.  Patch #2 fixes a case where the existing
end-of-device check did not take into account the potential of
LBA + sector wrapping overflowing sector_t.

The remaining patches address other minor test failures.  This
includes failing I/O + WRITE_SAME ops when PROTECT bit is set,
if the backend device is not configured to support protection
information.

Also included are sanity checks for DPO/FUA, WRITE_SAME w/ UNMAP=1
and UNMAP that will fail the command if the associated feature
bits are not being advertised by the backend device via existing
device attributes.

Please review.

Thank you,

--nab

(Continue reading)

Bart Van Assche | 13 Feb 11:58 2015

LIO and the libiscsi regression tests

Hello Nic,

As you know I'm working on a prototype of a unified SRP target
driver. Since that work involves some small target core changes
I started to look for a good regression test for the LIO core.
That is why I ran the libiscsi test suite against LIO. The test
I ran was as follows:
* Installed kernel v3.18.6 inside a virtual machine.
* Installed the libcunit1-dev package.
* Cloned libiscsi from https://github.com/sahlberg/libiscsi.git.
* Built libiscsi.
* Ran the attached script to start LIO.
* Started the libiscsi regression tests as follows:
  test-tool/iscsi-test-cu --dataloss --allow-sanitize iscsi://127.0.0.1/tgt1/0

The result can be found below. This is 100% reproducible. Can you have a look at this ?

Thanks,

Bart.

BUG: unable to handle kernel NULL pointer dereference at 0000000000000014
IP: [<ffffffffa038522e>] fd_execute_write_same+0x6e/0x310 [target_core_file]
PGD 58fe7067 PUD 54bca067 PMD 0 
Oops: 0000 [#1] SMP 
Modules linked in: target_core_pscsi target_core_iblock target_core_file iscsi_target_mod
target_core_mod crc32c_generic iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi netconsole
configfs af_packet hid_generic qxl drm_kms_helper usbhid processor ttm microcode thermal_sys hid drm
virtio_balloon hwmon intel_agp button i2c_piix4 intel_gtt agpgart i2c_core fuse sg sr_mod cdrom
ata_generic ext4 pata_acpi crc16 jbd2 mbcache virtio_blk virtio_net virtio_pci virtio_ring ata_piix
(Continue reading)


Gmane