Bug#442874: mdadm: --write-mostly does nothing if device is re-added using --add

Neil Brown neilb at suse.de
Mon Sep 24 03:16:16 UTC 2007


Thanks for the bug report.

This is now fixed in the upstream .git by the following patch.

It highlights the fact that while you can turn on the write-mostly
bit, you cannot easily turn it off.  I wonder if that is a problem.

NeilBrown


### Diffstat output
 ./Manage.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff .prev/Manage.c ./Manage.c
--- .prev/Manage.c	2007-08-10 13:36:18.000000000 +1000
+++ ./Manage.c	2007-09-24 13:09:09.000000000 +1000
@@ -395,6 +395,8 @@ int Manage_subdevs(char *devname, int fd
 						disc.number = mdi.disk.number;
 						disc.raid_disk = mdi.disk.raid_disk;
 						disc.state = mdi.disk.state;
+						if (dv->writemostly)
+							disk.state |= 1 << MD_DISK_WRITEMOSTLY;
 						if (ioctl(fd, ADD_NEW_DISK, &disc) == 0) {
 							if (verbose >= 0)
 								fprintf(stderr, Name ": re-added %s\n", dv->devname);





More information about the pkg-mdadm-devel mailing list