Asynchronous probe leads to the change of disk name, so it is hard to trace disk by its name for monitoring system. Signed-off-by: longguang.yue <bigclouds@xxxxxxx> --- drivers/scsi/sd.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 4bb87043e6db..ea0ac8823599 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -99,6 +99,11 @@ MODULE_ALIAS_SCSI_DEVICE(TYPE_ZBC); #define SD_MINORS 16 +static unsigned int async = PROBE_PREFER_ASYNCHRONOUS; +module_param(async, uint, 0644); +MODULE_PARM_DESC(async, + "probe scsi disk asynchronously or not. Default is 1 asynchronous."); + static void sd_config_discard(struct scsi_disk *, unsigned int); static void sd_config_write_same(struct scsi_disk *); static int sd_revalidate_disk(struct gendisk *); @@ -3839,6 +3844,9 @@ static int __init init_sd(void) SCSI_LOG_HLQUEUE(3, printk("init_sd: sd driver entry point\n")); + if (async != PROBE_PREFER_ASYNCHRONOUS) + sd_template.gendrv.probe_type = PROBE_FORCE_SYNCHRONOUS; + for (i = 0; i < SD_MAJORS; i++) { if (__register_blkdev(sd_major(i), "sd", sd_default_probe)) continue; -- 2.34.1