aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_inotify.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_inotify.c')
-rw-r--r--sys/kern/vfs_inotify.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_inotify.c b/sys/kern/vfs_inotify.c
index 9562350c897f..2b42228465a4 100644
--- a/sys/kern/vfs_inotify.c
+++ b/sys/kern/vfs_inotify.c
@@ -503,7 +503,7 @@ inotify_can_coalesce(struct inotify_softc *sc, struct inotify_event *evp)
return (prev != NULL && prev->ev.mask == evp->mask &&
prev->ev.wd == evp->wd && prev->ev.cookie == evp->cookie &&
prev->ev.len == evp->len &&
- (evp->len == 0 || strcmp(prev->ev.name, evp->name) == 0));
+ memcmp(prev->ev.name, evp->name, evp->len) == 0);
}
static void
@@ -760,9 +760,11 @@ vn_inotify_add_watch(struct vnode *vp, struct inotify_softc *sc, uint32_t mask,
* directory if it's specified as a vnode.
*/
vrefact(vp);
+ VOP_UNLOCK(vp);
NDINIT_ATVP(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE,
dp->d_name, vp);
error = namei(&nd);
+ vn_lock(vp, LK_SHARED | LK_RETRY);
if (error != 0)
break;
vn_irflag_set_cond(nd.ni_vp, VIRF_INOTIFY_PARENT);