public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Dominik Csapak <d.csapak@proxmox.com>,
	Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [pve-devel] [PATCH storage] BTRFSPlugin: reuse DirPlugin update/get_volume_attribute
Date: Wed, 25 May 2022 12:48:39 +0200 (CEST)	[thread overview]
Message-ID: <513329947.1015.1653475719893@webmail.proxmox.com> (raw)

> On 05/02/2022 9:20 AM Dominik Csapak <d.csapak@proxmox.com> wrote:
> 
>  
> On 5/2/22 09:04, Thomas Lamprecht wrote:
> > Am 5/2/22 um 08:48 schrieb Dominik Csapak:
> >> On 5/2/22 08:36, Thomas Lamprecht wrote:
> >>> Am 4/29/22 um 12:00 schrieb Dominik Csapak:
(...)
> >> not sure if thats a good idea though
> >>
> >> we could also factor out the get/update_volume_notes impl in DirPlugin
> >> and call it from both paths? then we'd not have to implement
> >> the _notes subs here
> >>
> >>>
> >>>>    -# TODO: sub update_volume_attribute {}
> >>>> +sub get_volume_attribute {
> >>>> +    return PVE::Storage::DirPlugin::get_volume_attribute(@_);
> >>>> +}
> >>>> +
> >>>> +sub update_volume_attribute {
> >>>> +    return PVE::Storage::DirPlugin::update_volume_attribute(@_);
> >>>> +}
> >>>
> >>> This is so trivial that I'm wondering if Wolfgang had a reason to not do it for the
> >>> original get_volume_notes that was there long before the BTRFS plugin got added..

Not that I remember. Most likely the reason was that initially I was playing with
different ways to place raw images (subvolume with a raw file with btrfs snapshots vs.
just the raw file with COW-copying for snapshots), where for some variants a different
file layout *could* be nice. But only in theory.

> >> i mean it's possible, but idk how else you'd implement it? notes & protected
> >> are only files where we read/write the content or test the existance?
> >>
> >> we could probably do something btrfs specific, but is it worth that?

Probably not. There isn't all that much available.

Given that path based storages apparently already expect this to work in a specific way
in some of the other storage functions outside the plugin (see Dominik's note about
`get_subdir_files`) I think this patch makes sense.

> > as hinted, Wolfgang will be the one to answer the reason, even if it was just "forgot".
> > And yeah, it's IMO worth it to actually understand first why some seemingly trivial feature
> > was skipped before just doing something "blindly", seemingly obvious or not.
> 
> makes sense, i just noticed because on content listing, the notes will already show up if
> set this way because in the 'get_subdir_files' of Storage.pm we directly read the
> notes file if it exists

^ So if we wanted to do anything else we'd probably need to override even more of
`Plugin` (iow. override code from the *grandparent* class) for not much gain.

So yeah, I think the patch is fine.




             reply	other threads:[~2022-05-25 10:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 10:48 Wolfgang Bumiller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-04-29 10:00 Dominik Csapak
2022-05-02  6:36 ` Thomas Lamprecht
2022-05-02  6:48   ` Dominik Csapak
2022-05-02  6:51     ` Dominik Csapak
2022-05-02  7:04     ` Thomas Lamprecht
2022-05-02  7:20       ` Dominik Csapak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=513329947.1015.1653475719893@webmail.proxmox.com \
    --to=w.bumiller@proxmox.com \
    --cc=d.csapak@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal