diff options
author | Petr Rockai <prockai@redhat.com> | 2011-11-07 17:11:23 +0000 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2011-11-07 17:11:23 +0000 |
commit | 44190723a8d64a8a020aca7fc883926360a482e4 (patch) | |
tree | ccbbb3b071cba8120ad18b675d34e0f26ddb6b36 /daemons/clvmd | |
parent | bac10d6aa3d54d94ed23f063dddebfb6725bf032 (diff) | |
download | lvm2-44190723a8d64a8a020aca7fc883926360a482e4.tar.gz lvm2-44190723a8d64a8a020aca7fc883926360a482e4.tar.xz lvm2-44190723a8d64a8a020aca7fc883926360a482e4.zip |
Correctly handle concurrent read (CR) locks in singlenode clvmd. This means
that we can also test clustered volume groups (vgcreate -c y) in the test
suite. Unfortunately we can't make this the testing default since cluster
mirrors require further infrastructure, and snapshots probably don't work at
all. I'll eventually add a few test cases that create clustered VGs
specifically.
Diffstat (limited to 'daemons/clvmd')
-rw-r--r-- | daemons/clvmd/clvmd-singlenode.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/daemons/clvmd/clvmd-singlenode.c b/daemons/clvmd/clvmd-singlenode.c index 8e845537..e75de98e 100644 --- a/daemons/clvmd/clvmd-singlenode.c +++ b/daemons/clvmd/clvmd-singlenode.c @@ -157,6 +157,13 @@ static int _lock_resource(const char *resource, int mode, int flags, int *lockid char **_resources_1; int i, j; + if (mode == LCK_READ) { /* only track PREAD, aka PROTECTED READ */ + DEBUGLOG("Not tracking CONCURRENT READ lock: %s, flags=%d, mode=%d\n", + resource, flags, mode); + *lockid = -1; + return 0; + } + DEBUGLOG("Locking resource %s, flags=%d, mode=%d\n", resource, flags, mode); @@ -224,6 +231,12 @@ bad: static int _unlock_resource(const char *resource, int lockid) { + if (lockid < 0) { + DEBUGLOG("Not tracking unlock of lockid -1: %s, lockid=%d\n", + resource, lockid); + return 0; + } + DEBUGLOG("Unlocking resource %s, lockid=%d\n", resource, lockid); pthread_mutex_lock(&_lock_mutex); |