disk.number = i;
disk.raid_disk = i;
disk.state = (1<<MD_DISK_SYNC) | (1<<MD_DISK_ACTIVE);
- if (dv->writemostly)
+ if (dv->writemostly == 1)
disk.state |= 1<<MD_DISK_WRITEMOSTLY;
disk.major = major(stb.st_rdev);
disk.minor = minor(stb.st_rdev);
+Changed Prior to this release
+ - --readwrite can be used with --re-add to clear the writemostly
+ flag.
+
Changes Prior to 2.6.7 release
- Avoid NULL reference calling free_super and elsewhere.
- Remove stray semicolon (Causes compile error with gcc-2.95)
(1<<MD_DISK_SYNC);
else
info.disk.state = 0;
- if (dv->writemostly)
+ if (dv->writemostly == 1)
info.disk.state |= (1<<MD_DISK_WRITEMOSTLY);
if (dnum == insert_point ||
disc.number = mdi.disk.number;
disc.raid_disk = mdi.disk.raid_disk;
disc.state = mdi.disk.state;
- if (dv->writemostly)
+ if (dv->writemostly == 1)
disc.state |= 1 << MD_DISK_WRITEMOSTLY;
+ if (dv->writemostly == 2)
+ disc.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);
disc.number =j;
disc.state = 0;
if (array.not_persistent==0) {
- if (dv->writemostly)
+ if (dv->writemostly == 1)
disc.state |= 1 << MD_DISK_WRITEMOSTLY;
tst->ss->add_to_super(tst, &disc);
if (tst->ss->write_init_super(tst, &disc,
break;
}
}
- if (dv->writemostly)
+ if (dv->writemostly == 1)
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",
same as
.BR \-\-fail .
+.TP
+.BR \-\-write\-mostly
+Subsequent devices that are added or re-added will have the 'write-mostly'
+flag set. This is only valid for RAID! and means that the 'md' driver
+will avoid reading from these devices if possible.
+.TP
+.BR \-\-readwrite
+Subsequent devices that are added or re-added will have the 'write-mostly'
+flag cleared.
+
+
.P
Each of these options require that the first device listed is the array
to be acted upon, and the remainder are component devices to be added,
writemostly = 1;
continue;
+ case O(MANAGE,'w'):
+ /* clear write-mostly for following devices */
+ writemostly = 2;
+ continue;
+
+
case O(GROW,'z'):
case O(CREATE,'z'): /* size */
if (size >= 0) {
runstop = -1;
continue;
- case O(MANAGE,'o'):
- if (readonly < 0) {
- fprintf(stderr, Name ": Cannot have both readonly and readwrite\n");
- exit(2);
- }
- readonly = 1;
- continue;
- case O(MANAGE,'w'):
- if (readonly > 0) {
- fprintf(stderr, Name ": Cannot have both readwrite and readonly.\n");
- exit(2);
- }
- readonly = -1;
- continue;
-
case O(MISC,'Q'):
case O(MISC,'D'):
case O(MISC,'E'):
char disposition; /* 'a' for add, 'r' for remove, 'f' for fail.
* Not set for names read from .config
*/
- char writemostly;
+ char writemostly; /* 1 for 'set writemostly', 2 for 'clear writemostly' */
char re_add;
char used; /* set when used */
struct mddev_dev_s *next;