s4: torture: Fix race condition in test_smb2_kernel_oplocks8.
authorJeremy Allison <jra@samba.org>
Thu, 30 Nov 2017 20:25:02 +0000 (12:25 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 1 Dec 2017 22:46:14 +0000 (23:46 +0100)
commit9f83d435bb21aeb3d309b764170789ed100c9ad7
tree144b5ec56caa96edd9892a452fb7ae89c53d8595
parentbfd063d7e8f921f8f47d5f43a64f40ef85fcbde9
s4: torture: Fix race condition in test_smb2_kernel_oplocks8.

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.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13121

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
source4/torture/smb2/oplock.c