From cd6afb3e4b8c48210b155dc46bf6793b609b7d93 Mon Sep 17 00:00:00 2001 From: Sahitya Tummala Date: Fri, 21 Apr 2017 21:56:19 +0530 Subject: [PATCH] fs/dcache: Fix indefinite wait in d_invalidate() In the path of task exit, the proc dentries corresponding to this task will be killed by moving it to a shrink list. If those dentries are already claimed by another task for shrinking, the exiting task waits in a tight loop until those dentries are killed. This can potentially result in a deadlock if those dentries are corresponding to an RT task but the task which is shrinking those dentries is a lower priority task. Fix this by not doing tight loop, if our dentries are claimed by other task. Change-Id: If6848521469db7dea2bbba0dbaf8597094716267 Signed-off-by: Sahitya Tummala --- fs/dcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/dcache.c b/fs/dcache.c index 7b8feb6d60c8..3a3b0f370304 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1364,7 +1364,7 @@ static enum d_walk_ret select_collect(void *_data, struct dentry *dentry) goto out; if (dentry->d_flags & DCACHE_SHRINK_LIST) { - data->found++; + goto out; } else { if (dentry->d_flags & DCACHE_LRU_LIST) d_lru_del(dentry);