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 <neilb@suse.de>
This commit is contained in:
NeilBrown 2008-11-04 21:56:42 +11:00
parent a714580e02
commit d49410d3ab
1 changed files with 4 additions and 1 deletions

View File

@ -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");