summaryrefslogtreecommitdiff
path: root/Monitor.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-06-02 15:28:36 +1000
committerNeilBrown <neilb@suse.de>2009-06-02 15:28:36 +1000
commit3b435195fc34ba447c8ca8fa2f90cd6d5ad88cdb (patch)
treeef736cccca9d0c9053dc6437f7d229dfcdd9b23f /Monitor.c
parent38a07ed61e58320e18a6c25ab9da4d749d43bdc5 (diff)
parentc7b474474c793e9a82bd0d84868fdf7367c89696 (diff)
Merge branch 'master' into devel-3.0
Conflicts: super0.c super1.c
Diffstat (limited to 'Monitor.c')
-rw-r--r--Monitor.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/Monitor.c b/Monitor.c
index a0651e43..f6fd95cd 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -480,16 +480,25 @@ int Monitor(mddev_dev_t devlist,
}
}
if (dev > 0) {
- if (ioctl(fd2, HOT_REMOVE_DISK,
- (unsigned long)dev) == 0) {
- if (ioctl(fd1, HOT_ADD_DISK,
- (unsigned long)dev) == 0) {
+ struct mddev_dev_s devlist;
+ char devname[20];
+ devlist.next = NULL;
+ devlist.used = 0;
+ devlist.re_add = 0;
+ devlist.writemostly = 0;
+ devlist.devname = devname;
+ sprintf(devname, "%d:%d", major(dev), minor(dev));
+
+ devlist.disposition = 'r';
+ if (Manage_subdevs(st2->devname, fd2, &devlist, -1) == 0) {
+ devlist.disposition = 'a';
+ if (Manage_subdevs(st->devname, fd1, &devlist, -1) == 0) {
alert("MoveSpare", st->devname, st2->devname, mailaddr, mailfrom, alert_cmd, dosyslog);
close(fd1);
close(fd2);
break;
}
- else ioctl(fd2, HOT_ADD_DISK, (unsigned long) dev);
+ else Manage_subdevs(st2->devname, fd2, &devlist, -1);
}
}
close(fd1);