diff options
author | NeilBrown <neilb@suse.de> | 2009-03-31 14:27:02 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2009-03-31 14:27:02 +1100 |
commit | eea1bf384e05b5ab747f8530c4fba9e9e6907fff (patch) | |
tree | ed4c05f8bd7e5805092e9c6a2c257ca71dc0fe2d /include/linux/raid | |
parent | 99adcd9d67aaf04e28f5ae96df280f236bde4b66 (diff) | |
download | op-kernel-dev-eea1bf384e05b5ab747f8530c4fba9e9e6907fff.zip op-kernel-dev-eea1bf384e05b5ab747f8530c4fba9e9e6907fff.tar.gz |
md: Fix is_mddev_idle test (again).
There are two problems with is_mddev_idle.
1/ sync_io is 'atomic_t' and hence 'int'. curr_events and all the
rest are 'long'.
So if sync_io were to wrap on a 64bit host, the value of
curr_events would go very negative suddenly, and take a very
long time to return to positive.
So do all calculations as 'int'. That gives us plenty of precision
for what we need.
2/ To initialise rdev->last_events we simply call is_mddev_idle, on
the assumption that it will make sure that last_events is in a
suitable range. It used to do this, but now it does not.
So now we need to be more explicit about initialisation.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'include/linux/raid')
-rw-r--r-- | include/linux/raid/md_k.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 9743e4d..4aedb9f 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h @@ -51,7 +51,7 @@ struct mdk_rdev_s sector_t size; /* Device size (in blocks) */ mddev_t *mddev; /* RAID array if running */ - long last_events; /* IO event timestamp */ + int last_events; /* IO event timestamp */ struct block_device *bdev; /* block device handle */ |