Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Bart Van Assche and committed by
David Teigland
cfa805f6 696b3d84

+4 -4
+4 -4
fs/dlm/lock.c
··· 2038 2038 b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1]; 2039 2039 if (b == 1) { 2040 2040 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; 2043 2043 memcpy(lkb->lkb_lvbptr, ms->m_extra, len); 2044 2044 lkb->lkb_lvbseq = ms->m_lvbseq; 2045 2045 } ··· 3893 3893 if (!lkb->lkb_lvbptr) 3894 3894 return -ENOMEM; 3895 3895 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; 3898 3898 memcpy(lkb->lkb_lvbptr, ms->m_extra, len); 3899 3899 } 3900 3900 return 0;