aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify
diff options
context:
space:
mode:
Diffstat (limited to 'fs/notify')
-rw-r--r--fs/notify/fanotify/fanotify_user.c8
-rw-r--r--fs/notify/fsnotify.c3
2 files changed, 4 insertions, 7 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 3568c8a8b138..d43803669739 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -61,8 +61,6 @@ static struct fsnotify_event *get_one_event(struct fsnotify_group *group,
61static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event) 61static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event)
62{ 62{
63 int client_fd; 63 int client_fd;
64 struct dentry *dentry;
65 struct vfsmount *mnt;
66 struct file *new_file; 64 struct file *new_file;
67 65
68 pr_debug("%s: group=%p event=%p\n", __func__, group, event); 66 pr_debug("%s: group=%p event=%p\n", __func__, group, event);
@@ -81,12 +79,10 @@ static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event)
81 * we need a new file handle for the userspace program so it can read even if it was 79 * we need a new file handle for the userspace program so it can read even if it was
82 * originally opened O_WRONLY. 80 * originally opened O_WRONLY.
83 */ 81 */
84 dentry = dget(event->path.dentry);
85 mnt = mntget(event->path.mnt);
86 /* it's possible this event was an overflow event. in that case dentry and mnt 82 /* it's possible this event was an overflow event. in that case dentry and mnt
87 * are NULL; That's fine, just don't call dentry open */ 83 * are NULL; That's fine, just don't call dentry open */
88 if (dentry && mnt) 84 if (event->path.dentry && event->path.mnt)
89 new_file = dentry_open(dentry, mnt, 85 new_file = dentry_open(&event->path,
90 group->fanotify_data.f_flags | FMODE_NONOTIFY, 86 group->fanotify_data.f_flags | FMODE_NONOTIFY,
91 current_cred()); 87 current_cred());
92 else 88 else
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index b39c5c161adb..6baadb5a8430 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -52,6 +52,7 @@ void __fsnotify_vfsmount_delete(struct vfsmount *mnt)
52void __fsnotify_update_child_dentry_flags(struct inode *inode) 52void __fsnotify_update_child_dentry_flags(struct inode *inode)
53{ 53{
54 struct dentry *alias; 54 struct dentry *alias;
55 struct hlist_node *p;
55 int watched; 56 int watched;
56 57
57 if (!S_ISDIR(inode->i_mode)) 58 if (!S_ISDIR(inode->i_mode))
@@ -63,7 +64,7 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
63 spin_lock(&inode->i_lock); 64 spin_lock(&inode->i_lock);
64 /* run all of the dentries associated with this inode. Since this is a 65 /* run all of the dentries associated with this inode. Since this is a
65 * directory, there damn well better only be one item on this list */ 66 * directory, there damn well better only be one item on this list */
66 list_for_each_entry(alias, &inode->i_dentry, d_alias) { 67 hlist_for_each_entry(alias, p, &inode->i_dentry, d_alias) {
67 struct dentry *child; 68 struct dentry *child;
68 69
69 /* run all of the children of the original inode and fix their 70 /* run all of the children of the original inode and fix their