[PATCH] Fix endless loop in automount code

Sascha Hauer s.hauer at pengutronix.de
Wed Nov 27 05:37:38 EST 2013


A chdir to a path registered as an automount path followed by a 'ls'
results in an endless loop. This happens because the command the
automounter executes results in another automount request.
Fix this by running the automounter from the chdir code before
the cwd is actually changed.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 fs/fs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/fs.c b/fs/fs.c
index 4563a81..32dba8c 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -579,6 +579,8 @@ int chdir(const char *pathname)
 	if (ret)
 		goto out;
 
+	automount_mount(p, 0);
+
 	strcpy(cwd, p);
 
 out:
-- 
1.8.4.3




More information about the barebox mailing list