aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Paris <eparis@redhat.com>2009-12-17 21:24:33 -0500
committerEric Paris <eparis@redhat.com>2010-07-28 09:59:00 -0400
commitc9778a98e7440fb73e0d27b8155a688663a0d493 (patch)
tree838acd5f9438661015c32211d487ef618807a798
parentc908370fc1ac27fd7e1fc0f34c693047b26564ce (diff)
fanotify: allow ignored_masks to survive modify
Some users may want to truely ignore an inode even if it has been modified. Say you are wanting a mount which contains a log file and you really don't want any notification about that file. This patch allows the listener to do that. Signed-off-by: Eric Paris <eparis@redhat.com>
-rw-r--r--fs/notify/fanotify/fanotify_user.c2
-rw-r--r--include/linux/fanotify.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index ad02d475770f..3e275f17e7b7 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -375,6 +375,8 @@ static __u32 fanotify_mark_add_to_mask(struct fsnotify_mark *fsn_mark,
375 } else { 375 } else {
376 oldmask = fsn_mark->ignored_mask; 376 oldmask = fsn_mark->ignored_mask;
377 fsnotify_set_mark_ignored_mask_locked(fsn_mark, (oldmask | mask)); 377 fsnotify_set_mark_ignored_mask_locked(fsn_mark, (oldmask | mask));
378 if (flags & FAN_MARK_IGNORED_SURV_MODIFY)
379 fsn_mark->flags |= FSNOTIFY_MARK_FLAG_IGNORED_SURV_MODIFY;
378 } 380 }
379 spin_unlock(&fsn_mark->lock); 381 spin_unlock(&fsn_mark->lock);
380 382
diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
index b8daa9f9b560..e43934d0b74c 100644
--- a/include/linux/fanotify.h
+++ b/include/linux/fanotify.h
@@ -31,13 +31,15 @@
31#define FAN_MARK_ONLYDIR 0x00000008 31#define FAN_MARK_ONLYDIR 0x00000008
32#define FAN_MARK_MOUNT 0x00000010 32#define FAN_MARK_MOUNT 0x00000010
33#define FAN_MARK_IGNORED_MASK 0x00000020 33#define FAN_MARK_IGNORED_MASK 0x00000020
34#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
34 35
35#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ 36#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\
36 FAN_MARK_REMOVE |\ 37 FAN_MARK_REMOVE |\
37 FAN_MARK_DONT_FOLLOW |\ 38 FAN_MARK_DONT_FOLLOW |\
38 FAN_MARK_ONLYDIR |\ 39 FAN_MARK_ONLYDIR |\
39 FAN_MARK_MOUNT |\ 40 FAN_MARK_MOUNT |\
40 FAN_MARK_IGNORED_MASK) 41 FAN_MARK_IGNORED_MASK |\
42 FAN_MARK_IGNORED_SURV_MODIFY)
41 43
42/* 44/*
43 * All of the events - we build the list by hand so that we can add flags in 45 * All of the events - we build the list by hand so that we can add flags in