From b12a6d961cd5631d92123cf483512c48354063f9 Mon Sep 17 00:00:00 2001 From: наб Date: Wed, 26 May 2021 13:13:08 +0200 Subject: i-t: don't try to import from empty cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Chases 7c64ee9e7731b7ad39e300b4a422892dbe8d4b23 ("zfs-import-{cache,scan}: change condition to FileNotEmpty") Reviewed-by: Brian Behlendorf Signed-off-by: Ahelenia Ziemiańska Closes #12108 --- contrib/initramfs/scripts/zfs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'contrib/initramfs/scripts') 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), -- cgit v1.2.3