Hello,
follow comment is at fs/inotify_user.c:287
/* coalescing: drop this event if it is a dupe of the previous */
I think the previous event in the comment should be the last event in
the link list. But inotify_dev_get_event return the first event in the
list. In addition, it doesn't check whether the list is empty
Regards
Signed-off-by: Yan Zheng<yanzheng@21cn.com>
---
diff -ur linux-2.6.23-rc8/fs/inotify_user.c linux/fs/inotify_user.c
--- linux-2.6.23-rc8/fs/inotify_user.c 2007-09-29 11:00:15.000000000 +0800
+++ linux/fs/inotify_user.c 2007-09-29 11:01:40.000000000 +0800
@@ -247,6 +247,19 @@
}
/*
+ * inotify_dev_get_last_event - return the last event in the given dev's queue
+ *
+ * Caller must hold dev->ev_mutex.
+ */
+static inline struct inotify_kernel_event *
+inotify_dev_get_last_event(struct inotify_device *dev)
+{
+ if (list_empty(&dev->events))
+ return NULL;
+ return list_entry(dev->events.prev, struct inotify_kernel_event, list);
+}
+
+/*
* inotify_dev_queue_event - event handler registered with core inotify, adds
* a new event to the given device
*
@@ -272,7 +285,7 @@
put_inotify_watch(w); /* final put */
/* coalescing: drop this event if it is a dupe of the previous */
- last = inotify_dev_get_event(dev);
+ last = inotify_dev_get_last_event(dev);
if (last && last->event.mask == mask && last->event.wd == wd &&
last->event.cookie == cookie) {
const char *lastname = last->name;
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
| Naveen Gupta | Re: [PATCH] cgroup: limit block I/O bandwidth |
| Chuck Ebbert | Why do so many machines need "noapic"? |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Ingo Molnar | Re: 2.6.24-rc6-mm1 |
git: | |
| Andy Parkins | svn:externals using git submodules |
| Linus Torvalds | Be more careful about updating refs |
| Wink Saville | Using git with Eclipse |
| Shawn O. Pearce | [JGIT PATCH 0/5] Patch parsing API |
| Steve Shockley | Re: Real men don't attack straw men |
| Laurent CARON | IPSEC VPN between OpenBSD and Linux (OpenSwan) |
| Beavis | mutiple pptp pass-through PF |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 36/37] dccp: Initialisation and type-checking of feature sysctls |
| Hannes Eder | [PATCH 19/27] drivers/net/usb: fix sparse warnings: make symbols static |
| Arjan van de Ven | Re: [GIT]: Networking |
