On 8/8/23 15:27, Jens Axboe wrote:
I don't think setting that flag by default makes a lot of sense, if the device in question isn't zoned. Maybe have variants of BLK_ZONED_* which has a locked and unlocked variant for each where it applies? Perhaps have the lock flag be common between them so you can check them in the same way? That'd keep the fact that it's zoned and if it needs locking in the same spot, rather than scatter them in two spots.
Hi Jens, That's an interesting suggestion but there is a complication: the zone type is set by different code than the code that decides whether or not locking is required. For SCSI devices the zone type is set from inside drivers/scsi/sd.c or drivers/scsi/sd_zbc.c while the locking requirements come from the SCSI LLD (drivers/ufs/core/ufshcd.c). Additionally, the code for converting between model type and model string in scsi_debug.c would look weird if BLK_ZONED_* is split into locked and unlocked variants. See also the zbc_model_strs_*[] arrays and the sdeb_zbc_model_str() function. It should be possible to move the flag that indicates whether or not zone locking is required into struct queue_limits next to "enum blk_zoned_model zoned;". If nobody objects I will select this alternative. Thanks, Bart.