1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

activation: interruptible sleep when talking to dmeventd

This commit is contained in:
Zdenek Kabelac 2024-04-30 20:21:05 +02:00
parent c35385a1cd
commit 9162ae0a0a

View File

@ -1813,6 +1813,9 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
if (monitor && !dmeventd_monitor_mode()) if (monitor && !dmeventd_monitor_mode())
return 1; return 1;
if (sigint_caught())
return_0;
/* /*
* Activation of unused cache-pool activates metadata device as * Activation of unused cache-pool activates metadata device as
* a public LV for clearing purpose. * a public LV for clearing purpose.
@ -1894,6 +1897,12 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
} }
dm_list_iterate_items(seg, &lv->segments) { dm_list_iterate_items(seg, &lv->segments) {
if (sigint_caught()) {
stack;
r = 0;
break;
}
/* Recurse for AREA_LV */ /* Recurse for AREA_LV */
for (s = 0; s < seg->area_count; s++) { for (s = 0; s < seg->area_count; s++) {
if (seg_type(seg, s) != AREA_LV) if (seg_type(seg, s) != AREA_LV)
@ -2025,7 +2034,11 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
break; break;
log_very_verbose("%s %smonitoring still pending: waiting...", log_very_verbose("%s %smonitoring still pending: waiting...",
display_lvname(lv), monitor ? "" : "un"); display_lvname(lv), monitor ? "" : "un");
usleep(10000 * i); if (interruptible_usleep(10000 * i)) {
stack;
r = 0;
break;
}
} }
if (r) if (r)