Page MenuHomeFreeBSD

D53774.1795602465.diff
No OneTemporary

Authored By
Unknown
Size
609 B
Referenced Files
None
Subscribers
None

D53774.1795602465.diff

diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c
--- a/sys/kern/vfs_inotify.c
+++ b/sys/kern/vfs_inotify.c
@@ -381,7 +381,14 @@
static void
inotify_free_watch(struct inotify_watch *watch)
{
- vrele(watch->vp);
+ /*
+ * Formally, we don't need to lock the vnode here. However, if we
+ * don't, and vrele() releases the last reference, it's possible the
+ * vnode will be recycled while a different thread holds the vnode lock.
+ * Work around this bug by acquiring the lock here.
+ */
+ (void)vn_lock(watch->vp, LK_EXCLUSIVE | LK_RETRY);
+ vput(watch->vp);
free(watch, M_INOTIFY);
}

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 25, 10:27 AM (19 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41987739
Default Alt Text
D53774.1795602465.diff (609 B)

Event Timeline