• Kent Overstreet's avatar
    bcachefs: Fix shift by 64 in set_inc_field() · 77212d3a
    Kent Overstreet authored
    UBSAN was complaining about a shift by 64 in set_inc_field().
    
    This only happened when the value being shifted was 0, so in theory
    should be harmless - a shift by 64 (or register width) should logically
    give a result of 0, but CPUs will in practice leave the input unchanged
    when the number of bits to shift by wraps - and since our input here is
    0, the output is still what we want.
    
    But, it's still undefined behaviour and we need our UBSAN output to be
    clean, so it needs to be fixed.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    77212d3a
bkey.c 24.6 KB