From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] fs: Check if automount actually mounts something
Date: Wed, 10 Aug 2022 08:44:38 +0200 [thread overview]
Message-ID: <20220810064438.GV31528@pengutronix.de> (raw)
In-Reply-To: <20220809130519.5ka6umrrn2dgt4g2@pengutronix.de>
On Tue, Aug 09, 2022 at 03:05:19PM +0200, Uwe Kleine-König wrote:
> Hello,
>
> On Tue, Aug 09, 2022 at 12:06:38PM +0200, Sascha Hauer wrote:
> > On Thu, Jul 14, 2022 at 11:12:38PM +0200, Uwe Kleine-König wrote:
> > > On Thu, Jul 14, 2022 at 09:35:09PM +0200, Sascha Hauer wrote:
> > > > An automount command that returns successfully but doesn't mount
> > > > anything makes barebox hang as can be reproduced with:
> > > >
> > > > automount -d /mnt/foo true
> > > > ls /mnt/foo
> > > >
> > > > Check if the current dentry is a mountpoint after running the automount
> > > > command, otherwise return with an error from automount_mount().
> > >
> > > While I think the intention of this patch is fine, I have little doubts
> > > if that breaks some workflows, e.g. something like:
> > >
> > > automount -d /mnt/tralala 'for p in 0 1 2; do mkdir ${automount_path}/${p} && mount /dev/disk0.${p} ${automount_path}/${p} || break; done'
> >
> > You would create 3 automountpoints for that.
>
> Yeah, if you go one step further and create a directory for each
> partition of the thumb drive, this is a dynamic thing though and solving
> that with an automount might make sense, so something like:
>
> automount -d /mnt/tralala "for p in /dev/disk0.*; do mp=$(\${automount_path}/\$(basename $p)); automount -d \$mp 'mount \$p \$mp'"
>
> (don't know if that would work, but you get the idea I guess).
It won't work. The outer automount is for mounting /mnt/tralala/. You
can't access anything inside /mnt/tralala/ before that has been
completed.
Similarly the following doesn't work:
# automount -d /mnt/tralala 'echo -o ${automount_path}/foo bar'
# ls /mnt/tralala/
open: Invalid argument
running automount command 'echo -o ${automount_path}/foo bar' failed
ls: /mnt/tralala/: No such device
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2022-08-10 6:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 19:35 Sascha Hauer
2022-07-14 21:12 ` Uwe Kleine-König
2022-08-09 10:06 ` Sascha Hauer
2022-08-09 13:05 ` Uwe Kleine-König
2022-08-10 6:44 ` Sascha Hauer [this message]
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=20220810064438.GV31528@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=u.kleine-koenig@pengutronix.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