Re: [PATCH] block: fix lbmd_guard_tag_type assignment in FS_IOC_GETLBMD_CAP

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

 



On Tue, Jul 22, 2025 at 01:49:11PM +0530, Anuj Gupta wrote:
> +	switch (bi->csum_type) {
> +	case BLK_INTEGRITY_CSUM_NONE:
> +		meta_cap.lbmd_guard_tag_type = LBMD_PI_CSUM_NONE;
> +		break;
> +	case BLK_INTEGRITY_CSUM_IP:
> +		meta_cap.lbmd_guard_tag_type = LBMD_PI_CSUM_IP;
> +		break;
> +	case BLK_INTEGRITY_CSUM_CRC:
> +		meta_cap.lbmd_guard_tag_type = LBMD_PI_CSUM_CRC16_T10DIF;
> +		break;
> +	case BLK_INTEGRITY_CSUM_CRC64:
> +		meta_cap.lbmd_guard_tag_type = LBMD_PI_CSUM_CRC64_NVME;
> +		break;
> +	default:
> +		break;

This should catch and reject invalid values.  Otherwise the patch looks
fine.





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux