FS#72486 - [linux] 5.X kernel not loading scsi devices in bus order - undo fail

Attached to Project: Arch Linux
Opened by hyeon yu (hyu) - Wednesday, 20 October 2021, 11:48 GMT
Last edited by Andreas Radke (AndyRTR) - Tuesday, 02 November 2021, 18:35 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To No-one
Architecture x86_64
Severity Critical
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I Upgraded kernel 3.X -> 5.X
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.

current kernel)
5.14.11-1.el7.elrepo.x86_64

I just built a kernel with those two commits reverted and it seems to be working fail (sd.c)
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.14.11-1.el7.elrepo.x86_64'
CC [M] /usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.o
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:125:13: error: static declaration of 'sd_print_sense_hdr' follows non-static declaration
125 | static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *);
| ^~~~~~~~~~~~~~~~~~
In file included from /usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:72:
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.h:271:6: note: previous declaration of 'sd_print_sense_hdr' with type 'void(struct scsi_disk *, struct scsi_sense_hdr *)'
271 | void sd_print_sense_hdr(struct scsi_disk *sdkp, struct scsi_sense_hdr *sshdr);
| ^~~~~~~~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:126:13: error: static declaration of 'sd_print_result' follows non-static declaration
126 | static void sd_print_result(const struct scsi_disk *, const char *, int);
| ^~~~~~~~~~~~~~~
In file included from /usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:72:
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.h:272:6: note: previous declaration of 'sd_print_result' with type 'void(const struct scsi_disk *, const char *, int)'
272 | void sd_print_result(const struct scsi_disk *sdkp, const char *msg, int result);
| ^~~~~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'cache_type_store':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:222:9: error: implicit declaration of function 'revalidate_disk'; did you mean 'sd_revalidate_disk'? [-Werror=implicit-function-declaration]
222 | revalidate_disk(sdkp->disk);
| ^~~~~~~~~~~~~~~
| sd_revalidate_disk
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_setup_unmap_cmnd':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:855:16: error: implicit declaration of function 'scsi_init_io'; did you mean 'scsi_init_hosts'? [-Werror=implicit-function-declaratio]
855 | return scsi_init_io(cmd);
| ^~~~~~~~~~~~
| scsi_init_hosts
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_setup_read_write_cmnd':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1215:17: error: implicit declaration of function 't10_pi_prepare'; did you mean 'dpm_prepare'? [-Werror=implicit-function-declaration]
1215 | t10_pi_prepare(cmd->request, sdkp->protection_type);
| ^~~~~~~~~~~~~~
| dpm_prepare
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_init_command':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1296:24: error: implicit declaration of function 'sd_zbc_setup_reset_cmnd'; did you mean 'sd_zbc_setup_zone_mgmt_cmnd'? [-Werror=implicit-function-declaration]
1296 | return sd_zbc_setup_reset_cmnd(cmd);
| ^~~~~~~~~~~~~~~~~~~~~~~
| sd_zbc_setup_zone_mgmt_cmnd
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_open':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1356:17: error: implicit declaration of function 'check_disk_change'; did you mean 'bdev_disk_changed'? [-Werror=implicit-function-declaration]
1356 | check_disk_change(bdev);
| ^~~~~~~~~~~~~~~~~
| bdev_disk_changed
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_sync_cache':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1652:21: error: implicit declaration of function 'driver_byte' [-Werror=implicit-function-declaration]
1652 | if (driver_byte(res) == DRIVER_SENSE)
| ^~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1652:41: error: 'DRIVER_SENSE' undeclared (first use in this function)
1652 | if (driver_byte(res) == DRIVER_SENSE)
| ^~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1652:41: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_pr_command':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1754:36: error: 'DRIVER_SENSE' undeclared (first use in this function)
1754 | if (driver_byte(result) == DRIVER_SENSE &&
| ^~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: At top level:
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1816:10: error: 'const struct block_device_operations' has no member named 'revalidate_disk'
1816 | .revalidate_disk = sd_revalidate_disk,
| ^~~~~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1816:35: error: initialization of 'void (*)(struct gendisk *)' from incompatible pointer type 'int (*)(struct gendisk *)' [-Werror=incompatible-pointer-types]
1816 | .revalidate_disk = sd_revalidate_disk,
| ^~~~~~~~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1816:35: note: (near initialization for 'sd_fops.unlock_native_capacity')
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_done':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:1994:36: error: 'DRIVER_SENSE' undeclared (first use in this function)
1994 | if (driver_byte(result) != DRIVER_SENSE &&
| ^~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:2056:17: error: implicit declaration of function 't10_pi_complete'; did you mean 'dpm_complete'? [-Werror=implicit-function-declaration]
2056 | t10_pi_complete(SCpnt->request, sdkp->protection_type,
| ^~~~~~~~~~~~~~~
| dpm_complete
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_spinup_disk':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:2104:56: error: 'DRIVER_SENSE' undeclared (first use in this function)
2104 | ((driver_byte(the_result) == DRIVER_SENSE) &&
| ^~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'read_capacity_error':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:2233:40: error: 'DRIVER_SENSE' undeclared (first use in this function)
2233 | if (driver_byte(the_result) == DRIVER_SENSE)
| ^~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_print_capacity':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:2552:9: error: implicit declaration of function 'sd_zbc_print_zones'; did you mean 'sd_zbc_read_zones'? [-Werror=implicit-function-declaration]
2552 | sd_zbc_print_zones(sdkp);
| ^~~~~~~~~~~~~~~~~~
| sd_zbc_read_zones
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_remove':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:3446:9: error: implicit declaration of function 'blk_register_region'; did you mean 'blk_register_queue'? [-Werror=implicit-function-declaration]
3446 | blk_register_region(devt, SD_MINORS, NULL,
| ^~~~~~~~~~~~~~~~~~~
| blk_register_queue
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'sd_start_stop_device':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:3512:41: error: 'DRIVER_SENSE' undeclared (first use in this function)
3512 | if (driver_byte(res) == DRIVER_SENSE)
| ^~~~~~~~~~~~
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c: In function 'exit_sd':
/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.c:3714:17: error: implicit declaration of function 'blk_unregister_region'; did you mean 'blk_unregister_queue'? [-Werror=implicit-function-declaration]
3714 | blk_unregister_region(sd_major(i), SD_MINORS);
| ^~~~~~~~~~~~~~~~~~~~~
| blk_unregister_queue
cc1: some warnings being treated as errors
make[2]: *** [/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi/sd.o] Error 1
make[1]: *** [/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64/drivers/scsi] Error 2
make: *** [__sub-make] Error 2
make: Leaving directory `/usr/src/kernels/5.14.11-1.el7.elrepo.x86_64'
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Tuesday, 02 November 2021, 18:35 GMT
Reason for closing:  Duplicate
Comment by Alexander Schnaidt (Namarrgon) - Wednesday, 20 October 2021, 13:39 GMT
Why is this a problem? Why are you using a centos kernel to demonstrate this? Why did you file another bugreport for the same issue? https://bugs.archlinux.org/task/72402 -> https://bugs.archlinux.org/task/63984

Loading...