]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/notify/fsnotify.c
UBUNTU: Ubuntu-4.10.0-37.41
[mirror_ubuntu-zesty-kernel.git] / fs / notify / fsnotify.c
index b41515d3f0815246185b264532d71cc43824ef9a..6a2046c57e6368efd06df477e6761dd9bdf4f32e 100644 (file)
@@ -104,16 +104,20 @@ int __fsnotify_parent(const struct path *path, struct dentry *dentry, __u32 mask
        if (unlikely(!fsnotify_inode_watches_children(p_inode)))
                __fsnotify_update_child_dentry_flags(p_inode);
        else if (p_inode->i_fsnotify_mask & mask) {
+               struct name_snapshot name;
+
                /* we are notifying a parent so come up with the new mask which
                 * specifies these are events which came from a child. */
                mask |= FS_EVENT_ON_CHILD;
 
+               take_dentry_name_snapshot(&name, dentry);
                if (path)
                        ret = fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH,
-                                      dentry->d_name.name, 0);
+                                      name.name, 0);
                else
                        ret = fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE,
-                                      dentry->d_name.name, 0);
+                                      name.name, 0);
+               release_dentry_name_snapshot(&name);
        }
 
        dput(parent);