]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super1.c
Fix bug where v1 superblock might appear active when they should be clean.
[thirdparty/mdadm.git] / super1.c
index f1732f7b6c751e56842b255702e4bf3ad5b2f729..88f1502455d2dab9f06f2a39b0eb467a26973b43 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -431,7 +431,9 @@ static void getinfo_super1(struct mdinfo *info, void *sbv)
        info->array.ctime = __le64_to_cpu(sb->ctime);
        info->array.utime = __le64_to_cpu(sb->utime);
        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->component_size = __le64_to_cpu(sb->size);