clvmd-corosync should check lksb.sb_status instead of return code ?

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

 



Hi all,

  In clvmd-corosync, lock_resource calls dlm_ls_lock_wait with flags
set to LKF_NOQUEUE.
  When LKF_NOQUEUE is set, the return code of dlm_ls_lock_wait is
always 0, while the actual errno is in lksb.sb_status.

  This causes problem when using vgchange -aey or something like.

  I attached a patch to try to fix this issue.

  Please help to review. Thanks.
Index: LVM2-corosync-patch/daemons/clvmd/clvmd-corosync.c
===================================================================
--- LVM2-corosync-patch.orig/daemons/clvmd/clvmd-corosync.c	2009-02-11 18:13:20.000000000 +0800
+++ LVM2-corosync-patch/daemons/clvmd/clvmd-corosync.c	2009-02-25 18:34:49.000000000 +0800
@@ -478,6 +478,11 @@
 		DEBUGLOG("dlm_ls_lock returned %d\n", errno);
 		return err;
 	}
+	if (lksb.sb_status != 0)
+	{
+		DEBUGLOG("dlm_ls_lock returns lksb.sb_status %d\n", lksb.sb_status);
+		return -lksb.sb_status;
+	}
 
 	DEBUGLOG("lock_resource returning %d, lock_id=%x\n", err, lksb.sb_lkid);
 
@@ -504,6 +509,12 @@
 		DEBUGLOG("Unlock returned %d\n", err);
 		return err;
 	}
+	if (lksb.sb_status != 0)
+	{
+		DEBUGLOG("dlm_ls_unlock_wait returns lksb.sb_status: %d\n", lksb.sb_status);
+		return -lksb.sb_status;
+	}   
+
 
 	return 0;
 }
_______________________________________________
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