vfs: assert that HASBUF is only set with SAVENAME or SAVESTART

as requested by the caller. The intent is to eradicate the mostly
spurious NDFREE_PNBUF calls.
This commit is contained in:
Mateusz Guzik 2020-08-22 16:58:59 +00:00
parent 1e448a1558
commit de0fcd3a44

View File

@ -1384,6 +1384,7 @@ NDFREE_PNBUF(struct nameidata *ndp)
{
if ((ndp->ni_cnd.cn_flags & HASBUF) != 0) {
MPASS((ndp->ni_cnd.cn_flags & (SAVENAME | SAVESTART)) != 0);
uma_zfree(namei_zone, ndp->ni_cnd.cn_pnbuf);
ndp->ni_cnd.cn_flags &= ~HASBUF;
}