init: Give mount-encrypted umount 10 times to retry

There is a lazy umount -n -l /var/run /var/lock before mount-encrypted
umount. But since it is a lazy umount, we don't know when it really
clears all reference points.
By experiment, some delay is needed to make mount-encrypted umount to
succeed. Without this delay, it will fail with fail rate 1 out of 10.
This CL lets mount-encrypted umount to retry 10 times with 0.1 seconds delay
between each retries to make it succeed earlier with certain delay.

BUG=chrome-os-partner:21345
TEST=run shutdown -r now, check there is no
/mnt/stateful_partition/shutdown_stateful_umount_failure
nor /mnt/stateful_partition/umount-encrypted.log.
Redo the test for 1000 times.

Original Change-Id: Ic598d045d53525a1d39e6b4f87d1cb4fdecb8bf5
Original Reviewed-on: https://chromium-review.googlesource.com/168911
Original Reviewed-by: Kees Cook <keescook@chromium.org>
Original Commit-Queue: Cheng-Yi Chiang <cychiang@chromium.org>
Original Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>

Change-Id: I9945744607008a0326f517aa2c9afe37fa8c9a8a
Reviewed-on: https://chromium-review.googlesource.com/219007
Reviewed-by: Kees Cook <keescook@chromium.org>
Commit-Queue: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
1 file changed