• Brian Foster's avatar
    bcachefs: fix NULL bch_dev deref when checking bucket_gens keys · 251babb5
    Brian Foster authored
    fsck removes bucket_gens keys for devices that do not exist in the
    volume (i.e., if the device was removed). In 'fsck -n' mode, the
    associated fsck_err_on() wrapper returns false to skip the key
    removal. This proceeds on to the rest of the function, which
    eventually segfaults on a NULL bch_dev because the device does not
    exist.
    
    Update bch2_check_bucket_gens_key() to skip out of the rest of the
    function when the associated device does not exist, regardless of
    running fsck in check or repair mode.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    251babb5
alloc_background.c 54.1 KB