Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / fs / ocfs2 / dlm / dlmast.c
index 355593d..42775e2 100644 (file)
@@ -197,12 +197,14 @@ 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);
        }
 
@@ -381,8 +383,7 @@ do_ast:
        ret = DLM_NORMAL;
        if (past->type == DLM_AST) {
                /* do not alter lock refcount.  switching lists. */
-               list_del_init(&lock->list);
-               list_add_tail(&lock->list, &res->granted);
+               list_move_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) {