diff options
author | Arnd Bergmann <arnd.bergmann@de.ibm.com> | 2006-04-11 01:54:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:18:45 -0400 |
commit | 091e881d0e55496d8887b61446ae1c598b0995b6 (patch) | |
tree | 359de08690a236593f4a24727fc060f7adc0993c | |
parent | 68250ba5df4c9d00d3064a0ba9a894035436916b (diff) |
[PATCH] inotify: check for NULL inode in inotify_d_instantiate
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.
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Acked-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | fs/inotify.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/inotify.c b/fs/inotify.c index 367c487c014b..1f50302849c5 100644 --- a/fs/inotify.c +++ b/fs/inotify.c | |||
@@ -538,7 +538,7 @@ void inotify_d_instantiate(struct dentry *entry, struct inode *inode) | |||
538 | WARN_ON(entry->d_flags & DCACHE_INOTIFY_PARENT_WATCHED); | 538 | WARN_ON(entry->d_flags & DCACHE_INOTIFY_PARENT_WATCHED); |
539 | spin_lock(&entry->d_lock); | 539 | spin_lock(&entry->d_lock); |
540 | parent = entry->d_parent; | 540 | parent = entry->d_parent; |
541 | if (inotify_inode_watched(parent->d_inode)) | 541 | if (parent->d_inode && inotify_inode_watched(parent->d_inode)) |
542 | entry->d_flags |= DCACHE_INOTIFY_PARENT_WATCHED; | 542 | entry->d_flags |= DCACHE_INOTIFY_PARENT_WATCHED; |
543 | spin_unlock(&entry->d_lock); | 543 | spin_unlock(&entry->d_lock); |
544 | } | 544 | } |