-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
55-scsi-sg3_id.rules: removal of scsi_id, and cleanup #22
Conversation
Hannes, it's been two weeks ... could you voice an opinion on this patch set? It would certainly be beneficial for the systemd pull request to have this one accepted first. If you disagree with my changes, could you give me directions what to modify? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the label "compat" used?
Shouldn't it be introduced with a commii actually using it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Hannes Reinecke hare@suse.com
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Hannes Reinecke hare@suse.com
Sigh. Github doesn't make for a nice patch-by-patch review.
|
Hannes, this is a github "feature", see why are my commits in the wrong order? and isaacs/github#386. If you look at the patches in the actual commit order
"compat" is introduced in |
Hannes, I've sent you the patches by e-mail. Ping for review... |
Reviewed-by: Hannes Reinecke <hare@suse.com>
Updated the set of commits after Hannes' review. The current set has been tested for tapes too, using https://github.com/markh794/mhvtl. |
69dceaa
to
b9081d2
Compare
Restore compatibility with scsi_id by truncating ID_WWN to 16 chars. ID_WWN_WITH_EXTENSION is what actually matters for SCSI, but we should get this right nevertheless.
Separate the "compat" rules for creating ID_* variables from SCSI_* variables from the block doing actual inquiry. Also improve code readability by spelling out the sysfs vs. sg code more clearly. This patch should have no functional impact.
In order to replace scsi_id functionality from udev's 60-persistent-storage.rules, add code for non-SCSI devices that support sg INQUIRY (only CCISS at this time). CCISS has been deprecated since Linux 4.14, but these rules are supposed to work with older kernels, too.
In order to replace scsi_id functionality in udev's 60-persistent-storage.rules, add support for some non-block devices. These rules have been tested using the emulated virtual tape library mhVTL (https://github.com/markh794/mhvtl). It turns out that preferring sysfs attributes for inquiry is even more beneficial for those than for disks.
ata_id or usb_id may have already set these variables. Don't overwrite them in this case.
scsi_id sets ID_TARGET_PORT=%x.
As of 2018 kernel 4.15, the kernel doesn't provide VPD pages for "SPC" devices (SCSI version 0x03, ANSI INCITS 301-1997) in sysfs. It's usually safe to try though (no counter-example is known), and for scsi_id compatibility, we have to try. If the kernel ever changes its policy, this rule can perhaps be dropped.
I've attempted a rewrite of systemd's 60-persistent-storage.rules, with the following goals:
(this implies changes in 55-sg3-utils.rules)
symlink creation
lines, thus less conditions individual rules, thus more GOTOs
separating blocks of code where certain conditins are known to
hold.
This is the sg3_utils part. I also submitted a pull request for systemd:
systemd/systemd#7594