diff options
-rw-r--r-- | fs/notify/fanotify/fanotify.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index 60c11c306fd9..8d98e1f5817b 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c | |||
@@ -160,20 +160,21 @@ static bool fanotify_should_send_event(struct fsnotify_group *group, | |||
160 | __u32 event_mask, void *data, int data_type) | 160 | __u32 event_mask, void *data, int data_type) |
161 | { | 161 | { |
162 | __u32 marks_mask, marks_ignored_mask; | 162 | __u32 marks_mask, marks_ignored_mask; |
163 | struct path *path = data; | ||
163 | 164 | ||
164 | pr_debug("%s: group=%p to_tell=%p inode_mark=%p vfsmnt_mark=%p " | 165 | pr_debug("%s: group=%p to_tell=%p inode_mark=%p vfsmnt_mark=%p " |
165 | "mask=%x data=%p data_type=%d\n", __func__, group, to_tell, | 166 | "mask=%x data=%p data_type=%d\n", __func__, group, to_tell, |
166 | inode_mark, vfsmnt_mark, event_mask, data, data_type); | 167 | inode_mark, vfsmnt_mark, event_mask, data, data_type); |
167 | 168 | ||
168 | /* sorry, fanotify only gives a damn about files and dirs */ | ||
169 | if (!S_ISREG(to_tell->i_mode) && | ||
170 | !S_ISDIR(to_tell->i_mode)) | ||
171 | return false; | ||
172 | |||
173 | /* if we don't have enough info to send an event to userspace say no */ | 169 | /* if we don't have enough info to send an event to userspace say no */ |
174 | if (data_type != FSNOTIFY_EVENT_PATH) | 170 | if (data_type != FSNOTIFY_EVENT_PATH) |
175 | return false; | 171 | return false; |
176 | 172 | ||
173 | /* sorry, fanotify only gives a damn about files and dirs */ | ||
174 | if (!S_ISREG(path->dentry->d_inode->i_mode) && | ||
175 | !S_ISDIR(path->dentry->d_inode->i_mode)) | ||
176 | return false; | ||
177 | |||
177 | if (inode_mark && vfsmnt_mark) { | 178 | if (inode_mark && vfsmnt_mark) { |
178 | marks_mask = (vfsmnt_mark->mask | inode_mark->mask); | 179 | marks_mask = (vfsmnt_mark->mask | inode_mark->mask); |
179 | marks_ignored_mask = (vfsmnt_mark->ignored_mask | inode_mark->ignored_mask); | 180 | marks_ignored_mask = (vfsmnt_mark->ignored_mask | inode_mark->ignored_mask); |