diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2022-07-14 21:23:00 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-07-14 21:34:47 +0200 |
commit | f418f14b2616709cc74bc6d5082b2ab5025dfd1c (patch) | |
tree | 157fc9c0fbc95a70e508ec726042e1656e2be1ac /fs | |
parent | 3b0b0ebdd5417e6f93cb9e41bd672c493eb214de (diff) | |
download | barebox-f418f14b2616709cc74bc6d5082b2ab5025dfd1c.tar.gz |
fs: Check if automount actually mounts something
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().
Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -3191,6 +3191,10 @@ static int automount_mount(struct dentry *dentry) printf("running automount command '%s' failed\n", am->cmd); ret = -ENODEV; + } else if (!(dentry->d_flags & DCACHE_MOUNTED)) { + printf("automount command '%s' didn't mount anything\n", + am->cmd); + ret = -ENODEV; } break; |