]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/dlm/lock.c
[DLM] fix send_args() lvb copying
[linux-2.6-omap-h63xx.git] / fs / dlm / lock.c
index 69ada5887078f79bbc19807c8f1726fe9d45cb28..cdf2cb9297fd74ad4dc41cb81d451090f1844f33 100644 (file)
@@ -2144,12 +2144,24 @@ static void send_args(struct dlm_rsb *r, struct dlm_lkb *lkb,
        if (lkb->lkb_astaddr)
                ms->m_asts |= AST_COMP;
 
-       if (ms->m_type == DLM_MSG_REQUEST || ms->m_type == DLM_MSG_LOOKUP)
-               memcpy(ms->m_extra, r->res_name, r->res_length);
+       /* compare with switch in create_message; send_remove() doesn't
+          use send_args() */
 
-       else if (lkb->lkb_lvbptr)
+       switch (ms->m_type) {
+       case DLM_MSG_REQUEST:
+       case DLM_MSG_LOOKUP:
+               memcpy(ms->m_extra, r->res_name, r->res_length);
+               break;
+       case DLM_MSG_CONVERT:
+       case DLM_MSG_UNLOCK:
+       case DLM_MSG_REQUEST_REPLY:
+       case DLM_MSG_CONVERT_REPLY:
+       case DLM_MSG_GRANT:
+               if (!lkb->lkb_lvbptr)
+                       break;
                memcpy(ms->m_extra, lkb->lkb_lvbptr, r->res_ls->ls_lvblen);
-
+               break;
+       }
 }
 
 static int send_common(struct dlm_rsb *r, struct dlm_lkb *lkb, int mstype)