]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zfs-import-{cache,scan}: change condition to FileNotEmpty
authorнаб <nabijaczleweli@nabijaczleweli.xyz>
Fri, 5 Feb 2021 19:25:22 +0000 (20:25 +0100)
committerGitHub <noreply@github.com>
Fri, 5 Feb 2021 19:25:22 +0000 (11:25 -0800)
commit7c64ee9e7731b7ad39e300b4a422892dbe8d4b23
treec1150302fb2fae073bc5db153ba63555b240b464
parent32366649d3164e994def7e5a26765ca6bc1e2315
zfs-import-{cache,scan}: change condition to FileNotEmpty

When all pools are exported ZFS will generate an empty cache file.
This will cause the import service to fail, which is sub-optimal,
since this means that dracut fails, and it necessary to run
`zpool import -a` to boot, delete the file, and regenerate+reinstall
the initrd.

This resolves the issue by treating an zero-length cache files the
same as a missing cache file.  This aligns the behavior with that
of the `zpool` command itself.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11568
etc/systemd/system/zfs-import-cache.service.in
etc/systemd/system/zfs-import-scan.service.in