[Linux-cachefs] Finally working on cachefs and found first bug.

Gilliam, PaulX J paulx.j.gilliam at intel.com
Fri Sep 17 23:39:36 UTC 2010


Here is what I found out with more study:

Within cachefs, "kmem_cache_alloc(cachefs_object_jar, ...)" is called in three places: tree-scan.c:"cachefs_scan_scanning_node()", interface.c:"cachefs_alloc_object()", and super.c:"cachefs_fill_super()".

In "cachefs_scan_scanning_node()", "fscache_object_init()" is called shortly after "kmem_cache_alloc(cachefs_object_jar, ...)" is called.
In "cachefs_alloc_object()", "fscache_object_init()" is called shortly after "kmem_cache_alloc(cachefs_object_jar, ...)" is called.
Only in "cachefs_fill_super() is "fscache_object_init() not called.

If I had just not done the "atomic inc" if the fcache_cache pointer was NULL, there would have been some other problem later because the other two places the kmem_cache_alloc is done would have caused the "atomic inc" to be done twice, sense "fscache_object_init()" was being called twice.

So what I did was move the "fscache_object_init()" out of "cache_object_init_once()" and into "cache_fill_super()", the only place it wasn't being called already.

So, that fixed that.

Now on to the next problem :)

-=# Paul #=-





More information about the Linux-cachefs mailing list