[Ocfs2-commits] mfasheh commits r1884 - trunk/fs/ocfs2/dlm
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Feb 2 16:45:59 CST 2005
Author: mfasheh
Date: 2005-02-02 16:45:57 -0600 (Wed, 02 Feb 2005)
New Revision: 1884
Modified:
trunk/fs/ocfs2/dlm/dlmlock.c
trunk/fs/ocfs2/dlm/dlmmod.c
trunk/fs/ocfs2/dlm/dlmunlock.c
Log:
* dlmunlock on a remote node wasn't propagating the lvb to the
master node.
* dlmunlock on a master node wasn't setting the GET flag so that it
could later know to grab the new lvb.
* dlmlock from the master or remote node wasn't getting the lvb on a
new lock.
Modified: trunk/fs/ocfs2/dlm/dlmlock.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmlock.c 2005-02-02 01:47:26 UTC (rev 1883)
+++ trunk/fs/ocfs2/dlm/dlmlock.c 2005-02-02 22:45:57 UTC (rev 1884)
@@ -170,6 +170,7 @@
if (status != DLM_NORMAL) {
/* remove from local queue if it failed */
list_del(&lock->list);
+ lock->lksb->flags &= ~DLM_LKSB_GET_LVB;
}
bail:
spin_unlock(&res->spinlock);
@@ -279,6 +280,9 @@
lksb->lockid = newlock;
lksb->flags |= DLM_LKSB_KERNEL_ALLOCATED;
+ if (create->flags | LKM_GET_LVB)
+ lksb->flags |= DLM_LKSB_GET_LVB;
+
status = DLM_IVLOCKID;
res = dlm_lookup_lock(dlm, &lockname);
if (!res)
Modified: trunk/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmod.c 2005-02-02 01:47:26 UTC (rev 1883)
+++ trunk/fs/ocfs2/dlm/dlmmod.c 2005-02-02 22:45:57 UTC (rev 1884)
@@ -269,16 +269,29 @@
lock->bast = bast;
lock->astdata = data;
lock->lksb = lksb;
-
+
dlm_get_next_cookie(lock->node, &lock->cookie);
-
+
+ if (flags & LKM_VALBLK) {
+ /* LVB requests for non PR, PW or EX locks are
+ * ignored. */
+ if (mode < LKM_PRMODE)
+ flags &= ~LKM_VALBLK;
+ else {
+ flags |= LKM_GET_LVB;
+ lock->lksb->flags |= DLM_LKSB_GET_LVB;
+ }
+ }
+
if (res->owner == dlm->group_index)
status = dlmlock_master(dlm, res, lock, flags);
else
status = dlmlock_remote(dlm, res, lock, flags);
- if (status != DLM_NORMAL)
+ if (status != DLM_NORMAL) {
+ lock->lksb->flags &= ~DLM_LKSB_GET_LVB;
goto up_error;
+ }
}
if (!recovery)
Modified: trunk/fs/ocfs2/dlm/dlmunlock.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmunlock.c 2005-02-02 01:47:26 UTC (rev 1883)
+++ trunk/fs/ocfs2/dlm/dlmunlock.c 2005-02-02 22:45:57 UTC (rev 1884)
@@ -86,7 +86,8 @@
dlm_status status;
int actions = 0;
- dlmprintk0("\n");
+ dlmprintk("master_node = %d, valblk = %d\n", master_node,
+ flags & LKM_VALBLK);
if (master_node)
DLM_ASSERT(res->owner == dlm->group_index);
@@ -118,20 +119,24 @@
* the convert, then call the unlock again with no LKM_CANCEL
*/
- if (flags & LKM_CANCEL) {
+ if (flags & LKM_CANCEL)
status = dlm_get_cancel_actions(dlm, res, lock, lksb, &actions);
- } else {
+ else
status = dlm_get_unlock_actions(dlm, res, lock, lksb, &actions);
- if (master_node && status == DLM_NORMAL) {
- /* make the final update to the lvb */
- if (lksb->flags & DLM_LKSB_PUT_LVB)
- memcpy(res->lvb, lksb->lvb, DLM_LVB_LEN);
- }
- }
if (status != DLM_NORMAL)
goto leave;
+ /* By now this has been masked out of cancel requests. */
+ if (flags & LKM_VALBLK) {
+ /* make the final update to the lvb */
+ if (master_node)
+ memcpy(res->lvb, lksb->lvb, DLM_LVB_LEN);
+ else
+ flags |= LKM_PUT_LVB; /* let the send function
+ * handle it. */
+ }
+
if (!master_node) {
/* drop locks and send message */
spin_unlock(&lock->spinlock);
More information about the Ocfs2-commits
mailing list