Seagate / propeller

Customized lvmlockd
GNU General Public License v2.0
4 stars 7 forks source link

Global Lock Failure after Firmware update #102

Open TProhofsky opened 4 years ago

TProhofsky commented 4 years ago

Currently lvmlockd-idm.c check the drive firmware to validate if the drive can be used. When a firmware download is complete the kernel is not refeshing the FW version as seen by lsscsi. Issuing sg_reset of both target and bus did not trigger a refresh. Neither did partprobe. Currently a server reboot is required after a FW download.

Example $ ./seachest -s Vendor Handle Model Number Serial Number FwRev ATA /dev/sg0 ST240FN0021 Z3X00007 B550 ATA /dev/sg1 ST240FN0001 P3X01226 B560 SEAGATE /dev/sg10 XS7680TE70014 HLN0300A 1759 SEAGATE /dev/sg11 XS7680TE70014 HLN0300E 1759 SEAGATE /dev/sg12 XS7680TE70014 HLN0301C 1759 SEAGATE /dev/sg13 XS7680TE70014 HLN0301X 1759 SEAGATE /dev/sg14 XS7680TE70014 HLN03004 1759 SEAGATE /dev/sg15 XS7680TE70014 HLN0300V 1759 SEAGATE /dev/sg16 XS7680TE70014 HLN0301W 1759 SEAGATE /dev/sg17 XS7680TE70014 HLN0302Z 1759 XYRATEX /dev/sg18 EB-2425-E12EBD SHM1007184RAYA7 4026 SEAGATE /dev/sg2 XS7680TE70014 HLN03026 1759 SEAGATE /dev/sg3 XS7680TE70014 HLN0302F 1759 SEAGATE /dev/sg4 XS7680TE70014 HLN0300S 1759 SEAGATE /dev/sg5 XS7680TE70014 HLN03036 1759 SEAGATE /dev/sg6 XS7680TE70014 HLN0301S 1759 SEAGATE /dev/sg7 XS7680TE70014 HLN03005 1759 SEAGATE /dev/sg8 XS7680TE70014 HLN0310J 1759 SEAGATE /dev/sg9 XS7680TE70014 HLN0301L 1759

$ lsscsi -g [0:0:0:0] disk ATA ST240FN0021 B550 /dev/sda /dev/sg0 [0:0:1:0] disk ATA ST240FN0001 B560 /dev/sdb /dev/sg1 [1:0:0:0] disk SEAGATE XS7680TE70014 2229 /dev/sdc /dev/sg2 [1:0:1:0] disk SEAGATE XS7680TE70014 2229 /dev/sdd /dev/sg3 [1:0:2:0] disk SEAGATE XS7680TE70014 2229 /dev/sde /dev/sg4 [1:0:3:0] disk SEAGATE XS7680TE70014 2229 /dev/sdf /dev/sg5 [1:0:4:0] disk SEAGATE XS7680TE70014 2229 /dev/sdg /dev/sg6 [1:0:5:0] disk SEAGATE XS7680TE70014 2229 /dev/sdh /dev/sg7 [1:0:6:0] disk SEAGATE XS7680TE70014 2229 /dev/sdi /dev/sg8 [1:0:7:0] disk SEAGATE XS7680TE70014 2229 /dev/sdj /dev/sg9 [1:0:8:0] disk SEAGATE XS7680TE70014 2229 /dev/sdk /dev/sg10 [1:0:9:0] disk SEAGATE XS7680TE70014 2229 /dev/sdl /dev/sg11 [1:0:10:0] disk SEAGATE XS7680TE70014 2229 /dev/sdm /dev/sg12 [1:0:11:0] disk SEAGATE XS7680TE70014 2229 /dev/sdn /dev/sg13 [1:0:12:0] disk SEAGATE XS7680TE70014 2229 /dev/sdo /dev/sg14 [1:0:13:0] disk SEAGATE XS7680TE70014 2229 /dev/sdp /dev/sg15 [1:0:14:0] disk SEAGATE XS7680TE70014 2229 /dev/sdq /dev/sg16 [1:0:15:0] disk SEAGATE XS7680TE70014 2229 /dev/sdr /dev/sg17 [1:0:16:0] enclosu XYRATEX EB-2425-E12EBD 4026 - /dev/sg18

Leo-Yan commented 4 years ago

I observed for the firmware 1759 I also need to restart the box, but for the other old firmware versions, after updated the firmware, "lsscsi" -g can display the correct version number. It's good to confirm if this is related with firmware rather than Linux kernel?

xahmad commented 3 years ago

lsscsi uses the sysfs to read it. If you do a trace the process, you will see the following, where rev is the firmware revision:

openat(AT_FDCWD, "/sys/bus/scsi/devices/4:0:0:0/rev", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
read(3, "U001\n", 4096)                 = 5
close(3)  
TProhofsky commented 3 years ago

So how does /sys/bus/scsi/devices/4:0:0:0/rev get triggered to re-read the FWrev from the drive?