1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

157 Commits

Author SHA1 Message Date
Stefan Metzmacher
d1e0997614 s3:smbd/blocking: pass smbd_server_connection as private_data to received_unlock_msg()
metze
2011-12-12 20:14:41 +01:00
Stefan Metzmacher
1909cb0724 s3:smbd/blocking: avoid usage of server_event_context()
metze
2011-12-12 14:35:42 +01:00
Andrew Bartlett
b373d0e777 s3-build: Provide a run-time shim to work around duplicate symbols
The become_root() and similar 'smbd' functions that are used widely in
Samba libraries had 'dummy' copies in dummysmbd.c and dummyroot.c.

These have been replaced by a runtime plugin mechanim, which ensures
that standlone binaries still do nothing, while in smbd the correct
function is used.

This avoids having these as duplicate symbols in the smbd binary,
which can cause unpredictable behaviour.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-21 15:54:51 +10:00
Rusty Russell
56e72337b0 lib/util/time.c: timeval_current_ofs_msec
Several places want "milliseconds from current time", and several were
simply doing "msec * 1000" which can (and does in one place) result in
a usec value over 1 a million.

Using a helper to do this is safer and more readable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Andrew Bartlett
e5dd03d199 s3-globals Remove smbd_event_context() (use server_event_context())
This has been a wrapper around server_event_context() for some time
now, and removing this from dummmysmbd.c assists with library
dependencies.

Andrew Bartlett
2011-05-31 00:32:07 +02:00
Jeremy Allison
4f41be356a Fix many const compiler warnings. 2011-05-05 10:41:59 -07:00
Günther Deschner
ab36d597e7 s3-messages: make ndr_messaging.h part of messages.h.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
b2af281e50 s3-messages: only include messages.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
8c24ebf371 s3: include smbd/smbd.h where needed.
Guenther
2011-03-30 01:13:08 +02:00
Volker Lendecke
e128b23165 s3: Remove smbd_server_conn from process_blocking_lock_cancel_message 2010-10-03 18:17:09 +02:00
Volker Lendecke
c0eb35c0a2 s3: Remove smbd_server_conn from smb1 receive_unlock_msg 2010-10-03 18:17:09 +02:00
Volker Lendecke
1808dd0a85 s3: Make srv_send_smb take an sconn instead of a sock fd 2010-08-24 21:06:41 +02:00
Volker Lendecke
774bae74d1 s3: Remove smbd_server_fd from blocking_lock_reply_error 2010-08-16 22:39:16 +02:00
Volker Lendecke
9115beb88c s3: Remove smbd_server_fd from generic_blocking_lock_error 2010-08-16 22:39:16 +02:00
Volker Lendecke
02a42a0a1d s3: Remove procid_self() from blocking_lock_cancel_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
f60c6f55c9 s3: Remove procid_self() from process_blocking_lock_queue() 2010-07-05 11:06:28 +02:00
Volker Lendecke
a9aa582de5 s3: Remove procid_self() from remove_pending_lock_requests_by_mid_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
a07c1586ba s3: Remove procid_self() from cancel_pending_lock_requests_by_fid() 2010-07-05 11:06:28 +02:00
Volker Lendecke
c49f6a681d s3: Remove procid_self() from generic_blocking_lock_error() 2010-07-05 11:06:28 +02:00
Volker Lendecke
d42806a013 s3: Remove procid_self() from push_blocking_lock_request() 2010-07-05 11:06:28 +02:00
Volker Lendecke
eb29f84b5f s3: Remove smbd_messaging_context() from blocking_lock_cancel_smb1() 2010-07-05 11:06:28 +02:00
Volker Lendecke
dd48e0afe0 s3: Remove smbd_messaging_context() from process_trans2() 2010-07-05 11:06:28 +02:00
Volker Lendecke
ae75a90b18 s3: Remove smbd_messaging_context() from process_lockingX() 2010-07-05 11:06:27 +02:00
Volker Lendecke
e606b27114 s3: Remove smbd_messaging_context() from reply_lockingX_error() 2010-07-05 11:06:27 +02:00
Volker Lendecke
fef875f64f s3: Remove smbd_messaging_context() from push_blocking_lock_request() 2010-07-05 11:06:27 +02:00
Volker Lendecke
5dc2fe5fdc s3: Explicitly pass sconn to process_blocking_lock_queue_smb2 2010-06-12 15:42:57 +02:00
Volker Lendecke
330a64c72b s3: Explicitly pass sconn to process_blocking_lock_queue 2010-06-12 15:42:56 +02:00
Volker Lendecke
cb03710c76 s3: Remove smbd_server_conn from blocking_lock_cancel_smb1 2010-06-12 15:42:56 +02:00
Volker Lendecke
cc825231cd s3: Explicitly pass sconn to recalc_brl_timeout 2010-06-12 15:42:56 +02:00
Volker Lendecke
ec2079f5d0 s3: Explicitly pass sconn to blocking_lock_was_deferred_smb1 2010-06-12 15:42:56 +02:00
Volker Lendecke
f856fb0b35 s3: Explicitly pass sconn to remove_pending_lock_requests_by_mid_smb1 2010-06-12 15:42:56 +02:00
Volker Lendecke
91bd52da1a s3: Remove smbd_server_conn from cancel_pending_lock_requests_by_fid 2010-06-12 15:42:56 +02:00
Volker Lendecke
034e616448 s3: Remove smbd_server_conn from push_blocking_lock_request 2010-06-12 15:42:56 +02:00
Volker Lendecke
bfd5f24fa1 s3: Remove smbd_server_conn from brl_timeout_fn 2010-06-12 15:42:56 +02:00
Jeremy Allison
d28fa8faab Rename "allow_smb2" -> "using_smb2" and make the usage clearer. 2010-06-09 19:12:02 -07:00
Jeremy Allison
adf4833792 This patch looks bigger than it is. It does 2 things. 1). Renames smbpid -> smblctx in our locking code. 2). Widens smblctx to 64-bits internally. Preparing to use the SMB2 handle as the locking context.
Jeremy.
2010-05-07 06:20:50 -07:00
Jeremy Allison
4ad1943d29 Make us pass all SMB2 lock tests except MULTIPLE-UNLOCK and CONTEXT. Them next :-).
Jeremy.
2010-05-07 01:20:26 -07:00
Jeremy Allison
a77a8a5e35 Fix more SMB2 locking. We still crash but this won't last :-).
Jeremy.
2010-05-06 08:22:13 -07:00
Günther Deschner
c6ebab846d s3: only include gen_ndr headers where needed.
This shrinks include/includes.h.gch by the size of 7 MB and reduces build time
as follows:

