diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index 10b10c4..227244d 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -165,8 +165,7 @@ sub path { sub zfs_request { my ($class, $scfg, $timeout, $method, @params) = @_; - $timeout = PVE::RPCEnvironment::is_worker() ? 60*60 : 5 - if !$timeout; + my $default_timeout = PVE::RPCEnvironment::is_worker() ? 60*60 : 5; my $cmd = []; @@ -174,6 +173,7 @@ sub zfs_request { push @$cmd, 'zpool', 'list'; } elsif ($method eq 'zpool_import') { push @$cmd, 'zpool', 'import'; + $default_timeout = 15 if $default_timeout < 15; } else { push @$cmd, 'zfs', $method; } @@ -187,6 +187,8 @@ sub zfs_request { $msg .= "$line\n"; }; + $timeout = $default_timeout if !$timeout; + run_command($cmd, errmsg => "zfs error", outfunc => $output, timeout => $timeout); return $msg;