diff options
-rw-r--r-- | fs/dlm/lock.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 6c605fc10613..0593dd81d46d 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c | |||
@@ -4271,7 +4271,6 @@ static int receive_rcom_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb, | |||
4271 | struct dlm_rsb *r, struct dlm_rcom *rc) | 4271 | struct dlm_rsb *r, struct dlm_rcom *rc) |
4272 | { | 4272 | { |
4273 | struct rcom_lock *rl = (struct rcom_lock *) rc->rc_buf; | 4273 | struct rcom_lock *rl = (struct rcom_lock *) rc->rc_buf; |
4274 | int lvblen; | ||
4275 | 4274 | ||
4276 | lkb->lkb_nodeid = rc->rc_header.h_nodeid; | 4275 | lkb->lkb_nodeid = rc->rc_header.h_nodeid; |
4277 | lkb->lkb_ownpid = le32_to_cpu(rl->rl_ownpid); | 4276 | lkb->lkb_ownpid = le32_to_cpu(rl->rl_ownpid); |
@@ -4288,11 +4287,13 @@ static int receive_rcom_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb, | |||
4288 | lkb->lkb_astaddr = (void *) (long) (rl->rl_asts & AST_COMP); | 4287 | lkb->lkb_astaddr = (void *) (long) (rl->rl_asts & AST_COMP); |
4289 | 4288 | ||
4290 | if (lkb->lkb_exflags & DLM_LKF_VALBLK) { | 4289 | if (lkb->lkb_exflags & DLM_LKF_VALBLK) { |
4290 | int lvblen = rc->rc_header.h_length - sizeof(struct dlm_rcom) - | ||
4291 | sizeof(struct rcom_lock); | ||
4292 | if (lvblen > ls->ls_lvblen) | ||
4293 | return -EINVAL; | ||
4291 | lkb->lkb_lvbptr = dlm_allocate_lvb(ls); | 4294 | lkb->lkb_lvbptr = dlm_allocate_lvb(ls); |
4292 | if (!lkb->lkb_lvbptr) | 4295 | if (!lkb->lkb_lvbptr) |
4293 | return -ENOMEM; | 4296 | return -ENOMEM; |
4294 | lvblen = rc->rc_header.h_length - sizeof(struct dlm_rcom) - | ||
4295 | sizeof(struct rcom_lock); | ||
4296 | memcpy(lkb->lkb_lvbptr, rl->rl_lvb, lvblen); | 4297 | memcpy(lkb->lkb_lvbptr, rl->rl_lvb, lvblen); |
4297 | } | 4298 | } |
4298 | 4299 | ||