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

resume: secure critical section

Only  thin-pool with origin_only suspend is allowed to be not suspending anything.
In such case pairing resume will 'decrement' critical section counter.
This commit is contained in:
Zdenek Kabelac 2017-11-24 13:53:02 +01:00
parent ae6beda12d
commit 8cf10948bd
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
Do not change critical section counter on resume path without real resume.
Enhance activation code to automatically suspend pvmove participants.
Remove unnecessary single read from lvmdiskscan.
Avoid using precommitted metadata for suspending pvmove tree.

View File

@ -2353,11 +2353,17 @@ static int _lv_resume(struct cmd_context *cmd, const char *lvid_s,
if (error_if_not_active)
goto_out;
/* ATM only thin-pool with origin-only suspend does not really suspend anything
* it's used only for message passing to thin-pool */
if (laopts->origin_only && lv_is_thin_pool(lv))
critical_section_dec(cmd, "resumed");
if (!info.suspended && critical_section()) {
/* check if any subLV is suspended */
if ((r = for_each_sub_lv((struct logical_volume *)lv, &_check_suspended_lv, NULL))) {
/* Everything seems resumed */
critical_section_dec(cmd, "already resumed");
log_debug_activation("LV %s not suspended.", display_lvname(lv));
goto out;
}
} else {