• Alex Elder's avatar
    libceph: only kunmap kmapped pages · 5ce765a5
    Alex Elder authored
    In write_partial_msg_pages(), pages need to be kmapped in order to
    perform a CRC-32c calculation on them.  As an artifact of the way
    this code used to be structured, the kunmap() call was separated
    from the kmap() call and both were done conditionally.  But the
    conditions under which the kmap() and kunmap() calls were made
    differed, so there was a chance a kunmap() call would be done on a
    page that had not been mapped.
    
    The symptom of this was tripping a BUG() in kunmap_high() when
    pkmap_count[nr] became 0.
    Reported-by: default avatarBryan K. Wright <bryan@virginia.edu>
    Signed-off-by: default avatarAlex Elder <elder@inktank.com>
    Reviewed-by: default avatarSage Weil <sage@inktank.com>
    5ce765a5
messenger.c 70.9 KB