Re: [PATCH -v3 5/8] fsnotify: unified filesystem notificationbackend

From: Eric Paris
Date: Fri Nov 28 2008 - 18:33:27 EST


On Fri, 2008-11-28 at 04:54 +0000, Al Viro wrote:
> On Tue, Nov 25, 2008 at 12:21:18PM -0500, Eric Paris wrote:
>
> What the hell is ->notification_list and what in this patchset would
> add stuff to it? Even more interesting question: how long would these
> guys remain there and what's to prevent a race with umount? At least
> 'inode-only' events will pin down the inode and leaving the matching
> iput() until after umount() is a Bad Thing(tm)...

It's not in this set, my failure. But I'm glad you noticed it since you
can help me get it right before I send the fanotify stuff....

If you look at the "fsnotify()" function in

http://marc.info/?l=linux-kernel&m=122650641702090&w=2

you will see users. I've since moved fanotify_add_event_to_notif() to
be a per group function. dnotify doesn't make use of the
notification_list. fanotify will. I can remove that for this patch set
(but removing everything that isn't in preperation for fanotify leaves
us with little new and useful)

Anyway at the fsnotify_BLAH my intention is to only put events which
include a struct path (for which I've take a path_get()). When the
event is later pulled off of the queue I call dentry_open. I assume
that a normal opened fd, if it returns is always safe vs umount. Since
I've taken a ref to the path I assume it's safe to use in an open call.

In my previous patch set these entries with struct path can survive
forever if userspace fanotify listeners suck. I saw it as a future
improvement to drop notification events on a timer if needed...

-Eric

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/