Add assertion to catch duplicated notes.
Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
90a5222f14
commit
3e4adf76c4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user