e2scrub: fix some problems

Fix a couple of problems that have been reported against e2scrub_all.
The first fixes a complaint about a large increase in boot time due to
automatic reaping of e2scrub snapshots.  The second eliminates some
broken hackery around loop iteration in bash.
e2scrub_all: fix broken stdin redirection

gregor herrmann reports that the weekly e2scrub cronjob emits these
errors:

/sbin/e2scrub_all: line 173: /proc/8234/fd/pipe:[90083173]: No such file or directory

The root cause of this is that the ls_targets stdout is piped to stdin
to the entire ls_targets loop body to prevent the loop body from reading
the loop iteration items.  Remove all the broken hackery by reading the
target list into a bash array and iterating the bash array.

Addresses-Debian-Bug: #944033

Reported-by: gregor herrmann <gregoa@debian.org>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
1 file changed