• Alexander Aring's avatar
    fs: dlm: stop unnecessarily filling zero ms_extra bytes · 7a40f1f1
    Alexander Aring authored
    Commit 7175e131 ("fs: dlm: fix invalid derefence of sb_lvbptr")
    fixes an issue when the lkb->lkb_lvbptr set to an dangled pointer and an
    followed memcpy() would fail. It was fixed by an additional check of
    DLM_LKF_VALBLK flag. The mentioned commit forgot to add an additional check
    if DLM_LKF_VALBLK is set for the additional amount of LVB data allocated
    in a dlm message. This patch is changing the message allocation to check
    additionally if DLM_LKF_VALBLK is set otherwise a dangled lkb->lkb_lvbptr
    pointer would allocated zero LVB message data which not gets filled with
    actual data.
    
    This patch is however only a cleanup to reduce the amount of zero bytes
    transmitted over network as receive_lvb() will only evaluates message LVB
    data if DLM_LKF_VALBLK is set.
    Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
    Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
    7a40f1f1
lock.c 156 KB