diff options
Diffstat (limited to 'fs/notify/fanotify/fanotify_user.c')
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index a7d9369482d5..ff1a908c9708 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -570,6 +570,12 @@ static __u32 fanotify_mark_add_to_mask(struct fsnotify_mark *fsn_mark, | |||
570 | if (flags & FAN_MARK_IGNORED_SURV_MODIFY) | 570 | if (flags & FAN_MARK_IGNORED_SURV_MODIFY) |
571 | fsn_mark->flags |= FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY; | 571 | fsn_mark->flags |= FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY; |
572 | } | 572 | } |
573 | |||
574 | if (!(flags & FAN_MARK_ONDIR)) { | ||
575 | __u32 tmask = fsn_mark->ignored_mask | FAN_ONDIR; | ||
576 | fsnotify_set_mark_ignored_mask_locked(fsn_mark, tmask); | ||
577 | } | ||
578 | |||
573 | spin_unlock(&fsn_mark->lock); | 579 | spin_unlock(&fsn_mark->lock); |
574 | 580 | ||
575 | return mask & ~oldmask; | 581 | return mask & ~oldmask; |
@@ -766,6 +772,12 @@ SYSCALL_DEFINE(fanotify_mark)(int fanotify_fd, unsigned int flags, | |||
766 | default: | 772 | default: |
767 | return -EINVAL; | 773 | return -EINVAL; |
768 | } | 774 | } |
775 | |||
776 | if (mask & FAN_ONDIR) { | ||
777 | flags |= FAN_MARK_ONDIR; | ||
778 | mask &= ~FAN_ONDIR; | ||
779 | } | ||
780 | |||
769 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS | 781 | #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS |
770 | if (mask & ~(FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | FAN_EVENT_ON_CHILD)) | 782 | if (mask & ~(FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | FAN_EVENT_ON_CHILD)) |
771 | #else | 783 | #else |