From dcd8f3a3dd91d86c7cc446d2cab8030be5ff41da Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Mon, 20 Sep 2021 12:23:02 +0200 Subject: [PATCH] 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 279d9de5108f6fc6f2d31f77f1b41d6dc7a67cb9 for context, where the approach in this patch was suggested. Suggested-by: Thomas Lamprecht Signed-off-by: Fabian Ebner --- PVE/Storage/BTRFSPlugin.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVE/Storage/BTRFSPlugin.pm b/PVE/Storage/BTRFSPlugin.pm index dbc1244..b30000b 100644 --- a/PVE/Storage/BTRFSPlugin.pm +++ b/PVE/Storage/BTRFSPlugin.pm @@ -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); -- 2.39.5