[PATCH] Fix bug #13121 - Non-smbd processes using kernel oplocks can hang smbd
Andrew Bartlett
abartlet at samba.org
Thu Nov 30 22:15:56 UTC 2017
On Thu, 2017-11-30 at 12:29 -0800, Jeremy Allison wrote:
>
> OK, there *is* a race condition in the test. It's
> the following. The child process gets the kernel
> lease and then notifies the parent process to continue
> by writing a byte up a pipe. It then sets the alarm
> and calls pause() to wait for the parent process to
> contact the smbd and get it to trigger the break request
> using an open call.
>
> It is possible for the parent to run and trigger the break
> request after the child has written to the pipe, but *before*
> the child calls pause(). We then miss the signal notifying
> the child to break the lease.
>
> The fix for this is below. We need to set the sigmask
> on the child to prohibit receiving RT_SIGNAL_LEASE and SIGALRM,
> then wait for the lease break or alarm signal by calling
> sigsuspend(), not pause().
>
> When I add this patch the test becomes 100% reliable
> (not flakey) on the Catalyst cloud.
>
> Thanks a *LOT* Andrew for setting this up and allowing
> access - I don't think I would have found this without
> it !
>
> Please review and push if happy.
Thanks Jeremy for your patience and perseverance on this.
Another flapping test bites the dust! :-)
I see the comment from Ralph on the test, and so I'm happy for the
flapping revert to go in.
Andrew Bartlett
--
Andrew Bartlett
https://samba.org/~abartlet/
Authentication Developer, Samba Team https://samba.org
Samba Development and Support, Catalyst IT
https://catalyst.net.nz/services/samba
More information about the samba-technical
mailing list