mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Sergey Vlasov <vsu@altlinux.ru>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH] tmpfs: Decrement i_nlink correctly in shmem_rmdir()
Date: Mon, 12 Jun 2006 20:10:47 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0606121957580.18760@blonde.wat.veritas.com> (raw)
In-Reply-To: <11501251772137-git-send-email-vsu@altlinux.ru>

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
> 

       reply	other threads:[~2006-06-12 19:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11501251772137-git-send-email-vsu@altlinux.ru>
2006-06-12 19:10 ` Hugh Dickins [this message]
2006-06-12 20:53   ` Hugh Dickins

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0606121957580.18760@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=vsu@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®