[PATCH] Don't set child->requests to NULL in parent process after fork

Jeremy Allison jra at samba.org
Sat Jan 10 21:48:59 GMT 2009


On Sat, Jan 10, 2009 at 02:02:25PM +0800, boyang wrote:
> Hi, everyone:
>      I think it is a logic error to set child->requests to NULL in
> parent process. Because requests are added to requests list before
> fork() and schedule_async_request(). If it is set to NULL, only the
> first request gets scheduled, others are lost. Why does the parent shoot
> itself like this? :-)
>      Please review the patch, Thanks!

Yes, you're right. Looks like a bug that we get away with
as we only do this after the fork, which will either be
when the child is being initialized or after the child
has died. At initialization time we are sure there is
only one request, after the child has died is when this
might bite us if we have several requests outstanding.
My guess is the:
 
child->requests = NULL;

code was something that should be done in the child logic
(as the child should never be handling requests on that
pointer) that got added to the parent logic by mistake.

I'll commit immediately to all branches.

Thanks,

Jeremy.


More information about the samba-technical mailing list