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 /fs/notify/inotify | |
| 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>
Diffstat (limited to 'fs/notify/inotify')
| -rw-r--r-- | fs/notify/inotify/inotify_fsnotify.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c index 73a1106b354..3c506e0364c 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 | ||
