Browse Source

[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 <vsu@altlinux.ru>
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Sergey Vlasov 19 năm trước cách đây
mục cha
commit
86bc843a26
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      mm/shmem.c

+ 1 - 0
mm/shmem.c

@@ -1780,6 +1780,7 @@ static int shmem_rmdir(struct inode *dir, struct dentry *dentry)
 	if (!simple_empty(dentry))
 	if (!simple_empty(dentry))
 		return -ENOTEMPTY;
 		return -ENOTEMPTY;
 
 
+	dentry->d_inode->i_nlink--;
 	dir->i_nlink--;
 	dir->i_nlink--;
 	return shmem_unlink(dir, dentry);
 	return shmem_unlink(dir, dentry);
 }
 }