提交 68af412c 编写于 作者: D Damien Le Moal 提交者: Martin K. Petersen

scsi: sd: Ignore zoned field for host-managed devices

There is no good match of the zoned field of the block device
characteristics page for host-managed devices. For these devices, the
zoning model is derived directly from the device type. So ignore the
zoned field for these drives.

[mkp: typo]
Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: NHannes Reinecke <hare@suse.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 26f28197
......@@ -2784,13 +2784,21 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
queue_flag_clear_unlocked(QUEUE_FLAG_ADD_RANDOM, q);
}
sdkp->zoned = (buffer[8] >> 4) & 3;
if (sdkp->zoned == 1)
q->limits.zoned = BLK_ZONED_HA;
else if (sdkp->device->type == TYPE_ZBC)
if (sdkp->device->type == TYPE_ZBC) {
/* Host-managed */
q->limits.zoned = BLK_ZONED_HM;
else
q->limits.zoned = BLK_ZONED_NONE;
} else {
sdkp->zoned = (buffer[8] >> 4) & 3;
if (sdkp->zoned == 1)
/* Host-aware */
q->limits.zoned = BLK_ZONED_HA;
else
/*
* Treat drive-managed devices as
* regular block devices.
*/
q->limits.zoned = BLK_ZONED_NONE;
}
if (blk_queue_is_zoned(q) && sdkp->first_scan)
sd_printk(KERN_NOTICE, sdkp, "Host-%s zoned block device\n",
q->limits.zoned == BLK_ZONED_HM ? "managed" : "aware");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册