From: Sergey Vlasov Date: Mon, 12 Jun 2006 20:53:23 +0000 (+0100) Subject: [PATCH] tmpfs: Decrement i_nlink correctly in shmem_rmdir() X-Git-Tag: v2.6.17~17 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=86bc843a268058df558844b6bf64531617fbc698;p=~shefty%2Frdma-dev.git [PATCH] tmpfs: Decrement i_nlink correctly in shmem_rmdir() shmem_rmdir() must undo the increment of i_nlink done in shmem_get_inode() for directories, otherwise at least IN_DELETE_SELF inotify event generation is broken. Signed-off-by: Sergey Vlasov Signed-off-by: Hugh Dickins Signed-off-by: Linus Torvalds --- diff --git a/mm/shmem.c b/mm/shmem.c index 73f7a9dfcd3..1e43c8a865b 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -1780,6 +1780,7 @@ static int shmem_rmdir(struct inode *dir, struct dentry *dentry) if (!simple_empty(dentry)) return -ENOTEMPTY; + dentry->d_inode->i_nlink--; dir->i_nlink--; return shmem_unlink(dir, dentry); }