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 <lukas@wunner.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3083
This commit is contained in:
Lukas Wunner 2015-02-04 10:45:19 +01:00 committed by Brian Behlendorf
parent 33b4de513e
commit 293d141ae4
1 changed files with 1 additions and 1 deletions

View File

@ -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