Discussion:
kevent(2): EVFILT_VNODE filter miscounting hardlinks?
rudolf
2014-07-01 12:56:19 UTC
Permalink
Hi,

if there is a EVFILT_VNODE filter watching a directory (e.g.
"/tmp/watchdir"), it does not return NOTE_LINK (it only returns
NOTE_WRITE) upon a move of a directory from or into the watched
directory (e.g. "mkdir /tmp/foo; mv /tmp/foo /tmp/watchdir/"). This
seems like a bug to me. Should I submit a PR?

Note: the filter correctly returns NOTE_LINK (and NOTE_WRITE) upon a
mkdir in the watched directory (e.g. "mkdir /tmp/watchdir/bar").

I've observed this behavior under NetBSD 6.1_STABLE amd64 using a test
program from PR kern/34267.

Thanks,

r.
Taylor R Campbell
2014-07-01 13:35:29 UTC
Permalink
Date: Tue, 01 Jul 2014 14:56:19 +0200
From: rudolf <***@eq.cz>

if there is a EVFILT_VNODE filter watching a directory (e.g.
"/tmp/watchdir"), it does not return NOTE_LINK (it only returns
NOTE_WRITE) upon a move of a directory from or into the watched
directory (e.g. "mkdir /tmp/foo; mv /tmp/foo /tmp/watchdir/"). This
seems like a bug to me. Should I submit a PR?

Yes, please! Some time ago I noticed by code inspection that vnode
kevents are kinda broken in various file systems, but I don't recall
the details and haven't found time to actually do anything about it.
(By the way, this is a kernel issue, not a userland issue.)
rudolf
2014-07-01 20:21:37 UTC
Permalink
Post by Taylor R Campbell
Date: Tue, 01 Jul 2014 14:56:19 +0200
if there is a EVFILT_VNODE filter watching a directory (e.g.
"/tmp/watchdir"), it does not return NOTE_LINK (it only returns
NOTE_WRITE) upon a move of a directory from or into the watched
directory (e.g. "mkdir /tmp/foo; mv /tmp/foo /tmp/watchdir/"). This
seems like a bug to me. Should I submit a PR?
Yes, please!
PR kern/48958
Post by Taylor R Campbell
(By the way, this is a kernel issue, not a userland issue.)
ok, i see. Thanks!

r.

Loading...