]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
dentry_kill(): don't try to remove from shrink list
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 1 May 2014 14:30:00 +0000 (10:30 -0400)
committerJiri Slaby <jslaby@suse.cz>
Thu, 30 Oct 2014 21:17:35 +0000 (22:17 +0100)
commit11662c7b4621457dd0fccd3bba23a4d9cee2f722
treea35bf98289718fb5873e11b168093afe11d325ee
parent1be1a028ca20541434bf93ae5961480e34974f05
dentry_kill(): don't try to remove from shrink list

commit 41edf278fc2f042f4e22a12ed87d19c5201210e1 upstream.

If the victim in on the shrink list, don't remove it from there.
If shrink_dentry_list() manages to remove it from the list before
we are done - fine, we'll just free it as usual.  If not - mark
it with new flag (DCACHE_MAY_FREE) and leave it there.

Eventually, shrink_dentry_list() will get to it, remove the sucker
from shrink list and call dentry_kill(dentry, 0).  Which is where
we'll deal with freeing.

Since now dentry_kill(dentry, 0) may happen after or during
dentry_kill(dentry, 1), we need to recognize that (by seeing
DCACHE_DENTRY_KILLED already set), unlock everything
and either free the sucker (in case DCACHE_MAY_FREE has been
set) or leave it for ongoing dentry_kill(dentry, 1) to deal with.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/dcache.c
include/linux/dcache.h