[stgt] [PATCH] Add support for SANITIZE command
ronniesahlberg at gmail.com
Sun Jul 21 20:34:20 CEST 2013
Please find a patch that adds initial support for the SANITIZE command.
We support both BLOCK_ERASE service action, which is often used to sanitize SSD
devices and is similar to UNMAPping the device
as well as OVERWRITE service action which is used for HDDs to perform one or more sequences to overwrite the entire device.
While most devices usually only support one of BLOCK_ERASE or OVERWRITE,
this is more due to BLOCK_ERASE only makes sense for resource or thin
provisioned devices and OVERWRITE usually only makes sense for fully provisioned
HDD devices. TGTD supports both commands.
The idea is that initiators should use BlockDeviceCharacteristics/MediumRotationRate and pick/use BLOCK_ERASE if the device reports itself as an SSD and to
use OVERWRITE if it is a HDD.
Additionally we support the EXIT_FAILURE_MODE service action which is used to clear a a previous sanitize failure.
This opcode is not all that commonly used, but it is nice to have TGTD support it because it allows me to readily produce testcases for the libiscsi scsi testsuite.
At a later stage, what we should add should be support for the IMMED flag,
AUSE flag, and we should also store the sanitize status persistently for the LUN, perhaps in an extended attribute so that it persist across a TGTD restart or host reboot. AUSE makes no sense before we can make the state persistent, and IMMED maybe would be suboptimal before we have persistence too.
but neither of that is critical and can easily be done at a later time
when/if those features are actually needed.
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
More information about the stgt