]> sourceware.org Git - lvm2.git/commit
Fix memory lock imbalance in locking code.
authorMilan Broz <mbroz@redhat.com>
Mon, 23 Nov 2009 10:55:14 +0000 (10:55 +0000)
committerMilan Broz <mbroz@redhat.com>
Mon, 23 Nov 2009 10:55:14 +0000 (10:55 +0000)
commita1cefb3e17a625f78bdfc3f7ad7cff494f6273e9
tree6898a6d4c6f7a6fbff6a07ac14b383f92b8be95d
parentdef0f38f3df75e7b4eb9e3aeb37ad6eb6495beba
Fix memory lock imbalance in locking code.

(This affects only cluster locking because only cluster
locking module set LCK_PRE_MEMLOCK.)

With currect code you get
# vgchange -a n
  Internal error: _memlock_count has dropped below 0.
when using cluster locking.

It is caused by _unlock_memory calls here

  if ((flags & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) == LCK_LV_RESUME)
     memlock_dec();

Unfortunately it is also (wrongly) called in immediate unlock
(when LCK_HOLD is not set) from lock_vol
(LCK_UNLOCK is misinterpreted as LCK_LV_RESUME).

Avoid this by comparing original flags and provide memlock
code type of operation (suspend/resume).
WHATS_NEW
lib/locking/locking.c
This page took 0.036825 seconds and 5 git commands to generate.