]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Stop: drop any partitions that may be associated with an array when stopping it.
authorNeilBrown <neilb@suse.de>
Tue, 4 Nov 2008 10:56:42 +0000 (21:56 +1100)
committerNeilBrown <neilb@suse.de>
Tue, 4 Nov 2008 10:56:42 +0000 (21:56 +1100)
Not all kernels automatically discard partitions when the
array is stopped,  so call the RRPART ioctl to force it.

Signed-off-by: NeilBrown <neilb@suse.de>
Manage.c

index 7855e21aa561b5320a08aa0ec5f23f8360aa236a..9424650301ddef0d7f44c4ccc94c78b891106f4c 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -260,8 +260,11 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet)
                        return 1;
                }
                /* prior to 2.6.28, KOBJ_CHANGE was not sent when an md array
-                * was stopped, so We'll do it here just to be sure.
+                * was stopped, so We'll do it here just to be sure.  Drop any
+                * partitions as well...
                 */
+               if (fd >= 0)
+                       ioctl(fd, BLKRRPART, 0);
                if (mdi)
                        sysfs_uevent(mdi, "change");