public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] test: ums: Add sleep before unmount directory
Date: Fri, 07 Nov 2014 15:00:01 -0700	[thread overview]
Message-ID: <545D40E1.2030700@wwwdotorg.org> (raw)
In-Reply-To: <20141107215404.3580138334A@gemini.denx.de>

On 11/07/2014 02:54 PM, Wolfgang Denk wrote:
> 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.

Where I've seen this is writing to an SD card in a USB-based SD card reader.

I have a fairly regular amd64 machine running Ubuntu. I put the loop 
above into my own scripts that mount an SD card, copy new data to it, 
and then immediately unmount it for the same reason that Lukasz made 
this patch; umount doesn't always unmount. I did this so long ago that I 
don't recall which Ubuntu version I had at the time, nor the kernel 
version. It was *probably* Ubuntu 10.04 or 12.10 though. Now I'm on 
14.04, but have no idea if I still need the loop since it's already in 
place:-)

  reply	other threads:[~2014-11-07 22:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06 10:23 [U-Boot] [PATCH] test: ums: Add sleep before unmount directory Lukasz Majewski
2014-11-06 17:00 ` Stephen Warren
2014-11-06 21:30   ` Lukasz Majewski
2014-11-07 13:05 ` [U-Boot] [PATCH v2] " Lukasz Majewski
2014-11-07 15:28   ` Marek Vasut
2014-11-07 16:52     ` Lukasz Majewski
2014-11-07 21:02       ` Marek Vasut
2014-11-07 15:33   ` Stephen Warren
2014-11-07 21:54   ` Wolfgang Denk
2014-11-07 22:00     ` Stephen Warren [this message]
2014-11-07 23:03       ` Wolfgang Denk
2014-11-12 14:29         ` Lukasz Majewski
2014-11-12 16:45           ` Wolfgang Denk
2014-11-12 18:11             ` Stephen Warren
2014-11-12 21:49               ` Lukasz Majewski
2014-11-14 10:43                 ` Lukasz Majewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545D40E1.2030700@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox