diff --git a/sys/fs/autofs/autofs_vnops.c b/sys/fs/autofs/autofs_vnops.c index a3ae3a989ce4..550c5146beb2 100644 --- a/sys/fs/autofs/autofs_vnops.c +++ b/sys/fs/autofs/autofs_vnops.c @@ -504,9 +504,13 @@ autofs_node_new(struct autofs_node *parent, struct autofs_mount *amp, { struct autofs_node *anp; - if (parent != NULL) + if (parent != NULL) { AUTOFS_ASSERT_XLOCKED(parent->an_mount); + KASSERT(autofs_node_find(parent, name, namelen, NULL) == ENOENT, + ("node \"%s\" already exists", name)); + } + anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO); if (namelen >= 0) anp->an_name = strndup(name, namelen, M_AUTOFS);