Commit 0f4e7166 authored by Long Li's avatar Long Li
Browse files

fs:/dcache.c: fix negative dentry limit not complete problem

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8WPQW


CVE: NA

--------------------------------

Restrictions of negative dentry can avoid softlock when too many dentry in
memory, but restrictions before do not always take effect. For example,
removing files which has been created would not enter retain_dentry(),
because the dentry of file maybe has been added to lru list of superblock,
it caused that fast_dput() reutrn true in last dput().

So, add restriction logic for the file which has been added to the lru list
in fast_dput(), it prevents the negative dentry exceeding the limit when
deleting existing file. Factor out negative dentry limit logic into
limit_negative_dentry(), make the code more clean.

Fixes: 7ba5d5d0 ("fs/dcache.c: avoid softlock since too many negative dentry")
Signed-off-by: default avatarLong Li <leo.lilong@huawei.com>
parent 57170d7c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment