Commit 3972b7f6 authored by Florin Malita's avatar Florin Malita Committed by Linus Torvalds

devpts: add fsnotify create event

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: default avatarFlorin Malita <fmalita@gmail.com>
Acked-by: default avatarH. Peter Anvin <hpa@zytor.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1ae7075b
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/devpts_fs.h> #include <linux/devpts_fs.h>
#include <linux/parser.h> #include <linux/parser.h>
#include <linux/fsnotify.h>
#define DEVPTS_SUPER_MAGIC 0x1cd1 #define DEVPTS_SUPER_MAGIC 0x1cd1
...@@ -178,8 +179,10 @@ int devpts_pty_new(struct tty_struct *tty) ...@@ -178,8 +179,10 @@ int devpts_pty_new(struct tty_struct *tty)
inode->i_private = tty; inode->i_private = tty;
dentry = get_node(number); dentry = get_node(number);
if (!IS_ERR(dentry) && !dentry->d_inode) if (!IS_ERR(dentry) && !dentry->d_inode) {
d_instantiate(dentry, inode); d_instantiate(dentry, inode);
fsnotify_create(devpts_root->d_inode, dentry);
}
mutex_unlock(&devpts_root->d_inode->i_mutex); mutex_unlock(&devpts_root->d_inode->i_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment