Fix bug where v1 superblock might appear active when they should be clean.

Only happens on kernel with 32 bit sector_t.
This commit is contained in:
Neil Brown 2006-12-14 17:32:59 +11:00
parent beae1dfe2e
commit 4855f95c70
2 changed files with 4 additions and 2 deletions

View File

@ -990,7 +990,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd,
if (must_close) close(mdfd); if (must_close) close(mdfd);
return 0; return 0;
} }
if (verbose >= 0) { if (verbose >= -1) {
fprintf(stderr, Name ": %s assembled from %d drive%s", mddev, okcnt, okcnt==1?"":"s"); fprintf(stderr, Name ": %s assembled from %d drive%s", mddev, okcnt, okcnt==1?"":"s");
if (sparecnt) if (sparecnt)
fprintf(stderr, " and %d spare%s", sparecnt, sparecnt==1?"":"s"); fprintf(stderr, " and %d spare%s", sparecnt, sparecnt==1?"":"s");

View File

@ -431,7 +431,9 @@ static void getinfo_super1(struct mdinfo *info, void *sbv)
info->array.ctime = __le64_to_cpu(sb->ctime); info->array.ctime = __le64_to_cpu(sb->ctime);
info->array.utime = __le64_to_cpu(sb->utime); info->array.utime = __le64_to_cpu(sb->utime);
info->array.chunk_size = __le32_to_cpu(sb->chunksize)*512; info->array.chunk_size = __le32_to_cpu(sb->chunksize)*512;
info->array.state = (__le64_to_cpu(sb->resync_offset)+1) ? 0 : 1; info->array.state =
(__le64_to_cpu(sb->resync_offset) >= __le64_to_cpu(sb->size))
? 1 : 0;
info->data_offset = __le64_to_cpu(sb->data_offset); info->data_offset = __le64_to_cpu(sb->data_offset);
info->component_size = __le64_to_cpu(sb->size); info->component_size = __le64_to_cpu(sb->size);