diff options
author | Neil Brown <neilb@suse.de> | 2008-07-12 12:27:36 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-07-12 12:27:36 +0200 |
commit | a0c8a17f66f944151434dff06dd28c83e0893e88 (patch) | |
tree | 7fceeb47ba54465b3c6beebe69c26efb4723e076 /super0.c | |
parent | Always zero a struct ddf_super on allocation. (diff) | |
download | mdadm-a0c8a17f66f944151434dff06dd28c83e0893e88.tar.xz mdadm-a0c8a17f66f944151434dff06dd28c83e0893e88.zip |
Fix write_init_super usage when hot-adding a spare
Using write_init_super to add a spare to an active array is quite
different to how it is used when creating an array.
It mostly works, but if we are adding two devices to an array,
then when we add the second, there are still traces of the first
which confuse write_init_super.
So get write_init_super to ignore those traces. Longer term, we
probably want to do this differently as for DDF, hot-adding to
an active array will have to be quite different - it will want to
write to all metadata, possibly via mdmon.
Diffstat (limited to 'super0.c')
-rw-r--r-- | super0.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -698,6 +698,8 @@ static int write_init_super0(struct supertype *st) if (di->disk.state == 1) continue; + if (di->fd == -1) + continue; Kill(di->devname, 0, 1, 1); Kill(di->devname, 0, 1, 1); |