From: Al Viro Date: Fri, 20 Apr 2018 03:58:48 +0000 (-0400) Subject: restore cond_resched() in shrink_dcache_parent() X-Git-Tag: v4.1.12-124.31.3~22 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=97139d2c69484816f95b1a8e981653540dd97cf5;p=users%2Fjedix%2Flinux-maple.git restore cond_resched() in shrink_dcache_parent() Signed-off-by: Al Viro (cherry picked from commit 4fb48871409e2fcd375087d526d07f7600c88f94) Orabug: 30101895 Signed-off-by: John Donnelly Reviewed-by: Somasundaram Krishnasamy Signed-off-by: Brian Maly Conflicts: fs/dcache.c - Upstream did not have 4th arg NULL to d_walk(). Signed-off-by: Brian Maly --- diff --git a/fs/dcache.c b/fs/dcache.c index 16f36cfb4fd6..7916a213d750 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1427,10 +1427,15 @@ void shrink_dcache_parent(struct dentry *parent) data.found = 0; d_walk(parent, &data, select_collect, NULL); + + if (!list_empty(&data.dispose)) { + shrink_dentry_list(&data.dispose); + continue; + } + + cond_resched(); if (!data.found) break; - - shrink_dentry_list(&data.dispose); } } EXPORT_SYMBOL(shrink_dcache_parent);