aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/notify/mark.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/notify/mark.c b/fs/notify/mark.c
index e14587d55689..f104d565b682 100644
--- a/fs/notify/mark.c
+++ b/fs/notify/mark.c
@@ -135,9 +135,6 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
135 135
136 mark->flags &= ~FSNOTIFY_MARK_FLAG_ALIVE; 136 mark->flags &= ~FSNOTIFY_MARK_FLAG_ALIVE;
137 137
138 /* 1 from caller and 1 for being on i_list/g_list */
139 BUG_ON(atomic_read(&mark->refcnt) < 2);
140
141 spin_lock(&group->mark_lock); 138 spin_lock(&group->mark_lock);
142 139
143 if (mark->flags & FSNOTIFY_MARK_FLAG_INODE) { 140 if (mark->flags & FSNOTIFY_MARK_FLAG_INODE) {
@@ -182,6 +179,11 @@ void fsnotify_destroy_mark(struct fsnotify_mark *mark)
182 iput(inode); 179 iput(inode);
183 180
184 /* 181 /*
182 * We don't necessarily have a ref on mark from caller so the above iput
183 * may have already destroyed it. Don't touch from now on.
184 */
185
186 /*
185 * it's possible that this group tried to destroy itself, but this 187 * it's possible that this group tried to destroy itself, but this
186 * this mark was simultaneously being freed by inode. If that's the 188 * this mark was simultaneously being freed by inode. If that's the
187 * case, we finish freeing the group here. 189 * case, we finish freeing the group here.