From 293d141ae4f6b2345249020b656cfc0ce007b9fa Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Wed, 4 Feb 2015 10:45:19 +0100 Subject: [PATCH] Fix loop in Dracut shutdown script The shell executes each command of a pipeline in a subshell, thus $ret always had the same value after the while loop that it had before the loop (http://mywiki.wooledge.org/BashFAQ/024), signaling success even if some of the zpools could not be exported. Signed-off-by: Lukas Wunner Signed-off-by: Brian Behlendorf Closes #3083 --- dracut/90zfs/export-zfs.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dracut/90zfs/export-zfs.sh.in b/dracut/90zfs/export-zfs.sh.in index dd1ea81219d0..12300fc976ce 100755 --- a/dracut/90zfs/export-zfs.sh.in +++ b/dracut/90zfs/export-zfs.sh.in @@ -10,7 +10,7 @@ _do_zpool_export() { fi info "Exporting ZFS storage pools" - zpool list -H | while read fs rest ; do + for fs in `zpool list -H -o name` ; do zpool export $force "$fs" || ret=$? done