]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
fix write mostly for add and re-add
authorNeil Brown <neilb@suse.de>
Mon, 3 Apr 2006 00:11:51 +0000 (00:11 +0000)
committerNeil Brown <neilb@suse.de>
Mon, 3 Apr 2006 00:11:51 +0000 (00:11 +0000)
The following patch makes it possible to tag a device as write-mostly on
--add and --re-add with a non-persistent superblock array. Previously,
this was not working.

Signed-Off-By: Paul Clements <paul.clements@steeleye.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Manage.c

index 9e643163cf273e4dff84897b7f683f3a9b6d0910..ca539db5370da27ee13f378d6e3586588aea399b 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -341,6 +341,8 @@ int Manage_subdevs(char *devname, int fd,
                                                break;
                                        }
                        }
+                       if (dv->writemostly)
+                               disc.state |= (1 << MD_DISK_WRITEMOSTLY);
                        if (ioctl(fd,ADD_NEW_DISK, &disc)) {
                                fprintf(stderr, Name ": add new device failed for %s as %d: %s\n",
                                        dv->devname, j, strerror(errno));