s3: smbd: kernel oplocks. Replace retry_open() with setup_kernel_oplock_poll_open().
authorJeremy Allison <jra@samba.org>
Thu, 9 Nov 2017 20:48:15 +0000 (12:48 -0800)
committerRalph Boehme <slow@samba.org>
Sat, 11 Nov 2017 15:09:17 +0000 (16:09 +0100)
commit47c13fc10a2c9709e9511b2ffcf0e1004497887d
treec0c67c2868502b5c391f8e9e3c510c9a32612acd
parenta0f6ea8dec1ab3d19bc93da12a9b0a1c0ccf6142
s3: smbd: kernel oplocks. Replace retry_open() with setup_kernel_oplock_poll_open().

If a O_NONBLOCK open fails with EWOULDBLOCK, this code changes smbd to
do a retry open every second, until either the timeout or we get a successful
open. If we're opening a file that has a kernel lease set by a non-smbd
process, this is the best we can do.

Prior to this, smbd would block on the second open on such a leased file
(not using O_NONBLOCK) which freezes active clients.

Regression test to follow.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/open.c