[Bug 137145] [mbuf] Reference count computing isn't correct when more than one threads call function m_copypacket
| Newsgroups | gmane.os.freebsd.devel.net |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=137145 Zhenlei Huang <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected], | |[email protected] --- Comment #8 from Zhenlei Huang <[email protected]> --- Gleb changed some logic of mb_dupcl(), the patch should be rebased. I think we still risk concurrent mb_dupcl(). ``` /* See if this is the mbuf that holds the embedded refcount. */ if (m->m_ext.ext_flags & EXT_FLAG_EMBREF) { refcnt = n->m_ext.ext_cnt = &m->m_ext.ext_count; n->m_ext.ext_flags &= ~EXT_FLAG_EMBREF; } else { KASSERT(m->m_ext.ext_cnt != NULL, ("%s: no refcounting pointer on %p", __func__, m)); refcnt = m->m_ext.ext_cnt; } if (*refcnt == 1) *refcnt += 1; /* XXX_ZL possible to lose update on concurrent mb_dupcl() */ else atomic_add_int(refcnt, 1); ``` also CC @Gleb -- You are receiving this mail because: You are the assignee for the bug.