]> git.proxmox.com Git - pve-storage.git/commitdiff
zfs: fix unmount request
authorFabian Ebner <f.ebner@proxmox.com>
Thu, 5 Aug 2021 08:33:43 +0000 (10:33 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 12 Aug 2021 09:48:42 +0000 (11:48 +0200)
by not dying when the dataset is already unmounted. Can be triggered
for a container by doing two rollbacks in a row.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Storage/ZFSPoolPlugin.pm

index c4be70f2d0a7b3ceee69991001ecf08aafe2ee48..660b3d9b18783eab37c1d7f9ac0f51e59c7f68d6 100644 (file)
@@ -477,7 +477,10 @@ sub volume_snapshot_rollback {
     # caches, they get mounted in activate volume again
     # see zfs bug #10931 https://github.com/openzfs/zfs/issues/10931
     if ($format eq 'subvol') {
-       $class->zfs_request($scfg, undef, 'unmount', "$scfg->{pool}/$vname");
+       eval { $class->zfs_request($scfg, undef, 'unmount', "$scfg->{pool}/$vname"); };
+       if (my $err = $@) {
+           die $err if $err !~ m/not currently mounted$/;
+       }
     }
 
     return $msg;