All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>,
	cbe-oss-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] inotify: check for NULL inode in inotify_d_instantiate
Date: Sat, 8 Apr 2006 05:06:10 +0200	[thread overview]
Message-ID: <20060408030610.GC20724@wotan.suse.de> (raw)
In-Reply-To: <200604071808.41953.arnd.bergmann@de.ibm.com>

On Fri, Apr 07, 2006 at 06:08:41PM +0200, Arnd Bergmann wrote:
> The spufs file system creates files in a directory before instantiating
> the directory itself, which causes a NULL pointer access in
> inotify_d_instantiate since c32ccd87bfd1414b0aabfcd8dbc7539ad23bcbaa.
> 
> I'd like to keep this behavior since it means that the user
> will not have access to files in the directory before I know
> that I succeed in creating everything in it. This patch adds
> a simple check for the inode to keep that working.
> 

If this were not the correct thing to do, it is not the
business of c32ccd87bfd1414b0aabfcd8dbc7539ad23bcbaa to
prevent it. Thanks.

Acked-by: Nick Piggin <npiggin@suse.de>


> Cc: Nick Piggin <npiggin@suse.de>
> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
> ---
> 
> diff --git a/fs/inotify.c b/fs/inotify.c
> index 367c487..1f50302 100644
> --- a/fs/inotify.c
> +++ b/fs/inotify.c
> @@ -538,7 +538,7 @@ void inotify_d_instantiate(struct dentry
>  	WARN_ON(entry->d_flags & DCACHE_INOTIFY_PARENT_WATCHED);
>  	spin_lock(&entry->d_lock);
>  	parent = entry->d_parent;
> -	if (inotify_inode_watched(parent->d_inode))
> +	if (parent->d_inode && inotify_inode_watched(parent->d_inode))
>  		entry->d_flags |= DCACHE_INOTIFY_PARENT_WATCHED;
>  	spin_unlock(&entry->d_lock);
>  }

      reply	other threads:[~2006-04-08  3:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-07 16:08 [PATCH] inotify: check for NULL inode in inotify_d_instantiate Arnd Bergmann
2006-04-08  3:06 ` Nick Piggin [this message]

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=20060408030610.GC20724@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=arnd.bergmann@de.ibm.com \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.