summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-12-14 17:32:59 +1100
committerNeil Brown <neilb@suse.de>2006-12-14 17:32:59 +1100
commit4855f95c7081d7438b55fed8f8808cc656f0ccc0 (patch)
tree439dcdac833780dbb5e8d23b4ae74588ae7a1e87 /super1.c
parentbeae1dfe2e5a3f11e6e52a93fbf617d644708415 (diff)
downloadmdadm-4855f95c7081d7438b55fed8f8808cc656f0ccc0.tar.gz
mdadm-4855f95c7081d7438b55fed8f8808cc656f0ccc0.tar.xz
mdadm-4855f95c7081d7438b55fed8f8808cc656f0ccc0.zip
Fix bug where v1 superblock might appear active when they should be clean.
Only happens on kernel with 32 bit sector_t.
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/super1.c b/super1.c
index f1732f7..88f1502 100644
--- 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);