aboutsummaryrefslogtreecommitdiffstats
path: root/fs/notify
diff options
context:
space:
mode:
Diffstat (limited to 'fs/notify')
-rw-r--r--fs/notify/fanotify/fanotify_user.c6
-rw-r--r--fs/notify/notification.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index a64313868d3a..46d135c4988f 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -390,9 +390,11 @@ static int fanotify_release(struct inode *ignored, struct file *file)
390 mutex_lock(&group->notification_mutex); 390 mutex_lock(&group->notification_mutex);
391 while (!fsnotify_notify_queue_is_empty(group)) { 391 while (!fsnotify_notify_queue_is_empty(group)) {
392 fsn_event = fsnotify_remove_first_event(group); 392 fsn_event = fsnotify_remove_first_event(group);
393 if (!(fsn_event->mask & FAN_ALL_PERM_EVENTS)) 393 if (!(fsn_event->mask & FAN_ALL_PERM_EVENTS)) {
394 mutex_unlock(&group->notification_mutex);
394 fsnotify_destroy_event(group, fsn_event); 395 fsnotify_destroy_event(group, fsn_event);
395 else 396 mutex_lock(&group->notification_mutex);
397 } else
396 FANOTIFY_PE(fsn_event)->response = FAN_ALLOW; 398 FANOTIFY_PE(fsn_event)->response = FAN_ALLOW;
397 } 399 }
398 mutex_unlock(&group->notification_mutex); 400 mutex_unlock(&group->notification_mutex);
diff --git a/fs/notify/notification.c b/fs/notify/notification.c
index e455e83ceeeb..7d563dea52a4 100644
--- a/fs/notify/notification.c
+++ b/fs/notify/notification.c
@@ -178,7 +178,9 @@ void fsnotify_flush_notify(struct fsnotify_group *group)
178 mutex_lock(&group->notification_mutex); 178 mutex_lock(&group->notification_mutex);
179 while (!fsnotify_notify_queue_is_empty(group)) { 179 while (!fsnotify_notify_queue_is_empty(group)) {
180 event = fsnotify_remove_first_event(group); 180 event = fsnotify_remove_first_event(group);
181 mutex_unlock(&group->notification_mutex);
181 fsnotify_destroy_event(group, event); 182 fsnotify_destroy_event(group, event);
183 mutex_lock(&group->notification_mutex);
182 } 184 }
183 mutex_unlock(&group->notification_mutex); 185 mutex_unlock(&group->notification_mutex);
184} 186}