From: Scott Schaefer Date: Tue, 2 Aug 2011 03:27:32 +0000 (+1000) Subject: --add incorrectly sets writemostly X-Git-Tag: mdadm-3.2.3~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9a88e7b6d53859049aee0d118e10546780ca9de9;p=thirdparty%2Fmdadm.git --add incorrectly sets writemostly Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628667 Bug-Debian: http://bugs.debian.org/628667 Signed-off-by: NeilBrown --- diff --git a/super1.c b/super1.c index 09be351e..b35e89f4 100644 --- a/super1.c +++ b/super1.c @@ -1056,6 +1056,8 @@ static int write_init_super1(struct supertype *st) sb->dev_number = __cpu_to_le32(di->disk.number); if (di->disk.state & (1<devflags |= __cpu_to_le32(WriteMostly1); + else + sb->devflags &= ~(__cpu_to_le32(WriteMostly1)); if ((rfd = open("/dev/urandom", O_RDONLY)) < 0 || read(rfd, sb->device_uuid, 16) != 16) {