From: Linus Torvalds Date: Tue, 20 Sep 2005 02:54:29 +0000 (-0700) Subject: Make fsnotify possibly work better for the inode removal case X-Git-Tag: daily-2014.03.25.0_l4t/l4t-r19.1~51633 X-Git-Url: https://nv-tegra.nvidia.com/r/gitweb?p=linux-3.10.git;a=commitdiff_plain;h=f805fbdaacf4367ce566743a665622387768ac0d Make fsnotify possibly work better for the inode removal case Checking i_nlink is dubious, but the alternatives look even less appetizing. Signed-off-by: Linus Torvalds --- diff --git a/fs/dcache.c b/fs/dcache.c index 7376b61269f..fb10386c59b 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -102,7 +102,8 @@ static inline void dentry_iput(struct dentry * dentry) list_del_init(&dentry->d_alias); spin_unlock(&dentry->d_lock); spin_unlock(&dcache_lock); - fsnotify_inoderemove(inode); + if (!inode->i_nlink) + fsnotify_inoderemove(inode); if (dentry->d_op && dentry->d_op->d_iput) dentry->d_op->d_iput(dentry, inode); else