Skip to content

Commit cfa805f

Browse files
bvanasscheteigland
authored andcommitted
dlm: Avoid LVB truncation
For lockspaces with an LVB length above 64 bytes, avoid truncating the LVB while exchanging it with another node in the cluster. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent 696b3d8 commit cfa805f

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/dlm/lock.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,8 +2038,8 @@ static void set_lvb_lock_pc(struct dlm_rsb *r, struct dlm_lkb *lkb,
20382038
b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1];
20392039
if (b == 1) {
20402040
int len = receive_extralen(ms);
2041-
if (len > DLM_RESNAME_MAXLEN)
2042-
len = DLM_RESNAME_MAXLEN;
2041+
if (len > r->res_ls->ls_lvblen)
2042+
len = r->res_ls->ls_lvblen;
20432043
memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
20442044
lkb->lkb_lvbseq = ms->m_lvbseq;
20452045
}
@@ -3893,8 +3893,8 @@ static int receive_lvb(struct dlm_ls *ls, struct dlm_lkb *lkb,
38933893
if (!lkb->lkb_lvbptr)
38943894
return -ENOMEM;
38953895
len = receive_extralen(ms);
3896-
if (len > DLM_RESNAME_MAXLEN)
3897-
len = DLM_RESNAME_MAXLEN;
3896+
if (len > ls->ls_lvblen)
3897+
len = ls->ls_lvblen;
38983898
memcpy(lkb->lkb_lvbptr, ms->m_extra, len);
38993899
}
39003900
return 0;

0 commit comments

Comments
 (0)