From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] test: ums: Add sleep before unmount directory
Date: Fri, 7 Nov 2014 22:02:56 +0100 [thread overview]
Message-ID: <201411072202.56854.marex@denx.de> (raw)
In-Reply-To: <20141107175227.19f0cebd@amdc2363>
On Friday, November 07, 2014 at 05:52:27 PM, Lukasz Majewski wrote:
> Hi Marek,
>
> > On Friday, November 07, 2014 at 02:05:55 PM, Lukasz Majewski wrote:
> > > This change helps to run script on machines with quite long uptime.
> > > Without this the following error emerges:
> > >
> > > File: ./dat_14M.img
> > > umount: /mnt/tmp-ums-test: device is busy.
> > >
> > > (In some cases useful info about processes that use
> > >
> > > the device is found by lsof(8) or fuser(1))
> > >
> > > TX: md5sum:083d3d22b542d3ecba61b12d17e03f9f
> > > mount: /dev/sdd6 already mounted or /mnt/tmp-ums-test busy
> > > mount: according to mtab, /dev/sdd6 is already mounted
> > > on /mnt/tmp-ums-test
> > >
> > > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> >
> > Why exactly does mount not block until it can unmount the device
> > anyway ?
>
> Has mount or umount expose any blocking behavior?
I would expect umount to be blocking by default in the first place.
ie. umount /mnt/foo should wait until all data are synced on device
under /mnt/foo and only then it should be unmounted.
Can you check (with strace or something) what exact return value will
the umount() syscall return when it does NOT unmount the mountpoint
and returns to the shell ? Is it EBUSY ?
> As fair as I remember you cannot umount directory when any process
> holds reference to it.
>
> Here it looks like process which copy data queues data for writing and
> exit from cp.
>
> Presumably, when we call umount there is still some pending data for
> write.
>
> Hence the error.
In case there are data which are not yet sync'd to the device, the umount()
syscall should block until those data are written and return only after that.
Why would it return -EBUSY ... hmmmmm ...
> Maybe there is a switch for mount/umount/cp which can correct such
> behavior?
That should be the default ...
Best regards,
Marek Vasut
next prev parent reply other threads:[~2014-11-07 21:02 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 [this message]
2014-11-07 15:33 ` Stephen Warren
2014-11-07 21:54 ` Wolfgang Denk
2014-11-07 22:00 ` Stephen Warren
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=201411072202.56854.marex@denx.de \
--to=marex@denx.de \
--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