Add support for setting a RAID set readwrite after creation. Default a
authorJamie Cameron <jcameron@webmin.com>
Fri, 18 Dec 2009 21:21:17 +0000 (13:21 -0800)
committerJamie Cameron <jcameron@webmin.com>
Fri, 18 Dec 2009 21:21:17 +0000 (13:21 -0800)
raid is activated auto-read-only until first write. So a rebuild is only
started when writing something to the RAID. With this patch it enters
read/write mode directly. Thanks to Caspar Smit.

raid/raid-lib.pl

index 3f8a013..79d0e6a 100755 (executable)
@@ -352,6 +352,11 @@ else {
                $cmd .= " $d";
                }
        local $out = &backquote_logged("$cmd 2>&1 </dev/null");
+       
+       # After creating a RAID set mode to read/write.
+       local $cmd = "mdadm --readwrite $_[0]->{'value'}";
+       local $out = &backquote_logged("$cmd 2>&1 </dev/null");
+
        return $? ? &text('emdadmcreate', "<pre>$out</pre>") : undef;
        }
 }