Skip to content

Commit

Permalink
scsi: sd: Warn if unsupported ZBC device is probed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Damien Le Moal authored and Martin K. Petersen committed Feb 9, 2021
1 parent d2aacd3 commit bf1b465
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down

0 comments on commit bf1b465

Please sign in to comment.