tmpfs: Decrement i_nlink correctly in shmem_rmdir()
Subsystems (3)
Quoted 5 lines · Sergey Vlasov
shmem_rmdir()must undo the increment ofi_nlinkdone inshmem_get_inode()for directories, otherwise at leastIN_DELETE_SELFinotify event generation is broken.Signed-off-by Sergey Vlasov <[email protected]>
Thanks: that is consistent with ramfs, seems correct and does no harm. Though I don't think it affects anything than the fsnotify_inoderemove i_nlink test in dentry_iput. I'm a little surprised by that test, unqualified to say whether that's the right place and way to make an inoderemove test; but even if it were not, I'd be silly to reject your fix. Thanks, I'll sign it off and send it onwards.
Hugh
Quoted 19 lines
--- mm/shmem.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)mm/shmem.c +1
-0@@ -1780,6 +1780,7 @@ static int shmem_rmdir(struct inode *dirif (!simple_empty (dentry))return -ENOTEMPTY ; + dentry->d_inode->i_nlink--; dir->i_nlink--;return shmem_unlink (dir, dentry); }Signature · 1 line
1.4.0.g1658
PATCH 1/1 tmpfs: Decrement i_nlink correctly in shmem_rmdir()
From: Sergey Vlasov <[email protected]>
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.
---
This can also be included in 2.6.17, though only inotify depends on it.
mm/shmem.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
mm/shmem.c +1 -0
@@ -1780,6 +1780,7 @@ static int shmem_rmdir(struct inode *dirif (!simple_empty (dentry))return -ENOTEMPTY ; + dentry->d_inode->i_nlink--; dir->i_nlink--;return shmem_unlink (dir, dentry); }