From: NeilBrown Date: Tue, 31 Mar 2009 03:27:02 +0000 (+1100) Subject: md: Fix is_mddev_idle test (again). X-Git-Tag: v2.6.30-rc1~241^2~52 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eea1bf384e05b5ab747f8530c4fba9e9e6907fff;p=pandora-kernel.git 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 --- Reading git-diff-tree failed