]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ocfs2/dlm/dlmast.c
Pull error-inject into release branch
[linux-2.6-omap-h63xx.git] / fs / ocfs2 / dlm / dlmast.c
index 87ee29cad50b3426a4c8956a318f1d9f6cbfb4cd..241cad342a48f0f8849cca96e1ddf5f2f6aee79e 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);
        }
 
@@ -261,7 +263,8 @@ void dlm_do_local_bast(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
 
 
 
-int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
+int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data,
+                         void **ret_data)
 {
        int ret;
        unsigned int locklen;
@@ -309,8 +312,8 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
            past->type != DLM_BAST) {
                mlog(ML_ERROR, "Unknown ast type! %d, cookie=%u:%llu"
                     "name=%.*s\n", past->type, 
-                    dlm_get_lock_cookie_node(cookie),
-                    dlm_get_lock_cookie_seq(cookie),
+                    dlm_get_lock_cookie_node(be64_to_cpu(cookie)),
+                    dlm_get_lock_cookie_seq(be64_to_cpu(cookie)),
                     locklen, name);
                ret = DLM_IVLOCKID;
                goto leave;
@@ -318,11 +321,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
 
        res = dlm_lookup_lockres(dlm, name, locklen);
        if (!res) {
-               mlog(ML_ERROR, "got %sast for unknown lockres! "
-                              "cookie=%u:%llu, name=%.*s, namelen=%u\n",
+               mlog(0, "got %sast for unknown lockres! "
+                    "cookie=%u:%llu, name=%.*s, namelen=%u\n",
                     past->type == DLM_AST ? "" : "b",
-                    dlm_get_lock_cookie_node(cookie),
-                    dlm_get_lock_cookie_seq(cookie),
+                    dlm_get_lock_cookie_node(be64_to_cpu(cookie)),
+                    dlm_get_lock_cookie_seq(be64_to_cpu(cookie)),
                     locklen, name, locklen);
                ret = DLM_IVLOCKID;
                goto leave;
@@ -365,12 +368,11 @@ int dlm_proxy_ast_handler(struct o2net_msg *msg, u32 len, void *data)
                        goto do_ast;
        }
 
-       mlog(ML_ERROR, "got %sast for unknown lock!  cookie=%u:%llu, "
-                      "name=%.*s, namelen=%u\n", 
-                      past->type == DLM_AST ? "" : "b", 
-                      dlm_get_lock_cookie_node(cookie),
-                      dlm_get_lock_cookie_seq(cookie),
-                      locklen, name, locklen);
+       mlog(0, "got %sast for unknown lock!  cookie=%u:%llu, "
+            "name=%.*s, namelen=%u\n", past->type == DLM_AST ? "" : "b", 
+            dlm_get_lock_cookie_node(be64_to_cpu(cookie)),
+            dlm_get_lock_cookie_seq(be64_to_cpu(cookie)),
+            locklen, name, locklen);
 
        ret = DLM_NORMAL;
 unlock_out:
@@ -462,7 +464,7 @@ int dlm_send_proxy_ast_msg(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
                        mlog(ML_ERROR, "sent AST to node %u, it returned "
                             "DLM_MIGRATING!\n", lock->ml.node);
                        BUG();
-               } else if (status != DLM_NORMAL) {
+               } else if (status != DLM_NORMAL && status != DLM_IVLOCKID) {
                        mlog(ML_ERROR, "AST to node %u returned %d!\n",
                             lock->ml.node, status);
                        /* ignore it */