From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VlcVO-0006wC-Re for barebox@lists.infradead.org; Wed, 27 Nov 2013 10:38:04 +0000 From: Sascha Hauer Date: Wed, 27 Nov 2013 11:37:38 +0100 Message-Id: <1385548658-13958-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH] Fix endless loop in automount code To: barebox@lists.infradead.org Cc: jbe@pengutronix.de 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 --- 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 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox