mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zdev: Fix broken zfcp-lun udev rule check
zdev incorrectly reports an invalid udev rule for zfcp-lun type rules. This is caused by a faulty check for an empty udev rule file. This commit fixes the check to only report invalid rules when there was no valid configuration directive found in a zfcp-lun type udev rule. Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com> Reported-by: Steffen Maier <maier@linux.ibm.com> Reported-by: Benjamin Block <bblock@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
139dff3525
commit
49da03e2e7
@@ -345,6 +345,7 @@ static exit_code_t udev_read_zfcp_lun_rule(const char *filename,
|
||||
in_fc,
|
||||
in_scsi,
|
||||
} state = none;
|
||||
bool empty_rule = true;
|
||||
|
||||
rc = udev_read_file(filename, &file);
|
||||
if (rc)
|
||||
@@ -374,16 +375,22 @@ static exit_code_t udev_read_zfcp_lun_rule(const char *filename,
|
||||
state = in_scsi;
|
||||
node = zfcp_lun_node_from_entry(entry, node,
|
||||
list);
|
||||
if (node)
|
||||
empty_rule = false;
|
||||
}
|
||||
break;
|
||||
case in_fc:
|
||||
node = zfcp_lun_node_from_entry(entry, node, list);
|
||||
if (node)
|
||||
if (node) {
|
||||
add_fc_setting_from_entry(entry, node);
|
||||
empty_rule = false;
|
||||
}
|
||||
break;
|
||||
case in_scsi:
|
||||
if (node)
|
||||
if (node) {
|
||||
add_scsi_setting_from_entry(entry, node);
|
||||
empty_rule = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -393,7 +400,7 @@ static exit_code_t udev_read_zfcp_lun_rule(const char *filename,
|
||||
out:
|
||||
udev_free_file(file);
|
||||
|
||||
if (!node)
|
||||
if (empty_rule)
|
||||
warn_once("Warning: Invalid udev rule: %s\n", filename);
|
||||
|
||||
return rc;
|
||||
|
||||
Reference in New Issue
Block a user