Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/autofs prevent assert on unmount.



details:   https://anonhg.NetBSD.org/src/rev/4d3bed62d025
branches:  trunk
changeset: 828995:4d3bed62d025
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 13 22:06:21 2018 +0000

description:
prevent assert on unmount.

diffstat:

 sys/fs/autofs/autofs_vfsops.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 9c78e550eec0 -r 4d3bed62d025 sys/fs/autofs/autofs_vfsops.c
--- a/sys/fs/autofs/autofs_vfsops.c     Sat Jan 13 20:36:06 2018 +0000
+++ b/sys/fs/autofs/autofs_vfsops.c     Sat Jan 13 22:06:21 2018 +0000
@@ -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 @@
        while (!RB_EMPTY(&amp->am_root->an_children)) {
                struct autofs_node *anp;
                anp = RB_MIN(autofs_node_tree, &amp->am_root->an_children);
+               if (!RB_EMPTY(&anp->an_children)) {
+                       AUTOFS_DEBUG("%s: %s has children", __func__,
+                           anp->an_name);
+                       mutex_exit(&amp->am_lock);
+                       return EBUSY;
+               }
+                       
                autofs_node_delete(anp);
        }
        autofs_node_delete(amp->am_root);



Home | Main Index | Thread Index | Old Index