From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 6F5A160404 for ; Mon, 10 Jan 2022 13:41:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5E5DC5D3 for ; Mon, 10 Jan 2022 13:40:31 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id AACDB5C4 for ; Mon, 10 Jan 2022 13:40:29 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 836A945FBD for ; Mon, 10 Jan 2022 13:40:29 +0100 (CET) Date: Mon, 10 Jan 2022 13:40:17 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20220110115044.81215-1-f.ebner@proxmox.com> In-Reply-To: <20220110115044.81215-1-f.ebner@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.15.0 (https://github.com/astroidmail/astroid) Message-Id: <1641818366.stgo2cbaz0.astroid@nora.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.223 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] applied: [PATCH v2 storage] zfs: use -r parameter when listing snapshots X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Jan 2022 12:41:01 -0000 thanks! (and a big 'huh?' to those implementations - not relevant for=20 us, but forcing '-r' to query snapshots seems rather strange..) On January 10, 2022 12:50 pm, Fabian Ebner wrote: > Some versions of ZFS do not automatically display the child snapshots > when '-t snapshot' is used, but require '-r' to be present > additionally[1]. And in general, it's cleaner to specify the flag > explicitly. >=20 > Because of that, commit ac5c1af led to a regression[0] in the context > of ZFS over iSCSI with zfs_get_sorted_snapshot_list. Fix it, by adding > a -r flag again. >=20 > The volume_snapshot_info function is currently only used in the > context of replication and that requires a local ZFS pool, but it > would be affected by the same issue if it is ever used in the context > of ZFS over iSCSI, so also add -r there. >=20 > [0]: https://forum.proxmox.com/threads/102683/ > [1]: https://forum.proxmox.com/threads/102683/post-442577 >=20 > Fixes: 8c20d8a ("plugin: add volume_snapshot_info function") > Fixes: ac5c1af ("zfspool: add zfs_get_sorted_snapshot_list helper") > Signed-off-by: Fabian Ebner > --- >=20 > Changes from v1: > * Add -r in volume_snapshot_info too. >=20 > PVE/Storage/ZFSPoolPlugin.pm | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm > index 5f6befd..e952a5c 100644 > --- a/PVE/Storage/ZFSPoolPlugin.pm > +++ b/PVE/Storage/ZFSPoolPlugin.pm > @@ -398,9 +398,11 @@ sub zfs_list_zvol { > sub zfs_get_sorted_snapshot_list { > my ($class, $scfg, $volname, $sort_params) =3D @_; > =20 > + my @params =3D ('-H', '-r', '-t', 'snapshot', '-o', 'name', $sort_pa= rams->@*); > + > my $vname =3D ($class->parse_volname($volname))[1]; > + push @params, "$scfg->{pool}\/$vname"; > =20 > - my @params =3D ('-H', '-t', 'snapshot', '-o', 'name', $sort_params->= @*, "$scfg->{pool}\/$vname"); > my $text =3D $class->zfs_request($scfg, undef, 'list', @params); > my @snapshots =3D split(/\n/, $text); > =20 > @@ -513,9 +515,11 @@ sub volume_rollback_is_possible { > sub volume_snapshot_info { > my ($class, $scfg, $storeid, $volname) =3D @_; > =20 > + my @params =3D ('-Hp', '-r', '-t', 'snapshot', '-o', 'name,guid,crea= tion'); > + > my $vname =3D ($class->parse_volname($volname))[1]; > + push @params, "$scfg->{pool}\/$vname"; > =20 > - my @params =3D ('-Hp', '-t', 'snapshot', '-o', 'name,guid,creation',= "$scfg->{pool}\/$vname"); > my $text =3D $class->zfs_request($scfg, undef, 'list', @params); > my @lines =3D split(/\n/, $text); > =20 > --=20 > 2.30.2 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20