summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2022-07-14 21:23:00 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-07-14 21:34:47 +0200
commitf418f14b2616709cc74bc6d5082b2ab5025dfd1c (patch)
tree157fc9c0fbc95a70e508ec726042e1656e2be1ac /fs
parent3b0b0ebdd5417e6f93cb9e41bd672c493eb214de (diff)
downloadbarebox-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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 460fc2f7f1..bd6f144742 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -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;