Home Home > GIT Browse > SLE15-SP1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKernel Build Daemon <kbuild@suse.de>2019-01-18 07:13:22 +0100
committerKernel Build Daemon <kbuild@suse.de>2019-01-18 07:13:22 +0100
commit26444e6ff2588f0312f180880b5936acfb735053 (patch)
tree333f4be3372cf0ed2c3f64519be68d98133e7c57
parent358d41e6fbfada42e9301bd947a922942ff68b0f (diff)
parent6933ea987d87e64082e619ebc396ce504b098170 (diff)
Merge branch 'SLE12-SP4' into SLE12-SP4-AZURErpm-4.12.14-6.6
-rw-r--r--fs/notify/fanotify/fanotify.c10
-rw-r--r--fs/notify/fsnotify.c7
2 files changed, 11 insertions, 6 deletions
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
index 85d1fbcd9a23..74e5f1bf17d6 100644
--- a/fs/notify/fanotify/fanotify.c
+++ b/fs/notify/fanotify/fanotify.c
@@ -106,8 +106,8 @@ static bool fanotify_should_send_event(struct fsnotify_mark *inode_mark,
return false;
/*
- * if the event is for a child and this inode doesn't care about
- * events on the child, don't send it!
+ * If the event is for a child and this mark doesn't care about
+ * events on a child, don't send it!
*/
if (inode_mark &&
(!(event_mask & FS_EVENT_ON_CHILD) ||
@@ -116,7 +116,11 @@ static bool fanotify_should_send_event(struct fsnotify_mark *inode_mark,
marks_ignored_mask |= inode_mark->ignored_mask;
}
- if (vfsmnt_mark) {
+ /*
+ * Mount marks don't care about event on children. Ignore them as
+ * otherwise we could report some events twice.
+ */
+ if (vfsmnt_mark && !(event_mask & FS_EVENT_ON_CHILD)) {
marks_mask |= vfsmnt_mark->mask;
marks_ignored_mask |= vfsmnt_mark->ignored_mask;
}
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 960e867ef651..87eaeb494ce7 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -163,9 +163,9 @@ int __fsnotify_parent(const struct path *path, struct dentry *dentry, __u32 mask
parent = dget_parent(dentry);
p_inode = parent->d_inode;
- if (unlikely(!fsnotify_inode_watches_children(p_inode)))
+ if (unlikely(!fsnotify_inode_watches_children(p_inode))) {
__fsnotify_update_child_dentry_flags(p_inode);
- else if (p_inode->i_fsnotify_mask & mask) {
+ } else if (p_inode->i_fsnotify_mask & mask & ALL_FSNOTIFY_EVENTS) {
struct name_snapshot name;
/* we are notifying a parent so come up with the new mask which
@@ -300,7 +300,8 @@ int fsnotify(struct inode *to_tell, __u32 mask, const void *data, int data_is,
inode_node = srcu_dereference(inode_conn->list.first,
&fsnotify_mark_srcu);
- if (mnt) {
+ /* An event "on child" is not intended for a mount mark */
+ if (mnt && !(mask & FS_EVENT_ON_CHILD)) {
inode_conn = srcu_dereference(to_tell->i_fsnotify_marks,
&fsnotify_mark_srcu);
if (inode_conn)