Re: [PATCH 04/11] block: remove the blk_integrity_profile structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/7/2024 11:28 AM, Christoph Hellwig wrote:
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -1177,7 +1177,7 @@ static int crypt_integrity_ctr(struct crypt_config *cc, struct dm_target *ti)
>   	struct mapped_device *md = dm_table_get_md(ti->table);
>   
>   	/* We require an underlying device with non-PI metadata */
> -	if (!bi || strcmp(bi->profile->name, "nop")) {
> +	if (!bi || bi->csum_type != BLK_INTEGRITY_CSUM_NONE) {
>   		ti->error = "Integrity profile not supported.";
>   		return -EINVAL;

I'd rename BLK_INTEGRITY_CSUM_NONE to BLK_INTEGRITY_CSUM_NOP. Overall.

Current choice is a bit confusing as it indicates that code is trying to 
handle "none" case while it is actually trying to handle/support "nop" 
profile.

With extended format off:
# nvme format /dev/nvme0n1 -l 5 -m 0 -i 0 -f
Success formatting namespace:1
# cat /sys/block/nvme0n1/integrity/format
nop

With extended format on:
# nvme format /dev/nvme0n1 -l 5 -m 1 -i 0 -f
Success formatting namespace:1
# cat /sys/block/nvme0n1/integrity/format
none

nop is the case when bi->tuple_size is perfectly valid (i.e. not zero), 
and the code needs to have support for it.
none is the case when bi->tuple_size is zero, and the code only needs to 
ensure that it does nothing.

That said, the change can be deferred to a future patch as well.

So, looks good!

Reviewed-by: Kanchan Joshi <joshi.k@xxxxxxxxxxx>




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux