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>




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux