[PATCH] block: Inline blk_integrity in struct gendisk

Keith Busch keith.busch at intel.com
Thu Sep 3 13:38:09 PDT 2015


On Wed, 26 Aug 2015, Martin K. Petersen wrote:
> @@ -1985,14 +1985,10 @@ static int nvme_revalidate_disk(struct gendisk *disk)
> 	ns->pi_type = pi_type;
> 	blk_queue_logical_block_size(ns->queue, bs);
>
> -	if (ns->ms && !blk_get_integrity(disk) && (disk->flags & GENHD_FL_UP) &&
> -								!ns->ext)
> +	if (ns->ms && !ns->ext)
> 		nvme_init_integrity(ns);
>
> -	if (ns->ms && !blk_get_integrity(disk))
> -		set_capacity(disk, 0);
> -	else
> -		set_capacity(disk, le64_to_cpup(&id->nsze) << (ns->lba_shift - 9));
> +	set_capacity(disk, le64_to_cpup(&id->nsze) << (ns->lba_shift - 9));

We still ought to set the capacity to 0 if there is no block integrity
support for the disk when it has meta data formats. This would happen
with either extended metadata, or kernel config does not include integrity
extensions.



More information about the Linux-nvme mailing list