* [pve-devel] [PATCH storage] btrfs: call free_image correctly
@ 2021-09-20 10:23 Fabian Ebner
2021-09-22 6:52 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2021-09-20 10:23 UTC (permalink / raw)
To: pve-devel
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 <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
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.30.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH storage] btrfs: call free_image correctly
2021-09-20 10:23 [pve-devel] [PATCH storage] btrfs: call free_image correctly Fabian Ebner
@ 2021-09-22 6:52 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2021-09-22 6:52 UTC (permalink / raw)
To: Proxmox VE development discussion, Fabian Ebner
On 20.09.21 12:23, Fabian Ebner wrote:
> 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 <t.lamprecht@proxmox.com>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
> PVE/Storage/BTRFSPlugin.pm | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-22 6:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 10:23 [pve-devel] [PATCH storage] btrfs: call free_image correctly Fabian Ebner
2021-09-22 6:52 ` [pve-devel] applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal