diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2021-01-28 06:56:58 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-02-09 03:11:32 +0100 |
commit | bf1b4659dc278b68f22b11b2c5fe7e3eb96e75a7 (patch) | |
tree | b50537167c30a20b77f10e19cd4f85aca8d10462 /drivers/scsi | |
parent | scsi: MAINTAINERS: Adjust to reflect gdth scsi driver removal (diff) | |
download | linux-bf1b4659dc278b68f22b11b2c5fe7e3eb96e75a7.tar.xz linux-bf1b4659dc278b68f22b11b2c5fe7e3eb96e75a7.zip |
scsi: sd: Warn if unsupported ZBC device is probed
In sd_probe(), print a warning if CONFIG_BLK_DEV_ZONED is disabled and a
TYPE_ZBC device is found. While at it, use IS_ENABLED() to test if
CONFIG_BLK_DEV_ZONED is enabled instead using of a #ifdef.
Link: https://lore.kernel.org/r/20210128055658.530133-1-damien.lemoal@wdc.com
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/sd.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index a3d2d4bc4a3d..6e41ecbf4399 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3379,10 +3379,12 @@ static int sd_probe(struct device *dev) sdp->type != TYPE_RBC) goto out; -#ifndef CONFIG_BLK_DEV_ZONED - if (sdp->type == TYPE_ZBC) + if (!IS_ENABLED(CONFIG_BLK_DEV_ZONED) && sdp->type == TYPE_ZBC) { + sdev_printk(KERN_WARNING, sdp, + "Unsupported ZBC host-managed device.\n"); goto out; -#endif + } + SCSI_LOG_HLQUEUE(3, sdev_printk(KERN_INFO, sdp, "sd_probe\n")); |