projects/linux·commit 86bc843a

[PATCH] tmpfs: Decrement i_nlink correctly in shmem_rmdir()

86bc843a · Sergey Vlasov <[email protected]> · 2006-06-12 21:53:23 +01:00

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 <[email protected]>
Signed-off-by: Hugh Dickins <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
86bc843a268058df558844b6bf64531617fbc698
Parents
cfd95a9c

Changes

1 files changed · +1 −0

FileStatusAddDelContent
mm/shmem.cmodified+1−0View file

mm/shmem.c

View file
diff --git a/mm/shmem.c b/mm/shmem.c
index 73f7a9d..1e43c8a 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);
}