Re: directory notifications lost after fork?

Andrea Arcangeli (andrea@suse.de)
Mon, 11 Mar 2002 11:26:52 +0100


On Sun, Mar 10, 2002 at 10:08:02PM +0100, Oskar Liljeblad wrote:
> The code snipper demonstrates what I consider a bug in the
> dnotify facilities in the kernel. After a fork, all registered
> notifications are lost in the process where they originally
> where registered (the parent process). "lost" here means that
> the signal specified with F_SETSIG fcntl no longer is delivered
> when notified.
>
> How to reproduce (tested with 2.4.17):
> gcc -o dnoticebug dnoticebug.c
> dnoticebug & # run in background
> cat dnoticebug.c >/dev/null # "notified" should now be printed
> cat dnoticebug.c >/dev/null # nothing is printed this time
>
> If you comment out the line with fork below, "notified" *will* be
> printed every time you cat dnoticebug.c.
>
> I'm not subscribed to the list so I'd appreciate if you CCed me.
> (Otherwise I'd have to use the archives :) Thanks.

this should fix your problem:

ftp://ftp.us.kernel.org/pub/linux/kernel/people/andrea/kernels/v2.4/2.4.19pre2aa2/00_dnotify-fl_owner-1

Andrea
-
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/