Revert to Fedora kernel-2.6.17-1.2187_FC5 patched with vs2.0.2.1; there are too many...
[linux-2.6.git] / fs / ocfs2 / dlm / dlmast.c
index 42775e2..355593d 100644 (file)
@@ -197,14 +197,12 @@ static void dlm_update_lvb(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
                                  lock->ml.node == dlm->node_num ? "master" :
                                  "remote");
                        memcpy(lksb->lvb, res->lvb, DLM_LVB_LEN);
+               } else if (lksb->flags & DLM_LKSB_PUT_LVB) {
+                       mlog(0, "setting lvb from lockres for %s node\n",
+                                 lock->ml.node == dlm->node_num ? "master" :
+                                 "remote");
+                       memcpy(res->lvb, lksb->lvb, DLM_LVB_LEN);
                }
-               /* Do nothing for lvb put requests - they should be done in
-                * place when the lock is downconverted - otherwise we risk
-                * racing gets and puts which could result in old lvb data
-                * being propagated. We leave the put flag set and clear it
-                * here. In the future we might want to clear it at the time
-                * the put is actually done.
-                */
                spin_unlock(&res->spinlock);
        }
 
@@ -383,7 +381,8 @@ do_ast:
        ret = DLM_NORMAL;
        if (past->type == DLM_AST) {
                /* do not alter lock refcount.  switching lists. */
-               list_move_tail(&lock->list, &res->granted);
+               list_del_init(&lock->list);
+               list_add_tail(&lock->list, &res->granted);
                mlog(0, "ast: adding to granted list... type=%d, "
                          "convert_type=%d\n", lock->ml.type, lock->ml.convert_type);
                if (lock->ml.convert_type != LKM_IVMODE) {