Re: [RFC,PATCH] dnotify: enhance or replace?

From: John McCutchan
Date: Wed Mar 24 2004 - 14:48:04 EST

One of the big requirements for a dnotify replacement is this

* Some way to not have an open file descriptor for each directory you
are monitoring. This causes so many problems when unmounting, and this
is really the most noticable problem for the user.

I wanted to get some possible ideas from kernel hackers about how this
could be done. Inode numbers are not unique, but is there any way to get
a unique identifier on a file without using an open file? I have come
up with a few ideas.. I don't think they are very good, but here is

- When user passes fd to kernel to watch, the kernel takes over this
fd, making it invalid in user space ( I know this is a terrible hack)
then when a volume is unmounted, the kernel can walk the list of
open fd's using for notifacation and close them, before attempting to

- The user passes a path to the kernel, the kernel does some work so
that it can track anything to do with that path, and again when
an unmount is called the kernel cleans up anything used for

Both of these ideas are similar, does anyone have a better idea?

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at