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/b80b88bf9b7d
branches:  trunk
changeset: 358694:b80b88bf9b7d
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 f1367d3efee2 -r b80b88bf9b7d 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