Skip to contentSkip to conversation

master - cleanup: coverity quiet

PATCH Zdenek Kabelac 1 participant 1 message Nov 9, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b1dab26be0ee7eec11a6e91ab715808ddf016355
Commit:        b1dab26be0ee7eec11a6e91ab715808ddf016355
Parent:        11151121aa25c331cdb821281b0c4719bed040ea
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sun Nov 8 17:01:59 2015 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Nov 9 10:22:52 2015 +0100

cleanup: coverity quiet

While through all codepaths we never 'read' lock_id unless LCKF_CONVERT, coverity cannot decrypt this.

As since it's usually better to pass in 'well-defined' data structures preset lock_id to 0.

---
 daemons/clvmd/lvm-functions.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
daemons/clvmd/lvm-functions.c +1 -0
index 99e7317..ae9d22b 100644
@@ -291,6 +291,7 @@ static int hold_lock(char *resource, int mode, int flags)
 		}
 
 		lvi->lock_mode = mode;
+		lvi->lock_id = 0;
 		status = sync_lock(resource, mode, flags & ~LCKF_CONVERT, &lvi->lock_id);
 		saved_errno = errno;
 		if (status) {