diff options
Diffstat (limited to 'fs/notify')
-rw-r--r-- | fs/notify/inode_mark.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c index a39534845b28..282150f74cfa 100644 --- a/fs/notify/inode_mark.c +++ b/fs/notify/inode_mark.c | |||
@@ -204,6 +204,8 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry) | |||
204 | */ | 204 | */ |
205 | 205 | ||
206 | 206 | ||
207 | iput(inode); | ||
208 | |||
207 | /* | 209 | /* |
208 | * it's possible that this group tried to destroy itself, but this | 210 | * it's possible that this group tried to destroy itself, but this |
209 | * this mark was simultaneously being freed by inode. If that's the | 211 | * this mark was simultaneously being freed by inode. If that's the |
@@ -306,6 +308,10 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry, | |||
306 | struct fsnotify_mark_entry *lentry; | 308 | struct fsnotify_mark_entry *lentry; |
307 | int ret = 0; | 309 | int ret = 0; |
308 | 310 | ||
311 | inode = igrab(inode); | ||
312 | if (unlikely(!inode)) | ||
313 | return -EINVAL; | ||
314 | |||
309 | /* | 315 | /* |
310 | * LOCKING ORDER!!!! | 316 | * LOCKING ORDER!!!! |
311 | * entry->lock | 317 | * entry->lock |
@@ -337,6 +343,7 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry, | |||
337 | 343 | ||
338 | if (lentry) { | 344 | if (lentry) { |
339 | ret = -EEXIST; | 345 | ret = -EEXIST; |
346 | iput(inode); | ||
340 | fsnotify_put_mark(lentry); | 347 | fsnotify_put_mark(lentry); |
341 | } else { | 348 | } else { |
342 | __fsnotify_update_child_dentry_flags(inode); | 349 | __fsnotify_update_child_dentry_flags(inode); |