[PATCH 12/20] nvme: remove the 0 lba_shift check in nvme_update_ns_info

Damien Le Moal Damien.LeMoal at wdc.com
Mon Sep 28 10:51:58 EDT 2020


On 2020/09/28 21:35, Christoph Hellwig wrote:
> We can't reach this code if Identify Namespace failed.
> 
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
>  drivers/nvme/host/core.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 0114fe47de3571..910198c3e0bbd1 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2129,13 +2129,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
>  	int ret;
>  
>  	blk_mq_freeze_queue(ns->disk->queue);
> -	/*
> -	 * If identify namespace failed, use default 512 byte block size so
> -	 * block layer can use before failing read/write for 0 capacity.
> -	 */
>  	ns->lba_shift = id->lbaf[lbaf].ds;
> -	if (ns->lba_shift == 0)
> -		ns->lba_shift = 9;
>  
>  	switch (ns->head->ids.csi) {
>  	case NVME_CSI_NVM:
> 

Looks good.

Reviewed-by: Damien Le Moal <damien.lemoal at wdc.com>

-- 
Damien Le Moal
Western Digital Research



More information about the Linux-nvme mailing list