pseudofs: enhance KASSERT with more information

Add the name and type information to a KASSERT for 'homonymous siblings'.
Without this (or a core file) we do not even know which entry to look
for.  This should make reporting and debugging a tad more simple.

Prompted by:	PR 287165
This commit is contained in:
Bjoern A. Zeeb 2025-06-03 11:20:56 +00:00
parent 2a35b00732
commit 9a139facd0

View file

@ -124,7 +124,8 @@ pfs_add_node(struct pfs_node *parent, struct pfs_node *pn)
("%s(): nested process directories", __func__));
for (iter = parent->pn_nodes; iter != NULL; iter = iter->pn_next) {
KASSERT(strcmp(pn->pn_name, iter->pn_name) != 0,
("%s(): homonymous siblings", __func__));
("%s(): homonymous siblings: '%s' type %d", __func__,
pn->pn_name, pn->pn_type));
if (pn->pn_type == pfstype_procdir)
KASSERT(iter->pn_type != pfstype_procdir,
("%s(): sibling process directories", __func__));