X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=fs%2Fnotify%2Ffanotify%2Ffanotify_user.c;h=b265936e92d6240bab60e0f11306aacf04a14006;hb=5322a59f14e4cae5f878b9c0c5612d403c230d7f;hp=1c09e6321c5e0908aae9fe46bbe63b5e2acbca02;hpb=bbf2aba50f6ed7c8dd53623fa1437b539928ac39;p=net-next-2.6.git diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 1c09e6321c5..b265936e92d 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, pr_debug("%s: group=%p inode=%p\n", __func__, group, inode); + /* + * If some other task has this inode open for write we should not add + * an ignored mark, unless that ignored mark is supposed to survive + * modification changes anyway. + */ + if ((flags & FAN_MARK_IGNORED_MASK) && + !(flags & FAN_MARK_IGNORED_SURV_MODIFY) && + (atomic_read(&inode->i_writecount) > 0)) + return 0; + fsn_mark = fsnotify_find_inode_mark(group, inode); if (!fsn_mark) { int ret;