* [pve-devel] [PATCH storage] fix volume activation for ZFS subvols
@ 2020-11-19 10:29 Fabian Ebner
2020-11-23 6:09 ` [pve-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2020-11-19 10:29 UTC (permalink / raw)
To: pve-devel
When using the path to request properties, and no ZFS file system is mounted
at that path, ZFS will fall back to the parent filesystem:
> # zfs unmount myzpool/subvol-172-disk-0
> # zfs get mounted /myzpool/subvol-172-disk-0
> NAME PROPERTY VALUE SOURCE
> myzpool mounted yes -
> # zfs get mounted myzpool/subvol-172-disk-0
> NAME PROPERTY VALUE SOURCE
> myzpool/subvol-172-disk-0 mounted no -
Thus, we cannot use the path and need to use the dataset directly.
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---
See commit 59fdc2b71e5da8eaf3c821a5c55f410f58da200a for more context.
I did build the package as root to run the zfs regressiontests this time.
PVE/Storage/ZFSPoolPlugin.pm | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 07540b3..2f0a80a 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -549,15 +549,14 @@ sub activate_volume {
return 1 if defined($snapname);
- my (undef, undef, undef, undef, undef, undef, $format) = $class->parse_volname($volname);
+ my (undef, $dataset, undef, undef, undef, undef, $format) = $class->parse_volname($volname);
if ($format eq 'raw') {
$class->zfs_wait_for_zvol_link($scfg, $volname);
} elsif ($format eq 'subvol') {
- my ($path, undef, undef) = $class->path($scfg, $volname, $storeid);
- my $mounted = $class->zfs_get_properties($scfg, 'mounted', "$path");
+ my $mounted = $class->zfs_get_properties($scfg, 'mounted', "$scfg->{pool}/$dataset");
if ($mounted !~ m/^yes$/) {
- $class->zfs_request($scfg, undef, 'mount', "$path");
+ $class->zfs_request($scfg, undef, 'mount', "$scfg->{pool}/$dataset");
}
}
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pve-devel] applied: [PATCH storage] fix volume activation for ZFS subvols
2020-11-19 10:29 [pve-devel] [PATCH storage] fix volume activation for ZFS subvols Fabian Ebner
@ 2020-11-23 6:09 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2020-11-23 6:09 UTC (permalink / raw)
To: Proxmox VE development discussion, Fabian Ebner
On 19.11.20 11:29, Fabian Ebner wrote:
> When using the path to request properties, and no ZFS file system is mounted
> at that path, ZFS will fall back to the parent filesystem:
>
>> # zfs unmount myzpool/subvol-172-disk-0
>> # zfs get mounted /myzpool/subvol-172-disk-0
>> NAME PROPERTY VALUE SOURCE
>> myzpool mounted yes -
>> # zfs get mounted myzpool/subvol-172-disk-0
>> NAME PROPERTY VALUE SOURCE
>> myzpool/subvol-172-disk-0 mounted no -
>
> Thus, we cannot use the path and need to use the dataset directly.
>
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>
> See commit 59fdc2b71e5da8eaf3c821a5c55f410f58da200a for more context.
> I did build the package as root to run the zfs regressiontests this time.
>
> PVE/Storage/ZFSPoolPlugin.pm | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-23 6:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 10:29 [pve-devel] [PATCH storage] fix volume activation for ZFS subvols Fabian Ebner
2020-11-23 6:09 ` [pve-devel] applied: " Thomas Lamprecht
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal