Module Name: src
Committed By: christos
Date: Sat Jan 13 22:06:21 UTC 2018
Modified Files:
src/sys/fs/autofs: autofs_vfsops.c
Log Message:
prevent assert on unmount.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_vfsops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/fs/autofs/autofs_vfsops.c
diff -u src/sys/fs/autofs/autofs_vfsops.c:1.2 src/sys/fs/autofs/autofs_vfsops.c:1.3
--- src/sys/fs/autofs/autofs_vfsops.c:1.2 Tue Jan 9 11:19:39 2018
+++ src/sys/fs/autofs/autofs_vfsops.c Sat Jan 13 17:06:21 2018
@@ -33,7 +33,7 @@
*
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.2 2018/01/09 16:19:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.3 2018/01/13 22:06:21 christos Exp $");
#include "autofs.h"
@@ -219,6 +219,13 @@ autofs_unmount(struct mount *mp, int mnt
while (!RB_EMPTY(&->am_root->an_children)) {
struct autofs_node *anp;
anp = RB_MIN(autofs_node_tree, &->am_root->an_children);
+ if (!RB_EMPTY(&anp->an_children)) {
+ AUTOFS_DEBUG("%s: %s has children", __func__,
+ anp->an_name);
+ mutex_exit(&->am_lock);
+ return EBUSY;
+ }
+
autofs_node_delete(anp);
}
autofs_node_delete(amp->am_root);