Try 5 times for rmdir command call after umount

Sometime, we will get "Device or resource busy" during the mount point
deleting, umount return 0, but the resouce is busy for a while, so need
to add sleep interval to wait resource free, then we can delete it.
Change-Id: Idaa219d12e847824960eec8907739add5d619d1a
Closes-Bug: 1332521
This commit is contained in:
Haomeng, Wang 2015-03-23 08:35:41 +00:00
parent 100959de8d
commit cc9870ec11

View File

@ -86,7 +86,10 @@ function run_d_in_target () {
trap - ERR
check_break after-$1 run_in_target bash
sudo umount -f $TMP_MOUNT_PATH/tmp/in_target.d
sudo rmdir $TMP_MOUNT_PATH/tmp/in_target.d
if ! timeout 5 sh -c " while ! sudo rmdir $TMP_MOUNT_PATH/tmp/in_target.d; do sleep 1; done"; then
echo "ERROR: unable to cleanly remove $TMP_MOUNT_PATH/tmp/in_target.d"
exit 1
fi
fi
}