summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-09-05 22:45:48 +0000
committerJeremy Allison <jra@samba.org>2001-09-05 22:45:48 +0000
commit11f0402a74640c6f32ae18c58b60d9d57932deab (patch)
tree1f826ed337f8178cb6f4ba8ff37aeb0b60386c28 /source3/smbd
parent4f0509aeeb0e1a8ff6b962985e4468e94dab8273 (diff)
downloadsamba-11f0402a74640c6f32ae18c58b60d9d57932deab.tar.gz
samba-11f0402a74640c6f32ae18c58b60d9d57932deab.tar.bz2
samba-11f0402a74640c6f32ae18c58b60d9d57932deab.zip
Fix I think for the fcntl spinning problem. Re-prioritize so
that oplock break messages get priority over incoming client messages. Jeremy. (This used to be commit 1779f6a223dad87c3b8451d09b9808b46495a8b6)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/oplock.c14
-rw-r--r--source3/smbd/process.c8
2 files changed, 21 insertions, 1 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 26d193e2c2..7033eddc16 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -48,6 +48,20 @@ int32 get_number_of_exclusive_open_oplocks(void)
return exclusive_oplocks_open;
}
+/****************************************************************************
+ Return True if an oplock message is pending.
+****************************************************************************/
+
+BOOL oplock_message_waiting(fd_set *fds)
+{
+ if (koplocks && koplocks->msg_waiting(fds))
+ return True;
+
+ if (FD_ISSET(oplock_sock, fds))
+ return True;
+
+ return False;
+}
/****************************************************************************
Read an oplock break message from either the oplock UDP fd or the
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index ce1e855e29..9f23c7d3be 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -223,7 +223,13 @@ static BOOL receive_message_or_smb(char *buffer, int buffer_len, int timeout)
return False;
}
- if (!FD_ISSET(smbd_server_fd(),&fds) || selrtn > 1) {
+ /*
+ * Ensure we process oplock break messages by preference.
+ * This is IMPORTANT ! Otherwise we can starve other processes
+ * sending us an oplock break message. JRA.
+ */
+
+ if (oplock_message_waiting(&fds)) {
async_processing(&fds, buffer, buffer_len);
if (!FD_ISSET(smbd_server_fd(),&fds)) goto again;
}