]> sourceware.org Git - lvm2.git/commitdiff
fix bad 'strcmp's in 'decode_lock_type' - missing !'s
authorJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 1 Feb 2011 17:31:40 +0000 (17:31 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 1 Feb 2011 17:31:40 +0000 (17:31 +0000)
There was no effect from having this wrong yet, because the
tree of callers only ever cared about the answer to the first
condition (!response), which determines whether a lock is
held or not.  Correct responses, however, are needed soon.

lib/locking/cluster_locking.c

index d8f7de272c9acec2c414f034aeba0f5b15bfdd47..83b1cd20de924356d4e5e2a20471d5e163ec1e31 100644 (file)
@@ -490,11 +490,11 @@ static int decode_lock_type(const char *response)
 {
        if (!response)
                return LCK_NULL;
-       else if (strcmp(response, "EX"))
+       else if (!strcmp(response, "EX"))
                return LCK_EXCL;
-       else if (strcmp(response, "CR"))
+       else if (!strcmp(response, "CR"))
                return LCK_READ;
-       else if (strcmp(response, "PR"))
+       else if (!strcmp(response, "PR"))
                return LCK_PREAD;
 
        stack;
@@ -532,8 +532,8 @@ int query_resource(const char *resource, int *mode)
 
                /*
                 * All nodes should use CR, or exactly one node
-                * should held EX. (PR is obsolete)
-                * If two nodes node reports different locks,
+                * should hold EX. (PR is obsolete)
+                * If two nodes report different locks,
                 * something is broken - just return more important mode.
                 */
                if (decode_lock_type(response[i].response) > *mode)
This page took 0.076527 seconds and 5 git commands to generate.