diff options
author | Bart Van Assche <bvanassche@acm.org> | 2013-06-26 08:27:57 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2013-06-26 12:38:02 -0400 |
commit | cfa805f6f19639b37ee877085770a396b70f2da1 (patch) | |
tree | a5423733b78ecbb682a3e0b33750348110093d5f /fs/dlm | |
parent | 696b3d84605e5546cbddefdc95b9099f908fd56e (diff) |
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>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/lock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 1b1146670c4b..e223a911a834 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c | |||
@@ -2038,8 +2038,8 @@ static void set_lvb_lock_pc(struct dlm_rsb *r, struct dlm_lkb *lkb, | |||
2038 | b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1]; | 2038 | b = dlm_lvb_operations[lkb->lkb_grmode + 1][lkb->lkb_rqmode + 1]; |
2039 | if (b == 1) { | 2039 | if (b == 1) { |
2040 | int len = receive_extralen(ms); | 2040 | int len = receive_extralen(ms); |
2041 | if (len > DLM_RESNAME_MAXLEN) | 2041 | if (len > r->res_ls->ls_lvblen) |
2042 | len = DLM_RESNAME_MAXLEN; | 2042 | len = r->res_ls->ls_lvblen; |
2043 | memcpy(lkb->lkb_lvbptr, ms->m_extra, len); | 2043 | memcpy(lkb->lkb_lvbptr, ms->m_extra, len); |
2044 | lkb->lkb_lvbseq = ms->m_lvbseq; | 2044 | lkb->lkb_lvbseq = ms->m_lvbseq; |
2045 | } | 2045 | } |
@@ -3893,8 +3893,8 @@ static int receive_lvb(struct dlm_ls *ls, struct dlm_lkb *lkb, | |||
3893 | if (!lkb->lkb_lvbptr) | 3893 | if (!lkb->lkb_lvbptr) |
3894 | return -ENOMEM; | 3894 | return -ENOMEM; |
3895 | len = receive_extralen(ms); | 3895 | len = receive_extralen(ms); |
3896 | if (len > DLM_RESNAME_MAXLEN) | 3896 | if (len > ls->ls_lvblen) |
3897 | len = DLM_RESNAME_MAXLEN; | 3897 | len = ls->ls_lvblen; |
3898 | memcpy(lkb->lkb_lvbptr, ms->m_extra, len); | 3898 | memcpy(lkb->lkb_lvbptr, ms->m_extra, len); |
3899 | } | 3899 | } |
3900 | return 0; | 3900 | return 0; |