[PATCH] fs: Check if automount actually mounts something

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Tue Aug 9 06:05:19 PDT 2022


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).

> > I admit it's a bit constructed, but maybe that's only because I'm not
> > creative enough?
> 
> Yes, it is constructed ;)

OK, we can still adapt that later if and when such a need arises :-)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20220809/fb01f7c6/attachment.sig>


More information about the barebox mailing list