• Kent Overstreet's avatar
    bcachefs: bch2_checksum() returns 0 for unknown checksum type · 6b74fdcc
    Kent Overstreet authored
    This fixes missing guards on trying to calculate a checksum with an
    invalid/unknown checksum type; moving the guards up to e.g. btree_io.c
    might be "more correct", but doesn't buy us anything - an unknown
    checksum type will always be flagged as at least a checksum error so we
    aren't losing any safety doing it this way and it makes it less likely
    to accidentally pop an assert we don't want.
    
    Reported-by: syzbot+e951ad5349f3a34a715a@syzkaller.appspotmail.com
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    6b74fdcc
checksum.c 18.6 KB