feat: add btrfs-progs v5.10.1 bug workaround

This commit is contained in:
Stéphane Lesimple 2024-04-16 09:58:59 +02:00
parent d2a9bb2548
commit befde74faa

View File

@ -140,6 +140,8 @@ GetOptions(
'd|deleted' => \my $opt_deleted,
) or die "FATAL: Error parsing arguments, aborting\n";
$opt_quiet ||= 0;
sub debug {
return if !$opt_debug;
print STDERR $_ . "\n" for @_;
@ -557,6 +559,11 @@ foreach (@fishow) {
if (not exists $filesystems{$fuuid}) {
$filesystems{$fuuid} = {uuid => $fuuid, label => $label, devices => [], devinfo => {}};
}
# btrfs-progs v5.10.1 bug workaround: "dm-X" instead of "/dev/dm-X"
if ($dev && $dev =~ m{^dm-}) {
debug("Applying workaround $dev => /dev/$dev");
$dev = "/dev/$dev";
}
if (-l $dev) {
$dev = link2real($dev);
}