From d05015f88703d56c8c558690eb3c9e1debbd5d74 Mon Sep 17 00:00:00 2001 From: Fiona Ebner Date: Tue, 10 Jan 2023 13:52:43 +0100 Subject: [PATCH] zfs: list zvol: limit recursion depth to 1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Fiona Ebner --- 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;