diff options
Diffstat (limited to 'fs/notify/inode_mark.c')
-rw-r--r-- | fs/notify/inode_mark.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index 33297c005060..4c29fcf557d1 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c | |||
@@ -177,7 +177,8 @@ void fsnotify_set_inode_mark_mask_locked(struct fsnotify_mark *mark, | |||
177 | * Attach an initialized mark to a given inode. | 177 | * Attach an initialized mark to a given inode. |
178 | * These marks may be used for the fsnotify backend to determine which | 178 | * These marks may be used for the fsnotify backend to determine which |
179 | * event types should be delivered to which group and for which inodes. These | 179 | * event types should be delivered to which group and for which inodes. These |
180 | * marks are ordered according to the group's location in memory. | 180 | * marks are ordered according to priority, highest number first, and then by |
181 | * the group's location in memory. | ||
181 | */ | 182 | */ |
182 | int fsnotify_add_inode_mark(struct fsnotify_mark *mark, | 183 | int fsnotify_add_inode_mark(struct fsnotify_mark *mark, |
183 | struct fsnotify_group *group, struct inode *inode, | 184 | struct fsnotify_group *group, struct inode *inode, |
@@ -211,7 +212,11 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, | |||
211 | goto out; | 212 | goto out; |
212 | } | 213 | } |
213 | 214 | ||
214 | if (mark->group < lmark->group) | 215 | if (mark->group->priority < lmark->group->priority) |
216 | continue; | ||
217 | |||
218 | if ((mark->group->priority == lmark->group->priority) && | ||
219 | (mark->group < lmark->group)) | ||
215 | continue; | 220 | continue; |
216 | 221 | ||
217 | hlist_add_before_rcu(&mark->i.i_list, &lmark->i.i_list); | 222 | hlist_add_before_rcu(&mark->i.i_list, &lmark->i.i_list); |
@@ -240,6 +245,7 @@ void fsnotify_unmount_inodes(struct list_head *list) | |||
240 | { | 245 | { |
241 | struct inode *inode, *next_i, *need_iput = NULL; | 246 | struct inode *inode, *next_i, *need_iput = NULL; |
242 | 247 | ||
248 | spin_lock(&inode_lock); | ||
243 | list_for_each_entry_safe(inode, next_i, list, i_sb_list) { | 249 | list_for_each_entry_safe(inode, next_i, list, i_sb_list) { |
244 | struct inode *need_iput_tmp; | 250 | struct inode *need_iput_tmp; |
245 | 251 | ||
@@ -297,4 +303,5 @@ void fsnotify_unmount_inodes(struct list_head *list) | |||
297 | 303 | ||
298 | spin_lock(&inode_lock); | 304 | spin_lock(&inode_lock); |
299 | } | 305 | } |
306 | spin_unlock(&inode_lock); | ||
300 | } | 307 | } |