[pve-devel] [PATCH pve-storage] fix #3555: BTRFSPlugin: call free_image correctly

Wolfgang Bumiller w.bumiller at proxmox.com
Mon Aug 2 11:58:08 CEST 2021


On Mon, Aug 02, 2021 at 10:29:32AM +0200, Fabian Ebner wrote:
> Am 30.07.21 um 13:04 schrieb Hannes Laimer:
> > Signed-off-by: Hannes Laimer <h.laimer at 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 4596b30..411cab9 100644
> > --- a/PVE/Storage/BTRFSPlugin.pm
> > +++ b/PVE/Storage/BTRFSPlugin.pm
> > @@ -410,7 +410,7 @@ sub free_image {
> >   	$class->parse_volname($volname);
> >       if ($format ne 'subvol' && $format ne 'raw') {
> > -	return PVE::Storage::DirPlugin::free_image(@_);
> > +	return PVE::Storage::DirPlugin->free_image($storeid, $scfg, $volname, $isBase, $_format);
> 
> Sorry, I had missed this in our brief off-list discussion, but this actually
> behaves differently from the previously intended semantics:
> 
> When free_image (the one that's called here) calls a method, now the method
> from DirPlugin is used rather than the one from BTRFSPlugin. It /might/ be
> fine in this case, but not sure. To be on the safe (and future-proof) side,
> we should go with one of the alternatives Thomas suggested.

Yes, let's please change this.
Normally I'd lean towards the `SUPER` version, but since our plugin
structure is somewhat "weird" (basically half of `DirPlugin` is
implemented in `Plugin`, and the other plugins dance around it...
somewhat...), I'd almost prefer calling `Plugin` directly.





More information about the pve-devel mailing list