lkml.org 
[lkml]   [2006]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tmpfs: Decrement i_nlink correctly in shmem_rmdir()
On 12 June 2006, Sergey Vlasov wrote:

> 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>

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

> ---
> mm/shmem.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/mm/shmem.c b/mm/shmem.c
> index 4c5e68e..bd7bf49 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -1780,6 +1780,7 @@ static int shmem_rmdir(struct inode *dir
> if (!simple_empty(dentry))
> return -ENOTEMPTY;
>
> + dentry->d_inode->i_nlink--;
> dir->i_nlink--;
> return shmem_unlink(dir, dentry);
> }
> --
> 1.4.0.g1658
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-12 21:13    [W:0.824 / U:0.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site