devpts: call fsnotify_unlink() hook [Linux 5.3]

This Linux kernel change "devpts: call fsnotify_unlink() hook" is included in the Linux 5.3 release. This change is authored by Amir Goldstein <amir73il [at] gmail.com> on Sun May 26 17:34:06 2019 +0300. The commit for this change in Linux stable tree is fd0d506 (patch).

devpts: call fsnotify_unlink() hook

This will allow generating fsnotify delete events after the
fsnotify_nameremove() hook is removed from d_delete().

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>

There is one line of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 fs/devpts/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 2c14ae0..beeadca 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -621,6 +621,7 @@ void devpts_pty_kill(struct dentry *dentry)

    dentry->d_fsdata = NULL;
    drop_nlink(dentry->d_inode);
+   fsnotify_unlink(d_inode(dentry->d_parent), dentry);
    d_delete(dentry);
    dput(dentry);   /* d_alloc_name() in devpts_pty_new() */
 }

Leave a Reply

Your email address will not be published. Required fields are marked *