CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]   2017/02/08 09:08:06

Modified files:
        sys/dev/pv     : xen.c 

Log message:
Fixup incorrect test when allocating grant table entries

An xnf & xbf attach/detach loop has revealed that sometimes when we're
about to free a grant table entry that is still in use which is a grave
mistake code wise.  Turned out we could allocate an entry twice because
of an incorrect test that took flags value into account when making the
decision regarding availability of a given entry.  At the same time,
upon releasing the entry we explicitly CAS in 0 into the flags making
this check bogus.

While here be explicit about starting flags by initializing them to 0
and always panic when the "double free" condition is encountered.

rzalamena@ has lent me his eyes and has double-checked the condition.

Reply via email to