aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/notify/fanotify/fanotify_user.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 1c09e6321c5e..b265936e92d6 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -610,6 +610,16 @@ static int fanotify_add_inode_mark(struct fsnotify_group *group,
610 610
611 pr_debug("%s: group=%p inode=%p\n", __func__, group, inode); 611 pr_debug("%s: group=%p inode=%p\n", __func__, group, inode);
612 612
613 /*
614 * If some other task has this inode open for write we should not add
615 * an ignored mark, unless that ignored mark is supposed to survive
616 * modification changes anyway.
617 */
618 if ((flags & FAN_MARK_IGNORED_MASK) &&
619 !(flags & FAN_MARK_IGNORED_SURV_MODIFY) &&
620 (atomic_read(&inode->i_writecount) > 0))
621 return 0;
622
613 fsn_mark = fsnotify_find_inode_mark(group, inode); 623 fsn_mark = fsnotify_find_inode_mark(group, inode);
614 if (!fsn_mark) { 624 if (!fsn_mark) {
615 int ret; 625 int ret;