• Anand Jain's avatar
    btrfs: harden identification of a stale device · 770c79fb
    Anand Jain authored
    Identifying and removing the stale device from the fs_uuids list is done
    by btrfs_free_stale_devices().  btrfs_free_stale_devices() in turn
    depends on device_path_matched() to check if the device appears in more
    than one btrfs_device structure.
    
    The matching of the device happens by its path, the device path. However,
    when device mapper is in use, the dm device paths are nothing but a link
    to the actual block device, which leads to the device_path_matched()
    failing to match.
    
    Fix this by matching the dev_t as provided by lookup_bdev() instead of
    plain string compare of the device paths.
    Reported-by: default avatarJosef Bacik <josef@toxicpanda.com>
    Signed-off-by: default avatarAnand Jain <anand.jain@oracle.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    770c79fb
volumes.c 225 KB