When disk is added, set valid slot numbers (positive) only. Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx> --- sysfs.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/sysfs.c b/sysfs.c index 16e41fb..7a0403d 100644 --- a/sysfs.c +++ b/sysfs.c @@ -614,7 +614,8 @@ int sysfs_add_disk(struct mdinfo *sra, struct mdinfo *sd, int resume) * yet, so just ignore status for now. */ sysfs_set_str(sra, sd, "state", "insync"); - rv |= sysfs_set_num(sra, sd, "slot", sd->disk.raid_disk); + if (sd->disk.raid_disk >= 0) + rv |= sysfs_set_num(sra, sd, "slot", sd->disk.raid_disk); if (resume) sysfs_set_num(sra, sd, "recovery_start", sd->recovery_start); } -- 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