Re: directory notifications lost after fork?

Stephen Rothwell (sfr@canb.auug.org.au)
Tue, 12 Mar 2002 13:59:49 +1100


Hi Adrea,

On Tue, 12 Mar 2002 02:20:46 +0100 Andrea Arcangeli <andrea@suse.de> wrote:
>
> If somebody overrides the dnotify on the same file, he should become the
> new owner, that's not handled in the below patch.

My contention is that if some process (not in the same thread group as the
process that originally set up the directory notifier) tries to set up a
directory notifier on the same file descriptor (i.e. they are a child of
the original process), then they should get their own notifier. The
parent can remove their notifier if they want to.

Notice that multiple processes can have notifiers enabled for the same
directory (even with a different set of flags).

My patch makes directory notifiers per thread group instead of per process
tree (which they are now).

> Secondly I prefer to return -EPERM to userspace if somebody tries to
> drop a dnotify that it doesn't own, it gives more information back to
> userspace.

This would be equivalent to returning -EPERM if you tried to remove a
lock on a file when you didn't set it ...

-- 
Cheers, Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/