When we do rm foo.bar, kernel decrements inode ref count and checks if it's become zero. In case of 0, inode is removed and foo.bar dentry becomes negative. This negative dentry continues to stay in dentry cache to speed up further look up of foo.bar. My question: Shouldn't it be like: Irrespective of inode ref count, foo.bar dentry should become negative as name is no longer existing ?
Negative dentry
linux;filesystems;linux kernel