
Dear Lukasz,
In message 1415365555-9790-1-git-send-email-l.majewski@samsung.com you wrote:
- umount $MNT_DIR
- while true; do
- umount $MNT_DIR > /dev/null 2>&1
- if [ $? -eq 0 ]; then
break
- fi
- printf "$COLOUR_ORANGE\tSleeping to wait for umount...$COLOUR_DEFAULT\n"
- sleep 1
- done
As Marek already pointed out, umount (both the command (8) and the syscall (2)) are supposed to be blocking (except for typical error cases like no permission, mountpoint does not exist, no file system mounted, etc.).
If you really ever see the umount entering above loop, then there is some bug somewhere. It would be indeed interesting to see the strace log for such umount calls. Also, can you please add details about the exact execution environment (host system / architecture, kernel version, distro, and _especially_ which sort of USB driver is involved here.
My gut feeling is that there might be some USB driver error involved here.
Best regards,
Wolfgang Denk