On Thursday July 6, [EMAIL PROTECTED] wrote:
> Still more problems ... :(
> 
> My md raid5 still does not always shut down cleanly. The last few
> lines of the shutdown sequence are always as follows:
> 
> [...]
> Will now halt.
> md: stopping all md devices.
> md: md0 still in use.
> Synchronizing SCSI cache for disk /dev/sdd:
> Synchronizing SCSI cache for disk /dev/sdc:
> Synchronizing SCSI cache for disk /dev/sdb:
> Synchronizing SCSI cache for disk /dev/sda:
> Shutdown: hde
> System halted.
> 
> Most of the time the md array comes up clean on the next boot, often
> enough it does not. Having the array rebuild after every other reboot
> is not my idea of fun, because the only reason to take it down is to
> exchange a failing disk.
> 

How are you shutting down the machine?  If something sending SIGKILL
to all processes?  If it does, then md really should shut down cleanly
every time....

That said, I do see some room for improvement in the md shutdown
sequence - it shouldn't give up at that point just because the device
seems to be in use....  I'll look into that.
You could try the following patch.  I think it should be safe.

NeilBrown

Signed-off-by: Neil Brown <[EMAIL PROTECTED]>

### Diffstat output
 ./drivers/md/md.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff .prev/drivers/md/md.c ./drivers/md/md.c
--- .prev/drivers/md/md.c       2006-07-07 08:11:43.000000000 +1000
+++ ./drivers/md/md.c   2006-07-07 08:12:15.000000000 +1000
@@ -3217,7 +3217,7 @@ static int do_md_stop(mddev_t * mddev, i
        struct gendisk *disk = mddev->gendisk;
 
        if (mddev->pers) {
-               if (atomic_read(&mddev->active)>2) {
+               if (mode != 1 && atomic_read(&mddev->active)>2) {
                        printk("md: %s still in use.\n",mdname(mddev));
                        return -EBUSY;
                }
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to