[PATCH] Re: [linux-lvm] Clarifications wanted about locking process
Alasdair G Kergon
agk at redhat.com
Fri Aug 14 17:12:34 UTC 2009
On Fri, Aug 14, 2009 at 01:49:13PM +0200, Peter Rockai wrote:
> The attached patch should fix the issue. I believe that taking a global write
> lock while scanning is a mistake (I consulted with Milan, he says it only
> serves to enable metadata caching).
Well only one instance of pvscan and/or vgscan is allowed to run at once,
and IIRC VG_GLOBAL with LCK_VG_WRITE is what enforces that.
IOW The write lock is correct.
See the comment in toollib:
* If the lock_type is LCK_VG_READ (used only in reporting commands),
* we lock VG_GLOBAL to enable use of metadata cache.
* This can pause alongide pvscan or vgscan process for a while.
I don't want to touch the VG_GLOBAL logic here at this stage.
Are there any problems with just excluding an already-held VG_GLOBAL from the
test that generates this error message?
More information about the linux-lvm