This is an updated version of the patch which adresses some issues that came up during discussion. The wait_on_prunes() code has moved to generic_shutdown_super() to avoid hiding the mess in shrink_dcache_parent(). Recently updated the comments to be more verbose about the goals of the modification. Original patch description: Kirill Korotaev discovered a race between shrink_dcache_parent() and shrink_dcache_memory() which leads to "Busy inodes after unmount". When unmounting a file system shrink_dcache_parent() is racing against a possible shrink_dcache_memory(). This might lead to the situation that shrink_dcache_parent() is returning too early. In this situation the super_block is destroyed before shrink_dcache_memory() could put the inode. This patch fixes the problem through introducing a prunes counter which is incremented when a dentry is pruned but the corresponding inoded isn't put yet.When the prunes counter is not null, shrink_dcache_parent() is waiting and restarting its work. Signed-off-by: Jan Blunck Signed-off-by: Kirill Korotaev