From: Eric Paris <eparis@redhat.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 2/5] fsnotify: reset used_inode and used_vfsmount on each pass
Date: Wed, 18 Aug 2010 12:29:59 -0400 [thread overview]
Message-ID: <20100818162959.1080.70797.stgit@paris.rdu.redhat.com> (raw)
In-Reply-To: <20100818162954.1080.48055.stgit@paris.rdu.redhat.com>
The fsnotify main loop has 2 booleans which tell if a particular mark was
sent to the listeners or if it should be processed in the next pass. The
problem is that the booleans were not reset on each traversal of the loop.
So marks could get skipped even when they were not sent to the notifiers.
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@sophos.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
---
fs/notify/fsnotify.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index f3e3b35..59dc7a0 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -220,7 +220,7 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
struct fsnotify_event *event = NULL;
struct vfsmount *mnt;
int idx, ret = 0;
- bool used_inode = false, used_vfsmount = false;
+ bool used_inode, used_vfsmount;
/* global tests shouldn't care about events on child only the specific event */
__u32 test_mask = (mask & ~FS_EVENT_ON_CHILD);
@@ -261,6 +261,8 @@ int fsnotify(struct inode *to_tell, __u32 mask, void *data, int data_is,
}
while (inode_node || vfsmount_node) {
+ used_inode = used_vfsmount = false;
+
if (inode_node) {
inode_mark = hlist_entry(srcu_dereference(inode_node, &fsnotify_mark_srcu),
struct fsnotify_mark, i.i_list);
next prev parent reply other threads:[~2010-08-18 16:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-18 16:29 [PATCH 1/5] fanotify: do not dereference inode_mark when it is unset Eric Paris
2010-08-18 16:29 ` Eric Paris [this message]
2010-08-18 16:30 ` [PATCH 3/5] fanotify: add MAINTAINERS entry Eric Paris
2010-08-18 16:30 ` [PATCH 4/5] fsnotify: fix ignored mask handling between inode and vfsmount marks Eric Paris
2010-08-18 16:30 ` [PATCH 5/5] fanotify: flush outstanding perm requests on group destroy Eric Paris
2010-08-19 14:07 ` Eric Paris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100818162959.1080.70797.stgit@paris.rdu.redhat.com \
--to=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®