diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2020-09-13 21:10:17 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2020-09-14 00:15:14 +0200 |
commit | 2101e324f947d1d9d7c4e19996a18b1c88d82742 (patch) | |
tree | c7ce87ab71ddb717d4b4dbdd56390da9f2bdf742 | |
parent | fe77d1a71043ca449dbe3a2a635ba0096e4ef9b9 (diff) | |
download | lvm2-2101e324f947d1d9d7c4e19996a18b1c88d82742.tar.gz |
locking: restore blocking signal for VG_GLOBAL lck
During removal of a lot of locking code the signal blocking got lost
and signal processing got broken leading to unpredictable
behavior of i.e. activation code the can get interrupted in the
middle of DM table processing.
lvm2 code always expects signals are blocked while lock is held
unless it is explictelly placed into section of:
sigint_allow();....;sigint_restore();
For checking catched interrupt there is sigint_catched();
-rw-r--r-- | WHATS_NEW | 1 | ||||
-rw-r--r-- | lib/locking/locking.c | 8 |
2 files changed, 6 insertions, 3 deletions
@@ -1,5 +1,6 @@ Version 2.03.11 - ================================== + Restore lost signal blocking while VG lock is held. Improve estimation of needed extents when creating thin-pool. Use extra 1% when resizing thin-pool metadata LV with --use-policy. Enhance --use-policy percentage rounding. diff --git a/lib/locking/locking.c b/lib/locking/locking.c index 65ff8c221..c69f08c09 100644 --- a/lib/locking/locking.c +++ b/lib/locking/locking.c @@ -183,7 +183,11 @@ static int _lock_vol(struct cmd_context *cmd, const char *resource, uint32_t fla block_signals(flags); - ret = _locking.lock_resource(cmd, resource, flags, NULL); + if ((ret = _locking.lock_resource(cmd, resource, flags, NULL))) + /* ensure signals are blocked while VG_GLOBAL lock is held */ + _update_vg_lock_count(resource, flags); + else + stack; _unblock_signals(); @@ -287,8 +291,6 @@ out_hold: else if (lck_type == LCK_UNLOCK) lvmcache_unlock_vgname(resource); - /* FIXME: we shouldn't need to keep track of this either. */ - _update_vg_lock_count(resource, flags); return 1; out_fail: |