FS#75554 - [linux] 5.18 kernel not loading scsi devices in bus order
Attached to Project:
Arch Linux
Opened by hyeon yu (hyu) - Tuesday, 09 August 2022, 00:24 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 09 August 2022, 07:59 GMT
Opened by hyeon yu (hyu) - Tuesday, 09 August 2022, 00:24 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 09 August 2022, 07:59 GMT
|
Details
Description:
I Upgraded kernel 3.X -> 5.18 Starting with kernel 5.X SCSI devices are no longer loaded/processed in bus order, and instead appear to be processed randomly. Prior to 5.X the device names would always be related to their bus order. For example, if my SCSI bus IDs are 0:0:0:0 and 0:0:1:2, then 0:0:0:0 would always be sda and 0:0:1:2 would always be sdb. Starting with 5.X, this is no longer the case and the result is different with each reboot. I just built a kernel with those two commits reverted and it seems to be working fail https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f049cf1a7b6737c75884247c3f6383ef104d255a https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=82a54da641f3cacfa31db36fc58a5e903f804c22 how to fix? [root@localhost scsi]# make -C /lib/modules/`uname -r`/build M=`pwd` make: Entering directory `/usr/src/kernels/5.18.14-1.el7.elrepo.x86_64' CC [M] /home/linux-5.18.14/drivers/scsi/sd.o /home/linux-5.18.14/drivers/scsi/sd.c: In function 'sd_probe_part2': /home/linux-5.18.14/drivers/scsi/sd.c:3366:26: error: 'struct scsi_disk' has no member named 'driver' 3366 | gd->private_data = &sdkp->driver; | ^~ /home/linux-5.18.14/drivers/scsi/sd.c:3383:14: error: 'GENHD_FL_EXT_DEVT' undeclared (first use in this function) 3383 | gd->flags = GENHD_FL_EXT_DEVT; | ^~~~~~~~~~~~~~~~~ /home/linux-5.18.14/drivers/scsi/sd.c:3383:14: note: each undeclared identifier is reported only once for each function it appears in /home/linux-5.18.14/drivers/scsi/sd.c:3391:2: error: ignoring return value of 'device_add_disk', declared with attribute warn_unused_result [-Werror=unused-result] 3391 | device_add_disk(dev, gd, NULL); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [/home/linux-5.18.14/drivers/scsi/sd.o] Error 1 make[1]: *** [/home/linux-5.18.14/drivers/scsi] Error 2 make: *** [__sub-make] Error 2 make: Leaving directory `/usr/src/kernels/5.18.14-1.el7.elrepo.x86_64' |
This task depends upon
Closed by Toolybird (Toolybird)
Tuesday, 09 August 2022, 07:59 GMT
Reason for closing: None
Additional comments about closing: Not Arch. See comments
Tuesday, 09 August 2022, 07:59 GMT
Reason for closing: None
Additional comments about closing: Not Arch. See comments
[root@localhost scsi]# make -C /lib/modules/`uname -r`/build M=`pwd`
make: Entering directory `/usr/src/kernels/5.18.14-1.el7.elrepo.x86_64'
CC [M] /home/linux-5.18.14/drivers/scsi/sd.o
/home/linux-5.18.14/drivers/scsi/sd.c: In function 'sd_probe_async':
/home/linux-5.18.14/drivers/scsi/sd.c:3393:2: error: ignoring return value of 'device_add_disk', declared with attribute warn_unused_result [-Werror=unused-result]
3393 | device_add_disk(dev, gd, NULL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [/home/linux-5.18.14/drivers/scsi/sd.o] Error 1
make[1]: *** [/home/linux-5.18.14/drivers/scsi] Error 2
make: *** [__sub-make] Error 2
make: Leaving directory `/usr/src/kernels/5.18.14-1.el7.elrepo.x86_64'
how to use 'device_add_disk(dev, gd, NULL);' ?
Looking at the directory name "/usr/src/kernels/5.18.14-1.el7.elrepo.x86_64", it seems you use red hat based linux, not arch.
Anyway, you can use uuid instead of a device name(/dev/sdx) or other persistent block names and static device names with udev (https://wiki.archlinux.org/title/Persistent_block_device_naming) .
I tried uuid but the disk label is changed. (It is sda data, but mount information is sdb)
So, i tring sd_mod module compile.
For the record, reporter keeps repeating same mistake:
FS#72402FS#72486