diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2009-12-17 21:24:25 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2010-07-28 09:58:54 -0400 |
commit | 35566087099c3ff8901d65ee98af56347ee66e5a (patch) | |
tree | e4e56bcf787e5f100fa1ea0138c417e1203b10ae /fs/notify/inotify | |
parent | ef5e2b785fb3216269e6d0656d38ec286b98dbe5 (diff) |
fsnotify: take inode->i_lock inside fsnotify_find_mark_entry()
All callers to fsnotify_find_mark_entry() except one take and
release inode->i_lock around the call. Take the lock inside
fsnotify_find_mark_entry() instead.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'fs/notify/inotify')
-rw-r--r-- | fs/notify/inotify/inotify_fsnotify.c | 4 | ||||
-rw-r--r-- | fs/notify/inotify/inotify_user.c | 2 |
2 files changed, 0 insertions, 6 deletions
diff --git a/fs/notify/inotify/inotify_fsnotify.c b/fs/notify/inotify/inotify_fsnotify.c index 12dc72be992e..cc8f6bcbb4a3 100644 --- a/fs/notify/inotify/inotify_fsnotify.c +++ b/fs/notify/inotify/inotify_fsnotify.c | |||
@@ -97,9 +97,7 @@ static int inotify_handle_event(struct fsnotify_group *group, struct fsnotify_ev | |||
97 | 97 | ||
98 | to_tell = event->to_tell; | 98 | to_tell = event->to_tell; |
99 | 99 | ||
100 | spin_lock(&to_tell->i_lock); | ||
101 | fsn_mark = fsnotify_find_mark(group, to_tell); | 100 | fsn_mark = fsnotify_find_mark(group, to_tell); |
102 | spin_unlock(&to_tell->i_lock); | ||
103 | /* race with watch removal? We already passes should_send */ | 101 | /* race with watch removal? We already passes should_send */ |
104 | if (unlikely(!fsn_mark)) | 102 | if (unlikely(!fsn_mark)) |
105 | return 0; | 103 | return 0; |
@@ -147,9 +145,7 @@ static bool inotify_should_send_event(struct fsnotify_group *group, struct inode | |||
147 | struct fsnotify_mark *fsn_mark; | 145 | struct fsnotify_mark *fsn_mark; |
148 | bool send; | 146 | bool send; |
149 | 147 | ||
150 | spin_lock(&inode->i_lock); | ||
151 | fsn_mark = fsnotify_find_mark(group, inode); | 148 | fsn_mark = fsnotify_find_mark(group, inode); |
152 | spin_unlock(&inode->i_lock); | ||
153 | if (!fsn_mark) | 149 | if (!fsn_mark) |
154 | return false; | 150 | return false; |
155 | 151 | ||
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c index 80d102acb86b..ad5a1ea7827e 100644 --- a/fs/notify/inotify/inotify_user.c +++ b/fs/notify/inotify/inotify_user.c | |||
@@ -566,9 +566,7 @@ static int inotify_update_existing_watch(struct fsnotify_group *group, | |||
566 | if (unlikely(!mask)) | 566 | if (unlikely(!mask)) |
567 | return -EINVAL; | 567 | return -EINVAL; |
568 | 568 | ||
569 | spin_lock(&inode->i_lock); | ||
570 | fsn_mark = fsnotify_find_mark(group, inode); | 569 | fsn_mark = fsnotify_find_mark(group, inode); |
571 | spin_unlock(&inode->i_lock); | ||
572 | if (!fsn_mark) | 570 | if (!fsn_mark) |
573 | return -ENOENT; | 571 | return -ENOENT; |
574 | 572 | ||