On Thu, 04 Sep 2008 09:47:58 +1000, Christoph Hellwig <hch@xxxxxxxxxxxxx>
wrote:
void
cache_node_put(
+ struct cache * cache,
struct cache_node * node)
{
+ struct cache_mru * mru;
+
pthread_mutex_lock(&node->cn_mutex);
#ifdef CACHE_DEBUG
if (node->cn_count < 1) {
@@ -368,8 +372,23 @@ cache_node_put(
__FUNCTION__, node->cn_count, node);
cache_abort();
}
+ if (!list_empty(&node->cn_mru)) {
+ fprintf(stderr, "%s: node put on node (%p) in MRU list\n",
+ __FUNCTION__, node);
+ cache_abort();
+ }
Assert that we don't put a node that's already on the mru list, okay.
Shouldn't this be ASSERT?
I chose to make this always abort as it can be triggered outside of
libxfs by xfsprogs usage of it (ie. doing a "put" on a buffer that has
already been "put").
So, I thought this needs to always work, debug or non-debug and
halt immediately if it happens.
|