[PATCH] Re: Clarifications wanted about locking process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alasdair G Kergon <agk@redhat.com> writes:
> On Thu, Aug 13, 2009 at 08:13:39PM -0400, Eric Bélanger wrote:
>> Since I updated from lvm2 2.02.48 to 2.02.51, I'm getting this message
>> on boot-up:
>> Write locks are prohibited with --ignorelockingfailure.
>> Unable to obtain global lock.
>  
> Sounds like a bug.
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).

Yours,
   Petr.

diff -rN -u -p old-upstream/tools/pvscan.c new-upstream/tools/pvscan.c
--- old-upstream/tools/pvscan.c	2009-08-14 13:44:39.000000000 +0200
+++ new-upstream/tools/pvscan.c	2009-08-14 13:44:40.000000000 +0200
@@ -124,7 +124,7 @@ int pvscan(struct cmd_context *cmd, int 
 			  arg_count(cmd, exported_ARG) ?
 			  "of exported volume group(s)" : "in no volume group");
 
-	if (!lock_vol(cmd, VG_GLOBAL, LCK_VG_WRITE)) {
+	if (!lock_vol(cmd, VG_GLOBAL, LCK_VG_READ)) {
 		log_error("Unable to obtain global lock.");
 		return ECMD_FAILED;
 	}
diff -rN -u -p old-upstream/tools/vgscan.c new-upstream/tools/vgscan.c
--- old-upstream/tools/vgscan.c	2009-08-14 13:44:39.000000000 +0200
+++ new-upstream/tools/vgscan.c	2009-08-14 13:44:40.000000000 +0200
@@ -40,7 +40,7 @@ int vgscan(struct cmd_context *cmd, int 
 		return EINVALID_CMD_LINE;
 	}
 
-	if (!lock_vol(cmd, VG_GLOBAL, LCK_VG_WRITE)) {
+	if (!lock_vol(cmd, VG_GLOBAL, LCK_VG_READ)) {
 		log_error("Unable to obtain global lock.");
 		return ECMD_FAILED;
 	}
_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux