Whamcloud - gitweb
Zach and I found a nasty race condition with the sets: we were
overloading the refcount to mean both "number of outstanding I/Os" and
also "number of threads using this structure". It was possible in
extreme circumstances to free the set in the reading thread before the
event handling thread called wake_up, which would thus crash.
To address this, there is a new count (brw_desc_count), which counts
the number of remaining I/Os. The other count, brw_refcount, now
properly tracks users of the structure to prevent early freeing.