Message ID | 1611235185-1685-3-git-send-email-gautham.ananthakrishna@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | fix the negative dentres bloating system memory usage | expand |
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 8d3ad5e..4ccb59d 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c @@ -127,8 +127,12 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode) * original inode) */ spin_lock(&alias->d_lock); list_for_each_entry(child, &alias->d_subdirs, d_child) { - if (!child->d_inode) + if (!child->d_inode) { + /* all remaining children are negative */ + if (d_is_tail_negative(child)) + break; continue; + } spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED); if (watched)