From 2ba7a9e5cc984a9e9e750b1ce3d41b8b384ba55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Wed, 26 May 2021 13:13:08 +0200 Subject: [PATCH] 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(-) diff --git a/contrib/initramfs/scripts/zfs b/contrib/initramfs/scripts/zfs index cfc099e6cd..306e6e157e 100644 --- a/contrib/initramfs/scripts/zfs +++ b/contrib/initramfs/scripts/zfs @@ -706,7 +706,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),