aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/initramfs/scripts
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-05-26 13:13:08 +0200
committerBrian Behlendorf <[email protected]>2021-06-09 13:05:34 -0700
commitb12a6d961cd5631d92123cf483512c48354063f9 (patch)
treef8fff13c184def1e7645f21c2b80fa1bc8fa6eec /contrib/initramfs/scripts
parent11b165cc9bac152c941301831c21afbb44509dbf (diff)
i-t: don't try to import from empty cache
Chases 7c64ee9e7731b7ad39e300b4a422892dbe8d4b23 ("zfs-import-{cache,scan}: change condition to FileNotEmpty") Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12108
Diffstat (limited to 'contrib/initramfs/scripts')
-rw-r--r--contrib/initramfs/scripts/zfs3
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs
index 6fcfc64bd..82eceaedb 100644
--- a/contrib/initramfs/scripts/zfs
+++ b/contrib/initramfs/scripts/zfs
@@ -709,7 +709,8 @@ mountroot()
# ------------
# Look for the cache file (if any).
- [ ! -f "${ZPOOL_CACHE}" ] && unset ZPOOL_CACHE
+ [ -f "${ZPOOL_CACHE}" ] || unset ZPOOL_CACHE
+ [ -s "${ZPOOL_CACHE}" ] || unset ZPOOL_CACHE
# ------------
# Compatibility: 'ROOT' is for Debian GNU/Linux (etc),