exactly.No, it looks as it is not :(
Have you noticed my comment about "count" argument to prune_dcache()?
For example, prune_dcache() is called from shrink_dcache_parent() which is called in many places and not all of them have PF_MEMALLOC or s_umount semaphore for write. But prune_dcache() doesn't care for super blocks etc. It simply shrinks N dentries which are found _first_.
So the condition:
+ if ((current->flags & PF_MEMALLOC) &&
+ !(ret = down_read_trylock(&s->s_umount))) {
is not always true when the race occurs, as PF_MEMALLOC is not always set.
I understand your comment about shrink_dcache_parent() being called
from several places. prune_one_dentry() would eventually dput the parent,
but unmount would go ahead and unmount the filesystem before the
dput of the parent could happen.
Given that background, I thought our main concern was with respect toPartial fix doesn't make much sense from my point of view.
unmount. The race was between shrink_dcache_parent() (called from unmount)
and shrink_dcache_memory() (called from the allocator), hence the fix
for the race condition.
I just noticied that 2.6.16-rc* now seems to have drop_slab() whereYeah, playing with PF_MEMALLOC can be not so good idea :/
PF_MEMALLOC is not set. So, we can still race with my fix if there
if /proc/sys/vm/drop_caches is written to and unmount is done in parallel.
A simple hack would be to set PF_MEMALLOC in drop_slab(), but I do not
think it is a good idea.
Sorry, that I did it too late :/Thanks for your detailed feedbackHave you had any other feedback on this?here it is :)