Status: ok Fix bug in 1.5.0 which broke reporting of rebuild status. In the loop, we ant to make every occurance of the device as used (to avoid loops if the kernel is confused), but we will want to end up pointing to one of them... Signed-off-by: Neil Brown ### Diffstat output ./ChangeLog | 2 +- ./Monitor.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff ./ChangeLog~current~ ./ChangeLog --- ./ChangeLog~current~ 2004-06-11 16:29:47.000000000 +1000 +++ ./ChangeLog 2004-06-11 16:29:46.000000000 +1000 @@ -16,6 +16,7 @@ Changes Prior to this release - When generating --brief listing, if the standard name doesn't exist, search /dev for one rather than using a temp name. - Allow --build to build raid1 and multipath arrays. + - Fix bug so that Rebuild status monitoring works again. Changes Prior to 1.5.0 release @@ -343,4 +344,3 @@ Changes Prior to 0.5 release the --help output, is not wholy correct. After I get --follow working properly, I plan to revise the various documentation and/or the code to make sure the two match. - diff ./Monitor.c~current~ ./Monitor.c --- ./Monitor.c~current~ 2004-06-11 16:29:47.000000000 +1000 +++ ./Monitor.c 2004-06-11 16:29:46.000000000 +1000 @@ -189,7 +189,7 @@ int Monitor(mddev_dev_t devlist, for (st=statelist; st; st=st->next) { mdu_array_info_t array; - struct mdstat_ent *mse; + struct mdstat_ent *mse = NULL, *mse2; char *dev = st->devname; int fd; unsigned int i; @@ -235,9 +235,11 @@ int Monitor(mddev_dev_t devlist, } } - for (mse = mdstat ; mse ; mse=mse->next) - if (mse->devnum == st->devnum) - mse->devnum = MAXINT; /* flag it as "used" */ + for (mse2 = mdstat ; mse2 ; mse2=mse2->next) + if (mse2->devnum == st->devnum) { + mse2->devnum = MAXINT; /* flag it as "used" */ + mse = mse2; + } if (st->utime == array.utime && st->failed == array.failed_disks &&