aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/inotify.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/inotify.c b/fs/inotify.c
index 7bbed1b89825..dae3f28f30d4 100644
--- a/fs/inotify.c
+++ b/fs/inotify.c
@@ -428,11 +428,13 @@ void inotify_unmount_inodes(struct list_head *list)
428 watches = &inode->inotify_watches; 428 watches = &inode->inotify_watches;
429 list_for_each_entry_safe(watch, next_w, watches, i_list) { 429 list_for_each_entry_safe(watch, next_w, watches, i_list) {
430 struct inotify_handle *ih= watch->ih; 430 struct inotify_handle *ih= watch->ih;
431 get_inotify_watch(watch);
431 mutex_lock(&ih->mutex); 432 mutex_lock(&ih->mutex);
432 ih->in_ops->handle_event(watch, watch->wd, IN_UNMOUNT, 0, 433 ih->in_ops->handle_event(watch, watch->wd, IN_UNMOUNT, 0,
433 NULL, NULL); 434 NULL, NULL);
434 inotify_remove_watch_locked(ih, watch); 435 inotify_remove_watch_locked(ih, watch);
435 mutex_unlock(&ih->mutex); 436 mutex_unlock(&ih->mutex);
437 put_inotify_watch(watch);
436 } 438 }
437 mutex_unlock(&inode->inotify_mutex); 439 mutex_unlock(&inode->inotify_mutex);
438 iput(inode); 440 iput(inode);