summaryrefslogtreecommitdiff
path: root/super0.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-11-17 12:31:10 +1100
committerNeilBrown <neilb@suse.de>2009-11-17 12:31:10 +1100
commit672ca1b7272c69ea3055aeb746a77b8408e5f3ed (patch)
tree12c2af1837d4813e3e19699c4be4b8b8cc7fc760 /super0.c
parentf22385f9826bcf35c8055c3b89b731f5760a46c5 (diff)
downloadmdadm-672ca1b7272c69ea3055aeb746a77b8408e5f3ed.tar.gz
Assemble/super0: allow non-in-sync devices to be assembled without complaint.
Other metadata formats already did not worry about whether 'sync' was missing or not. super0 needs that now, but only for 0.91 metadata that is undergoing reshape. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/super0.c b/super0.c
index 69fb460..9f78b94 100644
--- a/super0.c
+++ b/super0.c
@@ -478,7 +478,14 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
if (strcmp(update, "assemble")==0) {
int d = info->disk.number;
int wonly = sb->disks[d].state & (1<<MD_DISK_WRITEMOSTLY);
- if ((sb->disks[d].state & ~(1<<MD_DISK_WRITEMOSTLY))
+ int mask = (1<<MD_DISK_WRITEMOSTLY);
+ int add = 0;
+ if (sb->minor_version >= 91)
+ /* During reshape we don't insist on everything
+ * being marked 'sync'
+ */
+ add = (1<<MD_DISK_SYNC);
+ if (((sb->disks[d].state & ~mask) | add)
!= info->disk.state) {
sb->disks[d].state = info->disk.state | wonly;
rv = 1;