From: NeilBrown Date: Tue, 4 Nov 2008 10:56:42 +0000 (+1100) Subject: Stop: drop any partitions that may be associated with an array when stopping it. X-Git-Tag: mdadm-3.0-devel2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d49410d3ab87cf62f1f34eb6ccca5eaefb2f5428;p=thirdparty%2Fmdadm.git Stop: drop any partitions that may be associated with an array when stopping it. Not all kernels automatically discard partitions when the array is stopped, so call the RRPART ioctl to force it. Signed-off-by: NeilBrown --- diff --git a/Manage.c b/Manage.c index 7855e21a..94246503 100644 --- 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");