diff options
author | Anand Jain <anand.jain@oracle.com> | 2022-01-12 08:05:59 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-03-14 15:13:46 +0300 |
commit | 770c79fb65506fc7c16459855c3839429f46cb32 (patch) | |
tree | f306d74b6040d9db7bef92e1dacec6b15237b03f /fs/btrfs/backref.c | |
parent | bef16b52987b3cd18222109e2490b2f48018cd95 (diff) | |
download | linux-770c79fb65506fc7c16459855c3839429f46cb32.tar.xz |
btrfs: harden identification of a stale device
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: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.c')
0 files changed, 0 insertions, 0 deletions