]> git.proxmox.com Git - pve-storage.git/commitdiff
zfs: don't generate/update cachefile on pool import
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 3 Apr 2019 09:06:07 +0000 (11:06 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Apr 2019 10:18:37 +0000 (12:18 +0200)
during storage activation.

for pools that don't get imported at boot (e.g. because their vdevs are
not available when zfs-import-*.service runs) it is fatal to include
them in the cachefile, for those that do get imported at boot this code
should never run anyway as they are already imported.

in any case, a fallback to import without cachefile is the safe variant.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/Storage/ZFSPoolPlugin.pm

index 4bf6d50c03c379a3afcdb27c515d71d13a5fad6b..4f16351d5cbc4a7eb3e1eef478af666333cbe803 100644 (file)
@@ -531,7 +531,7 @@ sub activate_storage {
 
     if ($@ || !defined($res) || $res !~ $pool) {
        eval {
-           @param = ('-d', '/dev/disk/by-id/', "$pool");
+           @param = ('-d', '/dev/disk/by-id/', '-o', 'cachefile=none', "$pool");
            $class->zfs_request($scfg, undef, 'zpool_import', @param);
        };
        die "could not activate storage '$storeid', $@\n" if $@;