btrfs: call free_image correctly

Currently, 'PVE::Storage::DirPlugin' is implicitly passed along as
$class, which means that if the base class's free_image calls another
method (e.g.  filesystem_path) then the DirPlugin's method will be
used, rather than the one from BTRFSPlugin. Change it so that $class
itself is passed along.

See also commit 279d9de510 for context,
where the approach in this patch was suggested.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fabian Ebner
2021-09-20 12:23:02 +02:00
committed by Thomas Lamprecht
parent e1667a2253
commit dcd8f3a3dd

View File

@ -410,7 +410,7 @@ sub free_image {
$class->parse_volname($volname);
if (!defined($format) || ($format ne 'subvol' && $format ne 'raw')) {
return PVE::Storage::DirPlugin->free_image($storeid, $scfg, $volname, $isBase, $_format);
return $class->SUPER::free_image($storeid, $scfg, $volname, $isBase, $_format);
}
my $path = $class->filesystem_path($scfg, $volname);