From: Ewan D. Milne <emilne(a)redhat.com>
scsi: sd: Add "probe_type" module parameter to allow synchronous probing
Setting probe_type="sync" will force synchronous probing in the driver
core, which forces the ordering of minor device number assignments when
SCSI disk devices are probed, for compatibility with prior versions of RHEL.
Bugzilla:
https://bugzilla.redhat.com/show_bug.cgi?id=2140017
Upstream Status: RHEL-only
Signed-off-by: Ewan D. Milne <emilne(a)redhat.com>
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index blahblah..blahblah 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -129,6 +129,14 @@ static const char *sd_cache_types[] = {
"write back, no read (daft)"
};
+static const char *sd_probe_types[] = { "async", "sync" };
+
+static char sd_probe_type[6] = "async";
+module_param_string(probe, sd_probe_type, sizeof(sd_probe_type),
+ S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(probe, "async or sync. Setting to 'sync' disables
asynchronous "
+ "device number assignments (sda, sdb, ...).");
+
static void sd_set_flush_flag(struct scsi_disk *sdkp)
{
bool wc = false, fua = false;
@@ -3857,6 +3865,8 @@ static int __init init_sd(void)
goto err_out_class;
}
+ if (!strcmp(sd_probe_type, "sync"))
+ sd_template.gendrv.probe_type = PROBE_FORCE_SYNCHRONOUS;
err = scsi_register_driver(&sd_template.gendrv);
if (err)
goto err_out_driver;
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2504