X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=super1.c;h=6f91611cc3ac0f694b31af5232d90fa1c843eb84;hb=2cfe6f7c646ebc25043f7607f5756edad0bc3071;hp=e76f77775afd90f64a8630f3b5280000e14fc8b2;hpb=e6e9dd3f1b255f9921ebc023c1e5b65601a637e2;p=thirdparty%2Fmdadm.git diff --git a/super1.c b/super1.c index e76f7777..6f91611c 100644 --- a/super1.c +++ b/super1.c @@ -1040,7 +1040,7 @@ static void getinfo_super1(struct supertype *st, struct mdinfo *info, char *map) info->disk.state = 0; /* spare: not active, not sync, not faulty */ break; case MD_DISK_ROLE_FAULTY: - info->disk.state = 1; /* faulty */ + info->disk.state = (1 << MD_DISK_FAULTY); /* faulty */ break; case MD_DISK_ROLE_JOURNAL: info->disk.state = (1 << MD_DISK_JOURNAL); @@ -1600,11 +1600,12 @@ static int add_to_super1(struct supertype *st, mdu_disk_info_t *dk, } dk_state = dk->state & ~(1<raid_disk); else if (dk_state & (1< spare */ + else if ((dk_state & ~(1< spare */ *rp = MD_DISK_ROLE_SPARE; else *rp = MD_DISK_ROLE_FAULTY;