Skip to content

Commit

Permalink
devpts: add fsnotify create event
Browse files Browse the repository at this point in the history
Currently, devpts doesn't generate an fsnotify event upon pts creation
because the regular vfs paths aren't involved.  Deallocation, on the other
hand, correctly generates a nameremove event thanks to the d_delete()
invocation in devpts_pty_kill().

This patch adds the missing fsnotify_create() trigger in devpts_pty_new().

Signed-off-by: Florin Malita <fmalita@gmail.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Florin Malita authored and Linus Torvalds committed May 8, 2007
1 parent 1ae7075 commit 3972b7f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/tty.h>
#include <linux/devpts_fs.h>
#include <linux/parser.h>
#include <linux/fsnotify.h>

#define DEVPTS_SUPER_MAGIC 0x1cd1

Expand Down Expand Up @@ -178,8 +179,10 @@ int devpts_pty_new(struct tty_struct *tty)
inode->i_private = tty;

dentry = get_node(number);
if (!IS_ERR(dentry) && !dentry->d_inode)
if (!IS_ERR(dentry) && !dentry->d_inode) {
d_instantiate(dentry, inode);
fsnotify_create(devpts_root->d_inode, dentry);
}

mutex_unlock(&devpts_root->d_inode->i_mutex);

Expand Down

0 comments on commit 3972b7f

Please sign in to comment.