dcavalca / rpms / mdadm

Forked from rpms/mdadm 3 years ago
Clone

Blame SOURCES/mdadm-3.3.2-imsm-use-timeout-when-waiting-for-reshape-progress.patch

efb5be
From 5ff3a780abeb5e4d97727dd213e5923f55cae28b Mon Sep 17 00:00:00 2001
efb5be
From: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
efb5be
Date: Tue, 5 Jan 2016 17:16:15 +0100
efb5be
Subject: [PATCH] imsm: use timeout when waiting for reshape progress
efb5be
efb5be
Waiting for reshape progress is done by using select() on sync_completed
efb5be
to block until an exception condition is signalled on the
efb5be
filedescriptor. This happens when the attribute's value is updated by
efb5be
the kernel, but if the array is stopped when mdadm is blocked on
efb5be
select() this will never happen, because this attribute is then removed
efb5be
and apparently the kernel doesn't do sysfs_notify() when removing a
efb5be
sysfs attribute. So set a 3 second timeout for the sysfs_wait() call.
efb5be
efb5be
Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
efb5be
Signed-off-by: NeilBrown <neilb@suse.com>
efb5be
---
efb5be
 super-intel.c | 3 ++-
efb5be
 1 file changed, 2 insertions(+), 1 deletion(-)
efb5be
efb5be
diff --git a/super-intel.c b/super-intel.c
efb5be
index b836816..3b3d561 100644
efb5be
--- a/super-intel.c
efb5be
+++ b/super-intel.c
efb5be
@@ -10393,7 +10393,8 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata)
efb5be
 
efb5be
 	do {
efb5be
 		char action[20];
efb5be
-		sysfs_wait(fd, NULL);
efb5be
+		int timeout = 3000;
efb5be
+		sysfs_wait(fd, &timeout);
efb5be
 		if (sysfs_get_str(sra, NULL, "sync_action",
efb5be
 				  action, 20) > 0 &&
efb5be
 				strncmp(action, "reshape", 7) != 0) {
efb5be
-- 
efb5be
2.5.0
efb5be