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>
This commit is contained in:
NeilBrown 2009-11-17 12:31:10 +11:00
parent f22385f982
commit 672ca1b727
1 changed files with 8 additions and 1 deletions

View File

@ -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;