Resubmitting the patches after the comments. Added the TPGS check in emc and
rdac handlers. Rest is same as before..
These series of patches handles following things..
1. Fixes handler attach issue.
2. Introduces match function for all the handlers
3. cleans up the scsi_dh code
I have noticed the first problem during our multipath testing. We found that during
the lun discovery there were lots of error messages like below..
Oct 25 08:24:43 kswm-mihosi kernel: sd 0:0:0:7: [sdav] Result: hostbyte=DID_OK
Oct 25 08:24:43 kswm-mihosi kernel: sd 0:0:0:7: [sdav] Sense Key : Illegal
Oct 25 08:24:43 kswm-mihosi kernel: sd 0:0:0:7: [sdav] <<vendor>> ASC=0x94
Oct 25 08:24:43 kswm-mihosi kernel: sd 0:0:0:7: [sdav] CDB: Read(10): 28 00 00
00 00 00 00 00 80 00
Oct 25 08:24:43 kswm-mihosi kernel: end_request: I/O error, dev sdav, sector 0
These messages were coming in spite of having scsi_dh_rdac in initrd. Reason
for these errors are due to device handler not being attached properly. If the
device handler was attached then the I/O's should not go to passive paths.
Investigating further we found that there errors started with the introduction
of these patches below.
This patch introduces the match function for device handlers. But the match function
was added only to scsi_dh_alua handler.
Reason for the failure is, if the match function is not available then scsi_dh calls
scsi_get_device_flags_keyed(sdev, sdev->vendor, sdev->model, SCSI_DEVINFO_DH)
which compares the exact vendor and product strings from sdev(which comes from inquiry).
While setting up the scsi_dev_info, handlers use the short strings(example below).
Look at scsi_register_device_handler code. If you look closely the handlers have
only first few characters of the model string. So, scsi_get_device_flags_keyed
fails and handler will not be attached. This applies to all the handlers.
Strings in scsi_dh_rdac handler..
"IBM", "1746 FAStT"
Couple of ways we can fix this problem.
1. List the complete model strings in handlers for all the products.
2. Introduce match function for all the handler and remove the call to scsi_get_device_flags_keyed.
I think the option 2 is the best way to fix this problem. This removes lot of code in scsi_dh and
simplifies the things..
TESTED the patches on NetApp E series storage.
dm-devel mailing list