diff options
Diffstat (limited to 'fs/notify/inode_mark.c')
| -rw-r--r-- | fs/notify/inode_mark.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index b13c00ac48eb..f31e90fc050d 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c | |||
| @@ -63,8 +63,8 @@ void fsnotify_destroy_inode_mark(struct fsnotify_mark *mark) | |||
| 63 | { | 63 | { |
| 64 | struct inode *inode = mark->i.inode; | 64 | struct inode *inode = mark->i.inode; |
| 65 | 65 | ||
| 66 | BUG_ON(!mutex_is_locked(&mark->group->mark_mutex)); | ||
| 66 | assert_spin_locked(&mark->lock); | 67 | assert_spin_locked(&mark->lock); |
| 67 | assert_spin_locked(&mark->group->mark_lock); | ||
| 68 | 68 | ||
| 69 | spin_lock(&inode->i_lock); | 69 | spin_lock(&inode->i_lock); |
| 70 | 70 | ||
| @@ -99,8 +99,16 @@ void fsnotify_clear_marks_by_inode(struct inode *inode) | |||
| 99 | spin_unlock(&inode->i_lock); | 99 | spin_unlock(&inode->i_lock); |
| 100 | 100 | ||
| 101 | list_for_each_entry_safe(mark, lmark, &free_list, i.free_i_list) { | 101 | list_for_each_entry_safe(mark, lmark, &free_list, i.free_i_list) { |
| 102 | fsnotify_destroy_mark(mark); | 102 | struct fsnotify_group *group; |
| 103 | |||
| 104 | spin_lock(&mark->lock); | ||
| 105 | fsnotify_get_group(mark->group); | ||
| 106 | group = mark->group; | ||
| 107 | spin_unlock(&mark->lock); | ||
| 108 | |||
| 109 | fsnotify_destroy_mark(mark, group); | ||
| 103 | fsnotify_put_mark(mark); | 110 | fsnotify_put_mark(mark); |
| 111 | fsnotify_put_group(group); | ||
| 104 | } | 112 | } |
| 105 | } | 113 | } |
| 106 | 114 | ||
| @@ -116,8 +124,9 @@ void fsnotify_clear_inode_marks_by_group(struct fsnotify_group *group) | |||
| 116 | * given a group and inode, find the mark associated with that combination. | 124 | * given a group and inode, find the mark associated with that combination. |
| 117 | * if found take a reference to that mark and return it, else return NULL | 125 | * if found take a reference to that mark and return it, else return NULL |
| 118 | */ | 126 | */ |
| 119 | struct fsnotify_mark *fsnotify_find_inode_mark_locked(struct fsnotify_group *group, | 127 | static struct fsnotify_mark *fsnotify_find_inode_mark_locked( |
| 120 | struct inode *inode) | 128 | struct fsnotify_group *group, |
| 129 | struct inode *inode) | ||
| 121 | { | 130 | { |
| 122 | struct fsnotify_mark *mark; | 131 | struct fsnotify_mark *mark; |
| 123 | struct hlist_node *pos; | 132 | struct hlist_node *pos; |
| @@ -191,8 +200,8 @@ int fsnotify_add_inode_mark(struct fsnotify_mark *mark, | |||
| 191 | 200 | ||
| 192 | mark->flags |= FSNOTIFY_MARK_FLAG_INODE; | 201 | mark->flags |= FSNOTIFY_MARK_FLAG_INODE; |
| 193 | 202 | ||
| 203 | BUG_ON(!mutex_is_locked(&group->mark_mutex)); | ||
| 194 | assert_spin_locked(&mark->lock); | 204 | assert_spin_locked(&mark->lock); |
| 195 | assert_spin_locked(&group->mark_lock); | ||
| 196 | 205 | ||
| 197 | spin_lock(&inode->i_lock); | 206 | spin_lock(&inode->i_lock); |
| 198 | 207 | ||
