Fix: Stream allocation and insertion consistency
authorDavid Goulet <dgoulet@efficios.com>
Wed, 3 Oct 2012 15:22:50 +0000 (11:22 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 9 Oct 2012 15:20:49 +0000 (11:20 -0400)
This commit restores the consistency between the allocate and insertion
operations on streams. The allocate stream function was changing the
channel state by updating the refcount, cpucount and number of init
stream. We now moved these operations into the add_stream function so
that the initialization is done there and the del_stream handles the
cleanup.

So basically, any side effect done on a channel using a stream is now
done in the add/del functions. The same was done for the metadata which
is a special case that does not need to set the need update flag.

Furthermore, the consumer_del_stream now can destroy a stream even if
that stream was not successfully added to its hash table. The kernel and
UST consumers now use it on error between allocation and the add_stream
function.

This refactoring fixes memory leaks, bad refcount values and file
descriptor leaks. Also, the metadata destroy stream function was also
fixed to use the waitfd_node which is also fixed in the
consumer_del_metadata_stream that was deleting the wrong node pointer.

The waitfd_node fixes were merged with this commit in order to make the
whole patch works and not failed on make check.

Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>

No differences found
This page took 0.024666 seconds and 4 git commands to generate.