Skip to contentSkip to conversation

mdadm 2.4: fix write mostly for add and re-add

PATCH In review Paul Clements 2 participants 2 messages Apr 1, 2006 – Apr 3, 2006 MD RAID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mdadm 2.4: fix write mostly for add and re-add

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.

Thanks,
Paul

 Manage.c |    2 ++
 1 files changed, 2 insertions(+)
Manage.c +2 -0
@@ -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));
#1 lore raw
Quoted 3 lines · On Friday March 31, [email protected] wrote:

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.

Thanks Paul. It'll be in the next release.

NeilBrown

Quoted 19 lines

Thanks,
Paul

 Manage.c |    2 ++
 1 files changed, 2 insertions(+)
Manage.c +2 -0
@@ -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));