Date: Sun, 14 Dec 2014 10:49:23 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275756 - head/usr.sbin/autofs Message-ID: <201412141049.sBEAnN9K098734@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Sun Dec 14 10:49:22 2014 New Revision: 275756 URL: https://svnweb.freebsd.org/changeset/base/275756 Log: Fix bug that made automount(8) never unmount stale autofs(5) mounts, ie mounts for entries that were there in auto_master(5), and then got removed. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/common.c Modified: head/usr.sbin/autofs/common.c ============================================================================== --- head/usr.sbin/autofs/common.c Sun Dec 14 10:37:17 2014 (r275755) +++ head/usr.sbin/autofs/common.c Sun Dec 14 10:49:22 2014 (r275756) @@ -676,8 +676,8 @@ node_print(const struct node *n) node_print_indent(child, 0); } -struct node * -node_find(struct node *node, const char *path) +static struct node * +node_find_x(struct node *node, const char *path) { struct node *child, *found; char *tmp; @@ -702,7 +702,7 @@ node_find(struct node *node, const char free(tmp); TAILQ_FOREACH(child, &node->n_children, n_next) { - found = node_find(child, path); + found = node_find_x(child, path); if (found != NULL) return (found); } @@ -710,6 +710,17 @@ node_find(struct node *node, const char return (node); } +struct node * +node_find(struct node *root, const char *path) +{ + struct node *node; + + node = node_find_x(root, path); + if (node == root) + return (NULL); + return (node); +} + /* * Canonical form of a map entry looks like this: *
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412141049.sBEAnN9K098734>