Skip to contentSkip to conversation

lvchange: fix lvchange refresh failed for dm suspend or resume failed

PATCH New Yi Wang 1 participant 1 message Aug 13, 2021

lore
Share & tools
lore

Yi Wang

author
#0 lore raw

PATCH 1/1 lvchange: fix lvchange refresh failed for dm suspend or resume failed

When multiple lvchange refresh processes executed at the same time, suspend/resume ioctl on the same dm, some of these commands will be failed for dm aready change status, and ioctl will return EINVAL in _do_dm_ioctl function. to avoid this problem, add READ_FOR_ACTIVATE flags in lvchange refresh process, it will hold LCK_WRITE lock and avoid suspend/resume dm at the same time.

---
 tools/lvchange.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lvchange.c +1 -1
index d4c40df47..0525bc53c 100644
@@ -1622,7 +1622,7 @@ int lvchange_refresh_cmd(struct cmd_context *cmd, int argc, char **argv)
 	cmd->lockd_vg_default_sh = 1;
 	cmd->ignore_device_name_mismatch = 1;
 
-	return process_each_lv(cmd, argc, argv, NULL, NULL, 0,
+	return process_each_lv(cmd, argc, argv, NULL, NULL, READ_FOR_ACTIVATE,
 			       NULL, &_lvchange_refresh_check, &_lvchange_refresh_single);
 }
 
Signature · 1 line
2.18.1