mirror of
git://sourceware.org/git/lvm2.git
synced 2024-10-28 03:27:58 +03:00
fix bad 'strcmp's in 'decode_lock_type' - missing !'s
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.
This commit is contained in:
parent
d6833cc7fa
commit
e7cb9788c4
@ -490,11 +490,11 @@ static int decode_lock_type(const char *response)
|
|||||||
{
|
{
|
||||||
if (!response)
|
if (!response)
|
||||||
return LCK_NULL;
|
return LCK_NULL;
|
||||||
else if (strcmp(response, "EX"))
|
else if (!strcmp(response, "EX"))
|
||||||
return LCK_EXCL;
|
return LCK_EXCL;
|
||||||
else if (strcmp(response, "CR"))
|
else if (!strcmp(response, "CR"))
|
||||||
return LCK_READ;
|
return LCK_READ;
|
||||||
else if (strcmp(response, "PR"))
|
else if (!strcmp(response, "PR"))
|
||||||
return LCK_PREAD;
|
return LCK_PREAD;
|
||||||
|
|
||||||
stack;
|
stack;
|
||||||
@ -532,8 +532,8 @@ int query_resource(const char *resource, int *mode)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* All nodes should use CR, or exactly one node
|
* All nodes should use CR, or exactly one node
|
||||||
* should held EX. (PR is obsolete)
|
* should hold EX. (PR is obsolete)
|
||||||
* If two nodes node reports different locks,
|
* If two nodes report different locks,
|
||||||
* something is broken - just return more important mode.
|
* something is broken - just return more important mode.
|
||||||
*/
|
*/
|
||||||
if (decode_lock_type(response[i].response) > *mode)
|
if (decode_lock_type(response[i].response) > *mode)
|
||||||
|
Loading…
Reference in New Issue
Block a user