Add the following ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="end" ... LABEL="end" to generated udev rules. Signed-off-by: Song Liu <songliubraving@xxxxxx> --- policy.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/policy.c b/policy.c index 177544a..7341659 100644 --- a/policy.c +++ b/policy.c @@ -810,7 +810,10 @@ int policy_check_path(struct mdinfo *disk, struct map_ent *array) /* invocation of udev rule file */ char udev_template_start[] = "# do not edit this file, it is automatically generated by mdadm\n" -"\n"; +"ENV{ID_FS_TYPE}==\"ddf_raid_member|isw_raid_member|linux_raid_member\", " +"GOTO=\"end\"\n"; + +char udev_template_end[] = "LABEL=\"end\"\n"; /* find rule named rule_type and return its value */ char *find_rule(struct rule *rule, char *rule_type) @@ -962,6 +965,11 @@ int Write_rules(char *rule_name) if (generate_entries(fd) < 0) goto abort; + if (write(fd, udev_template_end, + sizeof(udev_template_end) - 1) + != (int)sizeof(udev_template_end)-1) + goto abort; + fsync(fd); if (rule_name) { close(fd); -- 2.4.6 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html