On Thu, 2012-01-05 at 21:08 -0700, Dax Kelson wrote: > To distill my previous email: > > [OK] # lsscsi > [7:0:0:0] disk LIO-ORG IBLOCK 4.0 /dev/sdf > [OK] # sg_turs /dev/sdf > [OK] # sg_persist -n -o -I -S aa230003 -d /dev/sdf > [FAIL] # sg_persist -n -i -r -d /dev/sdf > > Why the failure? > > iSCSI initiator is RHEL6.2 (iscsi-initiator-utils-6.2.0.872-10.el6) > iSCSI target is Fedora16 (kernel 3.1.6 , targetcli-2.0rc1.fb3-2) > Hi Dax, The problem is with the >= v3.0 (TCM v4.1) conversion to use scatterlists instead of a contiguous buffer for all control CDBs, and limiting allocation lengths to PAGE_SIZE is what is causing the problem you've encountered. By default sg_persist is using a 8192 byte allocation length, and is hitting the following code from target_core_transport.c:transport_generic_cmd_sequencer(): /* Let's limit control cdbs to a page, for simplicity's sake. */ if ((cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB) && size > PAGE_SIZE) goto out_invalid_cdb_field; A simple sg_persist work-around is to reduce the allocation length to sub PAGE_SIZE like so using '-l 512': # sg_persist -vv -i -s -l 512 -d /dev/sdd open /dev/sdd with flags=0x800 inquiry cdb: 12 00 00 00 24 00 LIO-ORG IBLOCK 4.0 Peripheral device type: disk open /dev/sdd with flags=0x802 Persistent Reservation In cmd: 5e 03 00 00 00 00 00 05 12 00 PR generation=0x1 Key=0xaa230003 All target ports bit clear Relative port address: 0x3 not reservation holder Transport Id of initiator: SAS address: 0x6001405185b68800 So aside from a work-around here, I'll have to think a bit more about how to properly address this in TCM v4.1 code in lio-core.git and mainline. I'm still catching up on a number of items, so this will take a few days. Thanks, --nab -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html