ccache build w/o patch
real    4m21.529s
ccache build with patch
real    3m6.402s

pch build w/o patch
real    4m26.318s
pch build with patch
real    3m6.932s

Guenther
2010-05-06 00:22:59 +02:00
Jeremy Allison
62143543ce Fixed issue with return in a void function found by Björn JACKE <bj@SerNet.DE>
Jeremy.
2010-05-05 06:09:03 -07:00
Jeremy Allison
f4092ecec7 Plumb the SMB2 front end into the blocking lock backend.
Metze, you'll probably be happier with this work as it
doesn't abuse tevent in the way you dislike. This is a
first cut at the code, which will need lots of testing
but I'm hoping this will give people an idea of where I'm
going with this.

Jeremy.
2010-04-30 21:03:20 -07:00
Jeremy Allison
e90444319c Carefully label SMB1-specific locking calls.
Jeremy.
2010-04-29 17:08:12 -07:00
Jeremy Allison
ebf6340bb5 Move the global blocking lock records into the smb1 state.
Jeremy
2010-04-29 16:50:15 -07:00
Jeremy Allison
7984243768 Move to using 64-bit mid values in our internal open file database.
This will allow us to share logic much easier between SMB1 and SMB2
servers.

Jeremy
2010-04-12 21:40:28 -07:00
Jeremy Allison
e15939b456 Plumb SMB2 stubs into all the places we defer SMB1 operations.
Rename functions to be internally consistent. Next step is
to cope queueing single (non-compounded) SMB2 requests to
put some code inside the stubs.

Jeremy.
2010-04-09 19:26:34 -07:00
Jeremy Allison
08b24e923d Stop smb2 from calling into smb1 blocking lock request code.
Allocate a uint16_t internal SMB1 mid for an SMB2 request.
Add a back pointer from the faked up smb_request struct
to the smb2 request.

Getting ready to add restart code for blocking locks,
share mode violations and oplocks in SMB2.

Jeremy.
2010-04-08 22:15:55 -07:00
Steven Danneman
cb0ea27369 s3/smbd: change locking behavior when "lock spin time = 0".
The "lock spin time" parameter mimics the following Windows
setting which by default is 250ms in Windows and 200ms in Samba.

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\LockViolationDelay

When a client sends repeated, non-blocking, contending BRL requests
to a Windows server, after the first Windows starts treating these
requests as timed blocking locks with the above timeout.

As an efficiency, I've changed the behavior when this setting is 0,
to skip this logic and treat all requests as non-blocking locks.

This gives the smbd server behavior similar to the 3.0 release with
the do_spin_lock() implementation.

I've also changed the blocking lock parameter in the call from
push_blocking_lock_request() to true as all requests made in this
path are blocking by definition.
2010-02-12 21:29:00 -08:00
Jeremy Allison
b93f07ef41 Fix trailing whitespace errors I added (sorry).
Jeremy.
2010-02-05 22:51:11 -08:00
Andrew Tridgell
5b398edbee s3-brlock: add a minimim retry time for pending blocking locks
When we are waiting on a pending byte range lock, another smbd might
exit uncleanly, and therefore not notify us of the removal of the
lock, and thus not trigger the lock to be retried.

We coped with this up to now by adding a message_send_all() in the
SIGCHLD and cluster reconfigure handlers to send a MSG_SMB_UNLOCK to
all smbd processes. That would generate O(N^2) work when a large
number of clients disconnected at once (such as on a network outage),
which could leave the whole system unusable for a very long time (many
minutes, or even longer).

By adding a minimum re-check time for pending byte range locks we
avoid this problem by ensuring that pending locks are retried at a
more regular interval.
2010-02-05 22:17:17 -08:00
Jeremy Allison
9a2112ec66 Second part of the fix for bug 6828 - infinite timeout occurs when byte lock held outside of samba.
Fixes case where a connection with a pending lock can me marked "idle", and ensures
that the lock queue timeout is always recalculated.
Jeremy.
2009-10-26 21:20:22 -07:00