diff options
author | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:37 -0400 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 10:18:51 -0400 |
commit | 3bcf3860a4ff9bbc522820b4b765e65e4deceb3e (patch) | |
tree | 1e235af133559062c6fdee840ff9698f1dee26a6 | |
parent | f70ab54cc6c3907b0727ba332b3976f80f3846d0 (diff) |
fsnotify: store struct file not struct path
Al explains that calling dentry_open() with a mnt/dentry pair is only
garunteed to be safe if they are already used in an open struct file. To
make sure this is the case don't store and use a struct path in fsnotify,
always use a struct file.
Signed-off-by: Eric Paris <eparis@redhat.com>
-rw-r--r-- | fs/notify/fanotify/fanotify.c | 8 | ||||
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 6 | ||||
-rw-r--r-- | fs/notify/fsnotify.c | 16 | ||||
-rw-r--r-- | fs/notify/inotify/inotify_fsnotify.c | 12 | ||||
-rw-r--r-- | fs/notify/notification.c | 20 | ||||
-rw-r--r-- | include/linux/fsnotify.h | 37 | ||||
-rw-r--r-- | include/linux/fsnotify_backend.h | 16 | ||||
-rw-r--r-- | kernel/audit_watch.c | 4 |
8 files changed, 56 insertions, 63 deletions
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index f3c40c0e2b86..c2a3029052bc 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c | |||
@@ -17,9 +17,9 @@ static bool should_merge(struct fsnotify_event *old, struct fsnotify_event *new) | |||
17 | old->data_type == new->data_type && | 17 | old->data_type == new->data_type && |
18 | old->tgid == new->tgid) { | 18 | old->tgid == new->tgid) { |
19 | switch (old->data_type) { | 19 | switch (old->data_type) { |
20 | case (FSNOTIFY_EVENT_PATH): | 20 | case (FSNOTIFY_EVENT_FILE): |
21 | if ((old->path.mnt == new->path.mnt) && | 21 | if ((old->file->f_path.mnt == new->file->f_path.mnt) && |
22 | (old->path.dentry == new->path.dentry)) | 22 | (old->file->f_path.dentry == new->file->f_path.dentry)) |
23 | return true; | 23 | return true; |
24 | case (FSNOTIFY_EVENT_NONE): | 24 | case (FSNOTIFY_EVENT_NONE): |
25 | return true; | 25 | return true; |
@@ -226,7 +226,7 @@ static bool fanotify_should_send_event(struct fsnotify_group *group, struct inod | |||
226 | return false; | 226 | return false; |
227 | 227 | ||
228 | /* if we don't have enough info to send an event to userspace say no */ | 228 | /* if we don't have enough info to send an event to userspace say no */ |
229 | if (data_type != FSNOTIFY_EVENT_PATH) | 229 | if (data_type != FSNOTIFY_EVENT_FILE) |
230 | return false; | 230 | return false; |
231 | 231 | ||
232 | if (mnt) | 232 | if (mnt) |
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 7182c83be90e..50cea74bf1c8 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -65,7 +65,7 @@ static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event) | |||
65 | if (client_fd < 0) | 65 | if (client_fd < 0) |
66 | return client_fd; | 66 | return client_fd; |
67 | 67 | ||
68 | if (event->data_type != FSNOTIFY_EVENT_PATH) { | 68 | if (event->data_type != FSNOTIFY_EVENT_FILE) { |
69 | WARN_ON(1); | 69 | WARN_ON(1); |
70 | put_unused_fd(client_fd); | 70 | put_unused_fd(client_fd); |
71 | return -EINVAL; | 71 | return -EINVAL; |
@@ -75,8 +75,8 @@ static int create_fd(struct fsnotify_group *group, struct fsnotify_event *event) | |||
75 | * we need a new file handle for the userspace program so it can read even if it was | 75 | * we need a new file handle for the userspace program so it can read even if it was |
76 | * originally opened O_WRONLY. | 76 | * originally opened O_WRONLY. |
77 | */ | 77 | */ |
78 | dentry = dget(event->path.dentry); | 78 | dentry = dget(event->file->f_path.dentry); |
79 | mnt = mntget(event->path.mnt); | 79 | mnt = mntget(event->file->f_path.mnt); |
80 | /* it's possible this event was an overflow event. in that case dentry and mnt | 80 | /* it's possible this event was an overflow event. in that case dentry and mnt |
81 | * are NULL; That's fine, just don't call dentry open */ | 81 | * are NULL; That's fine, just don't call dentry open */ |
82 | if (dentry && mnt) | 82 | if (dentry && mnt) |
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c index 72aae4045314..4788c866473a 100644 --- a/fs/notify/fsnotify.c +++ b/fs/notify/fsnotify.c | |||
@@ -84,7 +84,7 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode) | |||
84 | } | 84 | } |
85 | 85 | ||
86 | /* Notify this dentry's parent about a child's events. */ | 86 | /* Notify this dentry's parent about a child's events. */ |
87 | void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 87 | void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) |
88 | { | 88 | { |
89 | struct dentry *parent; | 89 | struct dentry *parent; |
90 | struct inode *p_inode; | 90 | struct inode *p_inode; |
@@ -92,7 +92,7 @@ void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | |||
92 | bool should_update_children = false; | 92 | bool should_update_children = false; |
93 | 93 | ||
94 | if (!dentry) | 94 | if (!dentry) |
95 | dentry = path->dentry; | 95 | dentry = file->f_path.dentry; |
96 | 96 | ||
97 | if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED)) | 97 | if (!(dentry->d_flags & DCACHE_FSNOTIFY_PARENT_WATCHED)) |
98 | return; | 98 | return; |
@@ -124,8 +124,8 @@ void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | |||
124 | * specifies these are events which came from a child. */ | 124 | * specifies these are events which came from a child. */ |
125 | mask |= FS_EVENT_ON_CHILD; | 125 | mask |= FS_EVENT_ON_CHILD; |
126 | 126 | ||
127 | if (path) | 127 | if (file) |
128 | fsnotify(p_inode, mask, path, FSNOTIFY_EVENT_PATH, | 128 | fsnotify(p_inode, mask, file, FSNOTIFY_EVENT_FILE, |
129 | dentry->d_name.name, 0); | 129 | dentry->d_name.name, 0); |
130 | else | 130 | else |
131 | fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, | 131 | fsnotify(p_inode, mask, dentry->d_inode, FSNOTIFY_EVENT_INODE, |
@@ -154,10 +154,10 @@ void __fsnotify_flush_ignored_mask(struct inode *inode, void *data, int data_is) | |||
154 | spin_unlock(&inode->i_lock); | 154 | spin_unlock(&inode->i_lock); |
155 | } | 155 | } |
156 | 156 | ||
157 | if (data_is == FSNOTIFY_EVENT_PATH) { | 157 | if (data_is == FSNOTIFY_EVENT_FILE) { |
158 | struct vfsmount *mnt; | 158 | struct vfsmount *mnt; |
159 | 159 | ||
160 | mnt = ((struct path *)data)->mnt; | 160 | mnt = ((struct file *)data)->f_path.mnt; |
161 | if (mnt && !hlist_empty(&mnt->mnt_fsnotify_marks)) { | 161 | if (mnt && !hlist_empty(&mnt->mnt_fsnotify_marks)) { |
162 | spin_lock(&mnt->mnt_root->d_lock); | 162 | spin_lock(&mnt->mnt_root->d_lock); |
163 | hlist_for_each_entry(mark, node, &mnt->mnt_fsnotify_marks, m.m_list) { | 163 | hlist_for_each_entry(mark, node, &mnt->mnt_fsnotify_marks, m.m_list) { |
@@ -228,8 +228,8 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | |||
228 | !(test_mask & fsnotify_vfsmount_mask)) | 228 | !(test_mask & fsnotify_vfsmount_mask)) |
229 | return 0; | 229 | return 0; |
230 | 230 | ||
231 | if (data_is == FSNOTIFY_EVENT_PATH) | 231 | if (data_is == FSNOTIFY_EVENT_FILE) |
232 | mnt = ((struct path *)data)->mnt; | 232 | mnt = ((struct file *)data)->f_path.mnt; |
233 | 233 | ||
234 | /* if this inode's directed listeners don't care and nothing on the vfsmount | 234 | /* if this inode's directed listeners don't care and nothing on the vfsmount |
235 | * listeners list cares, nothing to do */ | 235 | * listeners list cares, nothing to do */ |
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c index 73a1106b3542..3c506e0364cc 100644 --- a/fs/notify/inotify/inotify_fsnotify.c +++ b/fs/notify/inotify/inotify_fsnotify.c | |||
@@ -52,9 +52,9 @@ static bool event_compare(struct fsnotify_event *old, struct fsnotify_event *new | |||
52 | !strcmp(old->file_name, new->file_name)) | 52 | !strcmp(old->file_name, new->file_name)) |
53 | return true; | 53 | return true; |
54 | break; | 54 | break; |
55 | case (FSNOTIFY_EVENT_PATH): | 55 | case (FSNOTIFY_EVENT_FILE): |
56 | if ((old->path.mnt == new->path.mnt) && | 56 | if ((old->file->f_path.mnt == new->file->f_path.mnt) && |
57 | (old->path.dentry == new->path.dentry)) | 57 | (old->file->f_path.dentry == new->file->f_path.dentry)) |
58 | return true; | 58 | return true; |
59 | break; | 59 | break; |
60 | case (FSNOTIFY_EVENT_NONE): | 60 | case (FSNOTIFY_EVENT_NONE): |
@@ -165,10 +165,10 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode | |||
165 | send = (fsn_mark->mask & mask); | 165 | send = (fsn_mark->mask & mask); |
166 | 166 | ||
167 | if (send && (fsn_mark->mask & FS_EXCL_UNLINK) && | 167 | if (send && (fsn_mark->mask & FS_EXCL_UNLINK) && |
168 | (data_type == FSNOTIFY_EVENT_PATH)) { | 168 | (data_type == FSNOTIFY_EVENT_FILE)) { |
169 | struct path *path = data; | 169 | struct file *file = data; |
170 | 170 | ||
171 | if (d_unlinked(path->dentry)) | 171 | if (d_unlinked(file->f_path.dentry)) |
172 | send = false; | 172 | send = false; |
173 | } | 173 | } |
174 | 174 | ||
diff --git a/fs/notify/notification.c b/fs/notify/notification.c index f39260f8f865..c106cdd7ff5e 100644 --- a/fs/notify/notification.c +++ b/fs/notify/notification.c | |||
@@ -31,6 +31,7 @@ | |||
31 | * allocated and used. | 31 | * allocated and used. |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <linux/file.h> | ||
34 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
35 | #include <linux/init.h> | 36 | #include <linux/init.h> |
36 | #include <linux/kernel.h> | 37 | #include <linux/kernel.h> |
@@ -89,8 +90,8 @@ void fsnotify_put_event(struct fsnotify_event *event) | |||
89 | if (atomic_dec_and_test(&event->refcnt)) { | 90 | if (atomic_dec_and_test(&event->refcnt)) { |
90 | pr_debug("%s: event=%p\n", __func__, event); | 91 | pr_debug("%s: event=%p\n", __func__, event); |
91 | 92 | ||
92 | if (event->data_type == FSNOTIFY_EVENT_PATH) | 93 | if (event->data_type == FSNOTIFY_EVENT_FILE) |
93 | path_put(&event->path); | 94 | fput(event->file); |
94 | 95 | ||
95 | BUG_ON(!list_empty(&event->private_data_list)); | 96 | BUG_ON(!list_empty(&event->private_data_list)); |
96 | 97 | ||
@@ -375,8 +376,8 @@ struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event) | |||
375 | } | 376 | } |
376 | } | 377 | } |
377 | event->tgid = get_pid(old_event->tgid); | 378 | event->tgid = get_pid(old_event->tgid); |
378 | if (event->data_type == FSNOTIFY_EVENT_PATH) | 379 | if (event->data_type == FSNOTIFY_EVENT_FILE) |
379 | path_get(&event->path); | 380 | get_file(event->file); |
380 | 381 | ||
381 | return event; | 382 | return event; |
382 | } | 383 | } |
@@ -423,11 +424,9 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | |||
423 | event->data_type = data_type; | 424 | event->data_type = data_type; |
424 | 425 | ||
425 | switch (data_type) { | 426 | switch (data_type) { |
426 | case FSNOTIFY_EVENT_PATH: { | 427 | case FSNOTIFY_EVENT_FILE: { |
427 | struct path *path = data; | 428 | event->file = data; |
428 | event->path.dentry = path->dentry; | 429 | get_file(event->file); |
429 | event->path.mnt = path->mnt; | ||
430 | path_get(&event->path); | ||
431 | break; | 430 | break; |
432 | } | 431 | } |
433 | case FSNOTIFY_EVENT_INODE: | 432 | case FSNOTIFY_EVENT_INODE: |
@@ -435,8 +434,7 @@ struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | |||
435 | break; | 434 | break; |
436 | case FSNOTIFY_EVENT_NONE: | 435 | case FSNOTIFY_EVENT_NONE: |
437 | event->inode = NULL; | 436 | event->inode = NULL; |
438 | event->path.dentry = NULL; | 437 | event->file = NULL; |
439 | event->path.mnt = NULL; | ||
440 | break; | 438 | break; |
441 | default: | 439 | default: |
442 | BUG(); | 440 | BUG(); |
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h index 59d0df43ff9d..e4e2204187ee 100644 --- a/include/linux/fsnotify.h +++ b/include/linux/fsnotify.h | |||
@@ -26,19 +26,18 @@ static inline void fsnotify_d_instantiate(struct dentry *dentry, | |||
26 | } | 26 | } |
27 | 27 | ||
28 | /* Notify this dentry's parent about a child's events. */ | 28 | /* Notify this dentry's parent about a child's events. */ |
29 | static inline void fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 29 | static inline void fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) |
30 | { | 30 | { |
31 | if (!dentry) | 31 | if (!dentry) |
32 | dentry = path->dentry; | 32 | dentry = file->f_path.dentry; |
33 | 33 | ||
34 | __fsnotify_parent(path, dentry, mask); | 34 | __fsnotify_parent(file, dentry, mask); |
35 | } | 35 | } |
36 | 36 | ||
37 | /* simple call site for access decisions */ | 37 | /* simple call site for access decisions */ |
38 | static inline int fsnotify_perm(struct file *file, int mask) | 38 | static inline int fsnotify_perm(struct file *file, int mask) |
39 | { | 39 | { |
40 | struct path *path = &file->f_path; | 40 | struct inode *inode = file->f_path.dentry->d_inode; |
41 | struct inode *inode = path->dentry->d_inode; | ||
42 | __u32 fsnotify_mask = 0; | 41 | __u32 fsnotify_mask = 0; |
43 | 42 | ||
44 | if (file->f_mode & FMODE_NONOTIFY) | 43 | if (file->f_mode & FMODE_NONOTIFY) |
@@ -52,7 +51,7 @@ static inline int fsnotify_perm(struct file *file, int mask) | |||
52 | else | 51 | else |
53 | BUG(); | 52 | BUG(); |
54 | 53 | ||
55 | return fsnotify(inode, fsnotify_mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 54 | return fsnotify(inode, fsnotify_mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
56 | } | 55 | } |
57 | 56 | ||
58 | /* | 57 | /* |
@@ -187,16 +186,15 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry) | |||
187 | */ | 186 | */ |
188 | static inline void fsnotify_access(struct file *file) | 187 | static inline void fsnotify_access(struct file *file) |
189 | { | 188 | { |
190 | struct path *path = &file->f_path; | 189 | struct inode *inode = file->f_path.dentry->d_inode; |
191 | struct inode *inode = path->dentry->d_inode; | ||
192 | __u32 mask = FS_ACCESS; | 190 | __u32 mask = FS_ACCESS; |
193 | 191 | ||
194 | if (S_ISDIR(inode->i_mode)) | 192 | if (S_ISDIR(inode->i_mode)) |
195 | mask |= FS_IN_ISDIR; | 193 | mask |= FS_IN_ISDIR; |
196 | 194 | ||
197 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 195 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
198 | fsnotify_parent(path, NULL, mask); | 196 | fsnotify_parent(file, NULL, mask); |
199 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 197 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
200 | } | 198 | } |
201 | } | 199 | } |
202 | 200 | ||
@@ -205,16 +203,15 @@ static inline void fsnotify_access(struct file *file) | |||
205 | */ | 203 | */ |
206 | static inline void fsnotify_modify(struct file *file) | 204 | static inline void fsnotify_modify(struct file *file) |
207 | { | 205 | { |
208 | struct path *path = &file->f_path; | 206 | struct inode *inode = file->f_path.dentry->d_inode; |
209 | struct inode *inode = path->dentry->d_inode; | ||
210 | __u32 mask = FS_MODIFY; | 207 | __u32 mask = FS_MODIFY; |
211 | 208 | ||
212 | if (S_ISDIR(inode->i_mode)) | 209 | if (S_ISDIR(inode->i_mode)) |
213 | mask |= FS_IN_ISDIR; | 210 | mask |= FS_IN_ISDIR; |
214 | 211 | ||
215 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 212 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
216 | fsnotify_parent(path, NULL, mask); | 213 | fsnotify_parent(file, NULL, mask); |
217 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 214 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
218 | } | 215 | } |
219 | } | 216 | } |
220 | 217 | ||
@@ -223,16 +220,15 @@ static inline void fsnotify_modify(struct file *file) | |||
223 | */ | 220 | */ |
224 | static inline void fsnotify_open(struct file *file) | 221 | static inline void fsnotify_open(struct file *file) |
225 | { | 222 | { |
226 | struct path *path = &file->f_path; | 223 | struct inode *inode = file->f_path.dentry->d_inode; |
227 | struct inode *inode = path->dentry->d_inode; | ||
228 | __u32 mask = FS_OPEN; | 224 | __u32 mask = FS_OPEN; |
229 | 225 | ||
230 | if (S_ISDIR(inode->i_mode)) | 226 | if (S_ISDIR(inode->i_mode)) |
231 | mask |= FS_IN_ISDIR; | 227 | mask |= FS_IN_ISDIR; |
232 | 228 | ||
233 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 229 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
234 | fsnotify_parent(path, NULL, mask); | 230 | fsnotify_parent(file, NULL, mask); |
235 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 231 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
236 | } | 232 | } |
237 | } | 233 | } |
238 | 234 | ||
@@ -241,7 +237,6 @@ static inline void fsnotify_open(struct file *file) | |||
241 | */ | 237 | */ |
242 | static inline void fsnotify_close(struct file *file) | 238 | static inline void fsnotify_close(struct file *file) |
243 | { | 239 | { |
244 | struct path *path = &file->f_path; | ||
245 | struct inode *inode = file->f_path.dentry->d_inode; | 240 | struct inode *inode = file->f_path.dentry->d_inode; |
246 | fmode_t mode = file->f_mode; | 241 | fmode_t mode = file->f_mode; |
247 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; | 242 | __u32 mask = (mode & FMODE_WRITE) ? FS_CLOSE_WRITE : FS_CLOSE_NOWRITE; |
@@ -250,8 +245,8 @@ static inline void fsnotify_close(struct file *file) | |||
250 | mask |= FS_IN_ISDIR; | 245 | mask |= FS_IN_ISDIR; |
251 | 246 | ||
252 | if (!(file->f_mode & FMODE_NONOTIFY)) { | 247 | if (!(file->f_mode & FMODE_NONOTIFY)) { |
253 | fsnotify_parent(path, NULL, mask); | 248 | fsnotify_parent(file, NULL, mask); |
254 | fsnotify(inode, mask, path, FSNOTIFY_EVENT_PATH, NULL, 0); | 249 | fsnotify(inode, mask, file, FSNOTIFY_EVENT_FILE, NULL, 0); |
255 | } | 250 | } |
256 | } | 251 | } |
257 | 252 | ||
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 564b5ea4a831..3410d388163e 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -223,20 +223,20 @@ struct fsnotify_event { | |||
223 | /* to_tell may ONLY be dereferenced during handle_event(). */ | 223 | /* to_tell may ONLY be dereferenced during handle_event(). */ |
224 | struct inode *to_tell; /* either the inode the event happened to or its parent */ | 224 | struct inode *to_tell; /* either the inode the event happened to or its parent */ |
225 | /* | 225 | /* |
226 | * depending on the event type we should have either a path or inode | 226 | * depending on the event type we should have either a file or inode |
227 | * We hold a reference on path, but NOT on inode. Since we have the ref on | 227 | * We hold a reference on file, but NOT on inode. Since we have the ref on |
228 | * the path, it may be dereferenced at any point during this object's | 228 | * the file, it may be dereferenced at any point during this object's |
229 | * lifetime. That reference is dropped when this object's refcnt hits | 229 | * lifetime. That reference is dropped when this object's refcnt hits |
230 | * 0. If this event contains an inode instead of a path, the inode may | 230 | * 0. If this event contains an inode instead of a file, the inode may |
231 | * ONLY be used during handle_event(). | 231 | * ONLY be used during handle_event(). |
232 | */ | 232 | */ |
233 | union { | 233 | union { |
234 | struct path path; | 234 | struct file *file; |
235 | struct inode *inode; | 235 | struct inode *inode; |
236 | }; | 236 | }; |
237 | /* when calling fsnotify tell it if the data is a path or inode */ | 237 | /* when calling fsnotify tell it if the data is a path or inode */ |
238 | #define FSNOTIFY_EVENT_NONE 0 | 238 | #define FSNOTIFY_EVENT_NONE 0 |
239 | #define FSNOTIFY_EVENT_PATH 1 | 239 | #define FSNOTIFY_EVENT_FILE 1 |
240 | #define FSNOTIFY_EVENT_INODE 2 | 240 | #define FSNOTIFY_EVENT_INODE 2 |
241 | int data_type; /* which of the above union we have */ | 241 | int data_type; /* which of the above union we have */ |
242 | atomic_t refcnt; /* how many groups still are using/need to send this event */ | 242 | atomic_t refcnt; /* how many groups still are using/need to send this event */ |
@@ -311,7 +311,7 @@ struct fsnotify_mark { | |||
311 | /* main fsnotify call to send events */ | 311 | /* main fsnotify call to send events */ |
312 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, | 312 | extern int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is, |
313 | const unsigned char *name, u32 cookie); | 313 | const unsigned char *name, u32 cookie); |
314 | extern void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask); | 314 | extern void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask); |
315 | extern void __fsnotify_inode_delete(struct inode *inode); | 315 | extern void __fsnotify_inode_delete(struct inode *inode); |
316 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); | 316 | extern void __fsnotify_vfsmount_delete(struct vfsmount *mnt); |
317 | extern u32 fsnotify_get_cookie(void); | 317 | extern u32 fsnotify_get_cookie(void); |
@@ -444,7 +444,7 @@ static inline int fsnotify(struct inode *to_tell, __u32 mask, void *data, int da | |||
444 | return 0; | 444 | return 0; |
445 | } | 445 | } |
446 | 446 | ||
447 | static inline void __fsnotify_parent(struct path *path, struct dentry *dentry, __u32 mask) | 447 | static inline void __fsnotify_parent(struct file *file, struct dentry *dentry, __u32 mask) |
448 | {} | 448 | {} |
449 | 449 | ||
450 | static inline void __fsnotify_inode_delete(struct inode *inode) | 450 | static inline void __fsnotify_inode_delete(struct inode *inode) |
diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c index 7499397a6100..b955a22d8ff1 100644 --- a/kernel/audit_watch.c +++ b/kernel/audit_watch.c | |||
@@ -545,8 +545,8 @@ static int audit_watch_handle_event(struct fsnotify_group *group, struct fsnotif | |||
545 | return 0; | 545 | return 0; |
546 | 546 | ||
547 | switch (event->data_type) { | 547 | switch (event->data_type) { |
548 | case (FSNOTIFY_EVENT_PATH): | 548 | case (FSNOTIFY_EVENT_FILE): |
549 | inode = event->path.dentry->d_inode; | 549 | inode = event->file->f_path.dentry->d_inode; |
550 | break; | 550 | break; |
551 | case (FSNOTIFY_EVENT_INODE): | 551 | case (FSNOTIFY_EVENT_INODE): |
552 | inode = event->inode; | 552 | inode = event->inode; |