Skip to content

Commit

Permalink
[PATCH] tmpfs: Decrement i_nlink correctly in shmem_rmdir()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sergey Vlasov authored and Linus Torvalds committed Jun 12, 2006
1 parent cfd95a9 commit 86bc843
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 86bc843

Please sign in to comment.