Skip to contentSkip to conversation

master - refresh: call resume after failing suspend

PATCH Zdenek Kabelac 1 participant 1 message May 27, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=067c0a23e5c0d41e92551c2d3e40bcaf4aeb1488
Commit:        067c0a23e5c0d41e92551c2d3e40bcaf4aeb1488
Parent:        98b41db324a432db5860cb7dbea697a09bc4321e
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Fri May 20 13:20:54 2016 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri May 27 15:47:24 2016 +0200

refresh: call resume after failing suspend

lv_refresh_suspend_resume() has escaped with fail ret code after failing suspend and could have left many volumes in suspend state.

So always unconditionally call resume also when suspend has failed.

---
 WHATS_NEW               |    1 +
 lib/metadata/lv_manip.c |    7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)
WHATS_NEW +1 -0
index 213bc72..48e0109 100644
@@ -1,5 +1,6 @@
 Version 2.02.155 - 
 ================================
+  When refresh failed in suspend, call resume upon error path.
   Support passthrough cache mode when waiting for clean cache.
   Check cache status only for 'in-use' cache pools.
   Extend setup_task() to preset flushing for dm_task object.
lib/metadata/lv_manip.c +4 -3
index 625cea6..fdf0c86 100644
@@ -1376,6 +1376,7 @@ int replace_lv_with_error_segment(struct logical_volume *lv)
 int lv_refresh_suspend_resume(const struct logical_volume *lv)
 {
 	struct cmd_context *cmd = lv->vg->cmd;
+	int r = 1;
 
 	if (!cmd->partial_activation && lv_is_partial(lv)) {
 		log_error("Refusing refresh of partial LV %s."
@@ -1386,15 +1387,15 @@ int lv_refresh_suspend_resume(const struct logical_volume *lv)
 
 	if (!suspend_lv(cmd, lv)) {
 		log_error("Failed to suspend %s.", display_lvname(lv));
-		return 0;
+		r = 0;
 	}
 
 	if (!resume_lv(cmd, lv)) {
 		log_error("Failed to reactivate %s.", display_lvname(lv));
-		return 0;
+		r = 0;
 	}
 
-	return 1;
+	return r;
 }
 
 /*