diff options
author | Artur Paszkiewicz <artur.paszkiewicz@intel.com> | 2016-01-05 17:16:15 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2016-01-07 11:09:53 +1100 |
commit | 5ff3a780abeb5e4d97727dd213e5923f55cae28b (patch) | |
tree | fa4d45cfe8db9163e7494cf64e84b179fdf5c503 | |
parent | 60f0f54d6f5227f229e7131d34f93f76688b085f (diff) | |
download | mdadm-5ff3a780abeb5e4d97727dd213e5923f55cae28b.tar.gz |
imsm: use timeout when waiting for reshape progress
Waiting for reshape progress is done by using select() on sync_completed
to block until an exception condition is signalled on the
filedescriptor. This happens when the attribute's value is updated by
the kernel, but if the array is stopped when mdadm is blocked on
select() this will never happen, because this attribute is then removed
and apparently the kernel doesn't do sysfs_notify() when removing a
sysfs attribute. So set a 3 second timeout for the sysfs_wait() call.
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.com>
-rw-r--r-- | super-intel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/super-intel.c b/super-intel.c index b836816..3b3d561 100644 --- a/super-intel.c +++ b/super-intel.c @@ -10393,7 +10393,8 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata) do { char action[20]; - sysfs_wait(fd, NULL); + int timeout = 3000; + sysfs_wait(fd, &timeout); if (sysfs_get_str(sra, NULL, "sync_action", action, 20) > 0 && strncmp(action, "reshape", 7) != 0) { |