[PATCH] Unlock md devices when stopping them on reboot.
authorNeil Brown <neilb@suse.de>
Fri, 26 May 2006 00:39:25 +0000 (10:39 +1000)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 26 May 2006 18:52:11 +0000 (11:52 -0700)
otherwise we get nasty messages about locks not being released.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/md.c

index 3ca3cfb03a7e28078e125509ed858587f403d00f..ec802913f9776ffe2744e21c052e9b26ba337a0b 100644 (file)
@@ -5028,8 +5028,10 @@ static int md_notify_reboot(struct notifier_block *this,
                printk(KERN_INFO "md: stopping all md devices.\n");
 
                ITERATE_MDDEV(mddev,tmp)
-                       if (mddev_trylock(mddev))
+                       if (mddev_trylock(mddev)) {
                                do_md_stop (mddev, 1);
+                               mddev_unlock(mddev);
+                       }
                /*
                 * certain more exotic SCSI devices are known to be
                 * volatile wrt too early system reboots. While the