>>>>> "Akinobu" == Akinobu Mita <akinobu.m...@gmail.com> writes:

>>> We don't issue WRITE SAME with PI so there is no prot SGL.

>> Is there a specific reason why we don't?

There really isn't much of a benefit when all you're doing is
replicating zeroes. So it hasn't been very high on my list.

Akinobu> It is not only for the WRITE SAME requests from block device
Akinobu> but also for READ/WRITE with PROTECT=0 requests by SG_IO.

Akinobu> So isn't is appropreate to allocate prot SGL in
Akinobu> target_write_prot_action() (and mark se_cmd->se_cmd_flags to
Akinobu> release it at deallocation time)?

Correct. Just because a target is formatted with PI does not mean that
every I/O it receives has PI attached. That's entirely driven by
RDPROTECT/WRPROTECT/VRPROTECT at the initiator's discretion.

It is an absolute requirement that the device, if formatted with PI,
will generate and write the correct protection information when
WRPROTECT is 0.

-- 
Martin K. Petersen      Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to