diff options
Diffstat (limited to 'fs/notify/fanotify')
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 3e275f17e7b7..9fe760baf69f 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -514,9 +514,10 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags, | |||
514 | 514 | ||
515 | if (flags & ~FAN_ALL_MARK_FLAGS) | 515 | if (flags & ~FAN_ALL_MARK_FLAGS) |
516 | return -EINVAL; | 516 | return -EINVAL; |
517 | switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) { | 517 | switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_FLUSH)) { |
518 | case FAN_MARK_ADD: | 518 | case FAN_MARK_ADD: |
519 | case FAN_MARK_REMOVE: | 519 | case FAN_MARK_REMOVE: |
520 | case FAN_MARK_FLUSH: | ||
520 | break; | 521 | break; |
521 | default: | 522 | default: |
522 | return -EINVAL; | 523 | return -EINVAL; |
@@ -545,7 +546,7 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags, | |||
545 | group = filp->private_data; | 546 | group = filp->private_data; |
546 | 547 | ||
547 | /* create/update an inode mark */ | 548 | /* create/update an inode mark */ |
548 | switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE)) { | 549 | switch (flags & (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_FLUSH)) { |
549 | case FAN_MARK_ADD: | 550 | case FAN_MARK_ADD: |
550 | if (flags & FAN_MARK_MOUNT) | 551 | if (flags & FAN_MARK_MOUNT) |
551 | ret = fanotify_add_vfsmount_mark(group, mnt, mask, flags); | 552 | ret = fanotify_add_vfsmount_mark(group, mnt, mask, flags); |
@@ -558,6 +559,13 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags, | |||
558 | else | 559 | else |
559 | ret = fanotify_remove_inode_mark(group, inode, mask, flags); | 560 | ret = fanotify_remove_inode_mark(group, inode, mask, flags); |
560 | break; | 561 | break; |
562 | case FAN_MARK_FLUSH: | ||
563 | if (flags & FAN_MARK_MOUNT) | ||
564 | fsnotify_clear_vfsmount_marks_by_group(group); | ||
565 | else | ||
566 | fsnotify_clear_inode_marks_by_group(group); | ||
567 | fsnotify_recalc_group_mask(group); | ||
568 | break; | ||
561 | default: | 569 | default: |
562 | ret = -EINVAL; | 570 | ret = -EINVAL; |
563 | } | 571 | } |