master - activation: fix locking resource name for activation lock
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9bd7615fef1e4526bcc2c9fea67d2d038db6d917 Commit: 9bd7615fef1e4526bcc2c9fea67d2d038db6d917 Parent: e61313843f835284303141bd514fcbcb08fb2463 Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 9 15:36:41 2017 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Oct 11 14:24:28 2017 +0200
activation: fix locking resource name for activation lock
Avoid cutting away 1st. character for activation lock. Unlike with VG name locks like #orphan we should not cut-off 1st. characted from resource name.
--- WHATS_NEW | 1 + lib/locking/file_locking.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.176 - =================================== + Avoid cutting 1st. character of resource name for activation lock. Support for encrypted devices in fsadm. Improve thin pool overprovisioning and repair warning messages.
lib/locking/file_locking.c +2 -2
@@ -51,8 +51,8 @@ static int _file_lock_resource(struct cmd_context *cmd, const char *resource,switch (flags &LCK_SCOPE_MASK ) {case LCK_ACTIVATION :if (dm_snprintf (lockfile,sizeof (lockfile), -"%s/A_%s" , _lock_dir, resource +1 ) <0 ) { -log_error ("Too long locking filename %s/A_%s." , _lock_dir, resource +1 ); +"%s/A_%s" , _lock_dir, resource) <0 ) { +log_error ("Too long locking filename %s/A_%s." , _lock_dir, resource);return 0 ; }