Date: Fri, 7 Nov 2014 15:52:33 +0000 (UTC) From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r274239 - stable/10/sys/fs/autofs Message-ID: <201411071552.sA7FqXZw006123@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: trasz Date: Fri Nov 7 15:52:32 2014 New Revision: 274239 URL: https://svnweb.freebsd.org/changeset/base/274239 Log: MFC r272931: Add assertion to catch duplicated nodes. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/fs/autofs/autofs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/autofs/autofs_vnops.c ============================================================================== --- stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:50:40 2014 (r274238) +++ stable/10/sys/fs/autofs/autofs_vnops.c Fri Nov 7 15:52:32 2014 (r274239) @@ -504,9 +504,13 @@ autofs_node_new(struct autofs_node *pare { 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411071552.sA7FqXZw006123>