2006-03-01 18:43:38

by Jan Blunck

[permalink] [raw]
Subject: [PATCH,RESUBMIT] Fix shrink_dcache_parent() against shrink_dcache_memory() race

Kirill Korotaev <[email protected]> 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 <[email protected]>

---


Attachments:
(No filename) (738.00 B)
umount-prune_one_dentry-fix.diff (2.90 kB)
Download all attachments