master - resume: secure critical section
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=8cf10948bd3acce7ae03f16982f0acbc4cde4fee Commit: 8cf10948bd3acce7ae03f16982f0acbc4cde4fee Parent: ae6beda12ddd203b806c565faabb5715379eaf85 Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Nov 24 13:53:02 2017 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Fri Nov 24 16:05:21 2017 +0100
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.
--- WHATS_NEW | 1 + lib/activate/activate.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletions(-)
WHATS_NEW +1 -0
@@ -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.
lib/activate/activate.c +7 -1
@@ -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 {