public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH storage 3/3] zfs: list zvol: limit recursion depth to 1
Date: Tue, 10 Jan 2023 13:52:43 +0100	[thread overview]
Message-ID: <20230110125243.176153-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20230110125243.176153-1-f.ebner@proxmox.com>

To be correct in all cases, it's still necessary to filter by "pool"
in zfs_parse_zvol_list(), because $scfg->{pool} could be e.g.
'foo/vm-123-disk-0' which looks like an image name and would pass the
other "should skip"-checks in zfs_parse_zvol_list().

No change in the result of zfs_list_zvol() is intended.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 PVE/Storage/ZFSPoolPlugin.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index b971c7a..9fbd149 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -377,9 +377,12 @@ sub zfs_list_zvol {
 	'name,volsize,origin,type,refquota',
 	'-t',
 	'volume,filesystem',
-	'-Hrp',
+	'-d1',
+	'-Hp',
 	$scfg->{pool},
     );
+    # It's still required to have zfs_parse_zvol_list filter by pool, because -d1 lists
+    # $scfg->{pool} too and while unlikely, it could be named to be mistaken for a volume.
     my $zvols = zfs_parse_zvol_list($text, $scfg->{pool});
     return {} if !$zvols;
 
-- 
2.30.2





  parent reply	other threads:[~2023-01-10 12:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 12:52 [pve-devel] [PATCH storage 1/3] zfs: list zvol: return empty hash rather than undef Fiona Ebner
2023-01-10 12:52 ` [pve-devel] [PATCH storage 2/3] zfs: list zvol: skip different pools during parsing already Fiona Ebner
2023-01-10 12:52 ` Fiona Ebner [this message]
2023-01-10 13:46 ` [pve-devel] applied-series: [PATCH storage 1/3] zfs: list zvol: return empty hash rather than undef Wolfgang Bumiller

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=20230110125243.176153-3-f.ebner@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.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