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

207 Commits

Author SHA1 Message Date
Volker Lendecke
9e40557047 r23999: Convert reply_open_and_X
This is an example of chained code that is executed in make test
(This used to be commit e3a10e9ffb)
2007-10-10 12:28:54 -05:00
Volker Lendecke
47cdfc0413 r23998: Convert reply_close to the new API
(This used to be commit dbf74cb747)
2007-10-10 12:28:54 -05:00
Volker Lendecke
cc6a41017c r23997: Check in the infrastructure for getting rid of the global InBuffer/OutBuffer
The complete history of this patch can be found under
http://www.samba.org/~vlendec/inbuf-checkin/.

Jeremy, Jerry: If possible I would like to see this in 3.2.0. I'm only
checking into 3_2 at the moment, as it currently will slow down operations for
all non-converted (i.e. all at this moment) operations, as it will copy the
talloc'ed inbuf over the global InBuffer. It will need quite a bit of effort
to convert everything necessary for the normal operations an XP box does.

I have patches for negprot, session setup, tcon_and_X, open_and_X, close. More
to come, but I would appreciate some help here.

Volker
(This used to be commit 5594af2b20)
2007-10-10 12:28:53 -05:00
Volker Lendecke
8579dd4ded r23990: Reformatting for 80 cols and trailing whitespace
(This used to be commit 0484de27d9)
2007-10-10 12:28:53 -05:00
Volker Lendecke
941db29ab4 r23988: Looks a lot more scary than it is: This just unwraps the else-branch of
if (smb_messages[type].fn == NULL) { into the function top-level. Makes
this function a bit easier to understand IMO.

Volker
(This used to be commit ada23b7f06)
2007-10-10 12:28:52 -05:00
Volker Lendecke
799c3ec8d4 r23987: Remove static pid in switch_message()
There's no point in duplicating functionality that exists in
sys_getpid() that also only used in a debug statement
(This used to be commit ebf1b1e97c)
2007-10-10 12:28:52 -05:00
Volker Lendecke
fa919f24f0 r23813: Remove unused global variable
(This used to be commit 3b811134c0)
2007-10-10 12:28:29 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
5391750ce6 r23725: Remove get_current_mid()
Jeremy, next one to review :-)
(This used to be commit a50555dda7)
2007-10-10 12:23:49 -05:00
Volker Lendecke
0bc56a2e5f r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_request
that contains some of the fields from the SMB header, removing the need
to access inbuf directly. This right now is used only in the open file
code & friends, and creating that header is only done when needed. This
needs more work, but it is a start.

Jeremy, I'm only checking this into 3_0, please review before I merge it
to _26.

Volker
(This used to be commit ca988f4e79)
2007-10-10 12:23:48 -05:00
Volker Lendecke
864cad1353 r23537: Revert the inbuf/outbuf part of r23528: This caused the Solaris CC make test
to break. The Solaris CC put the static char InBuffer[TOTAL_BUFFER_SIZE] on an
odd address, the malloc'ed one is always aligned. The problem showed up in
pull_ucs2, ucs2_align uses the address of InBuffer as an indication whether to
bump up the src of the string by one. Unfortunately in the trans calls the
data portion is malloced and thus has different alignment guarantees than a
static variable. This one is bigger....

Volker
(This used to be commit 6affd7818f)
2007-10-10 12:23:26 -05:00
Volker Lendecke
5e8a4c12f9 r23528: Two changes to make the valgrind massif (heap profiler) output readable:
Remove the allocated inbuf/output. In async I/O we copy the buffers
explicitly now, so NewInBuffer is called exactly once. This does not
reduce memory footprint, but removes one of the larger chunks that
clobber the rest of the massif output

In getgroups_unix_user on Linux 2.6 we allocated 64k groups x 4 bytes
per group x 2 (once in the routine itself and once in libc) = 512k just
to throw it away directly again. This reduces it do a more typical limit
of 32 groups per user. We certainly cope with overflow fine if 32 is not
enough. Not 100% sure about this one, a DEVELOPER only thing?
(This used to be commit 009af09099)
2007-10-10 12:23:26 -05:00
Volker Lendecke
ac3f08ddbe r23055: Rewrite messages.c to use auto-generated marshalling in the tdb. I'm
doing this because for the clustering the marshalling is needed in more
than one place, so I wanted a decent routine to marshall a message_rec
struct which was not there before.

Tridge, this seems about the same speed as it used to be before, the
librpc/ndr overhead in my tests was under the noise.

Volker
(This used to be commit eaefd00563)
2007-10-10 12:22:17 -05:00
Volker Lendecke
fad7dd8a60 r22868: Replace some message_send_pid calls with messaging_send_pid calls. More
tomorrow.
(This used to be commit 74fa57ca5d)
2007-10-10 12:22:04 -05:00
Volker Lendecke
bf7008abb8 r22695: Dummy checkin (reformatting) to make the AIX hosts retry.
(This used to be commit cd55ccef6a)
2007-10-10 12:21:46 -05:00
Volker Lendecke
fb56443427 r22691: Fix a 64-bit warning and a const const discard warning
(This used to be commit 3a2ca1b1b8)
2007-10-10 12:21:46 -05:00
Volker Lendecke
2541e0d590 r22458: Fix a comment
(This used to be commit f5ccec4228)
2007-10-10 12:19:34 -05:00
Jeremy Allison
0829e1ad1c r22391: Looks bigger than it is. Make "inbuf" available
to all callers of smb_setlen (via set_message()
calls). This will allow the server to reflect back
the correct encryption context.
Jeremy.
(This used to be commit 2d80a96120)
2007-10-10 12:19:30 -05:00
Jeremy Allison
dc90cd89a7 r22389: Start preparing for multiple encryption contexts in the
server. Allow server to reflect back to calling client
the encryption context that was sent.
Jeremy.
(This used to be commit b49e90335d)
2007-10-10 12:19:30 -05:00
Volker Lendecke
a633b42592 r22213: We can't use become_root() here, as it does DEBUG()
itself. become_root_uid_only did not :-)

Revert 21868, we need to find a better way.

Volker
(This used to be commit 629f966714)
2007-10-10 12:19:20 -05:00
Jeremy Allison
a098724734 r22145: Fix bug #4494 - reported by Kevin Jamieson <bugzilla@kevinjamieson.com>.
If returning a mapped UNIX error from sendfile, don't call chain_reply.
Jeremy.
(This used to be commit 38404c990d)
2007-10-10 12:19:16 -05:00
Volker Lendecke
496dbdf435 r21879: Move process_blocking_lock_queue to a timed event.
The idea is that we have blocking.c:brl_timeout as a timed
event that is present whenever we do have a blocking lock
pending. It fires brl_timeout_fn() which calls
process_blocking_lock_queue().

Whenever we make changes to blocking_lock_queue, we trigger
a recalc_brl_timeout() which sets a new brl_timout event if
necessary. This makes the call to
blocking_locks_timeout_ms() in setup_select_timeout()
unnecessary, this is implicitly done in
event_add_to_select_args() from the timed events.

Volker
(This used to be commit 7e31b8ce21)
2007-10-10 12:18:42 -05:00
Volker Lendecke
fe0b56ead1 r21871: Move deadtime processing into an idle event. While there, simplify
conn_idle_all() a bit.

Volker
(This used to be commit 3fc00977a9)
2007-10-10 12:18:41 -05:00
Volker Lendecke
c0e37a7496 r21870: Move sending auth_server keepalives out of the main loop into an idle event.
Volker
(This used to be commit 6226b30f38)
2007-10-10 12:18:41 -05:00
Volker Lendecke
7c2bc9c070 r21869: Move sending keepalives out of the main processing loop into idle event.
On the way, make lp_keepalive() a proper parameter.

Volker
(This used to be commit 9499fd9c80)
2007-10-10 12:18:41 -05:00
Volker Lendecke
8d0cfddb26 r21868: Remove check_log_size from the central smbd processing loop. This can be done
with a become_root/unbecome_root in debug.c.
(This used to be commit 4632a0caaf)
2007-10-10 12:18:41 -05:00
Volker Lendecke
2864d86b37 r21867: Simplify calling convention of timeout_processing. lp_deadtime is only
referenced in conn_idle_all().
(This used to be commit c0aaee6d36)
2007-10-10 12:18:40 -05:00
Volker Lendecke
0d91334fe7 r21784: Replace smb_register_idle_event() with event_add_timed(). This fixes winbind
who did not run the idle events to drop ldap connections.

Volker
(This used to be commit af3308ce5a)
2007-10-10 12:18:33 -05:00
Jeremy Allison
235b0f97f2 r21731: Fix long-standing bug in our chain processing code.
Should fix a bug with WinPE. Probably a candidate
for the Vista patchset.
Jeremy.
(This used to be commit ef32de6b59)
2007-10-10 12:18:26 -05:00
Volker Lendecke
fe881c3e38 r21278: The main goal of this was to get rid of the NetInBuffer / set_InBuffer. But it
turns out that this patch actually speeds up the async writes considerably.

I tested writing 100.000 times 65535 bytes with the allowed 10 ops in
parallel. Without this patch it took about 32 seconds on my dual-core 1.6GHz
laptop. With this patch it dropped to about 26 seconds. I can only explain it
by better cache locality, NewInBuffer allocates more than 128k, so we jump
around in memory more.

Jeremy, please check!

Volker
(This used to be commit 452d51bc6f)
2007-10-10 12:17:53 -05:00
Volker Lendecke
c59a49d83b r21184: Dummy checkin to let the build farm pick up r21183 of Samba4
(This used to be commit 22c9511314)
2007-10-10 12:17:46 -05:00
Jeremy Allison
14785319cc r21166: Ensure we return the correct "EROFS" error on a non-writable
filesystem.
Jeremy.
(This used to be commit 1e25501e8e)
2007-10-10 12:17:45 -05:00
Volker Lendecke
d5206610cd r20931: This changes the notify infrastructure from a polling-based to an event-driven
based approach. The only remaining hook into the backend is now

	void *(*notify_add)(TALLOC_CTX *mem_ctx,
			    struct event_context *event_ctx,
			    files_struct *fsp, uint32 *filter);

(Should we put this through the VFS, so that others can more easily plug in?)

The trick here is that the backend can pick filter bits that the main smbd
should not handle anymore. Thanks to tridge for this idea.

The backend can notify the main smbd process via

void notify_fsp(files_struct *fsp, uint32 action, char *name);

The core patch is not big, what makes this more than 1800 lines are the
individual backends that are considerably changed but can be reviewed
one by one.

Based on this I'll continue with inotify now.

Volker
(This used to be commit 9cd6a8a827)
2007-10-10 12:17:21 -05:00
Volker Lendecke
bf219447a3 r20846: Before this gets out of control...
This add a struct event_context and infrastructure for fd events to smbd. This
is step zero to import lib/events.

Jeremy, I rely on you to watch the change in receive_message_or_smb()
closely. For the normal code path this should be the only relevant change. The
rest is either not yet used or is cosmetic.

Volker
(This used to be commit cd07f93a8a)
2007-10-10 12:17:13 -05:00
Jeremy Allison
ab46f9cdd2 r20742: Rename chkpth -> checkpath for sanity's sake :-).
Start removing unneeded "BOOL ok" from this reply.c
(this logic is old, old, old..... :-).
Jeremy.
(This used to be commit 3d52268095)
2007-10-10 12:17:07 -05:00
Volker Lendecke
7a915ec3a6 r20700: In the main processing loop we select() on the fam socket. If it fires, it
might be possible that we hang in the receive_smb() although that socket is
not the reason for the select() to return.

This immediately reacts to the fam socket to become readable, and goes into
the select loop again. This fixes delays in files showing up in Windows.

Jeremy, James please review this and merge to 3_0_24 if appropriate.

Thanks,

Volker
(This used to be commit c846153b2e)
2007-10-10 12:17:04 -05:00
Volker Lendecke
ab7fc62edf r20432: Apply some const
(This used to be commit 22163fee59)
2007-10-10 12:16:49 -05:00
Stefan Metzmacher
258a465e20 r18605: sync dlinklist.h with samba4, that means DLIST_ADD_END()
and DLIST_DEMOTE() now take the type of the tmp pointer
not the tmp pointer itself anymore.

metze
(This used to be commit 2f58645b70)
2007-10-10 11:51:59 -05:00
Volker Lendecke
0be131725f r17569: Make 'max smbd processes' more robust. Counting on the child to decrement a
tdb entry is not the most reliable way to count children correctly.

This increments the number of children after a fork and decrements it upon
SIGCLD. I'm keeping a list of children just for consistency checks, so that we
at least get a debug level 0 message if something goes wrong.

Volker
(This used to be commit eb45de167d)
2007-10-10 11:38:39 -05:00
Jeremy Allison
b737f26764 r17105: Fix the race Volker found - we had a non-locked
region between detecting a pending lock was needed
and when we added the blocking lock record. Make
sure that we hold the lock over all this period.
Removed the old code for doing blocking locks on
SMB requests that never block (the old SMBlock
and friends).
Discovered something interesting about the strange
NT_STATUS_FILE_LOCK_CONFLICT return. If we asked
for a lock with zero timeout, and we got an error
of NT_STATUS_FILE_LOCK_CONFLICT, treat it as though
it was a blocking lock with a timeout of 150 - 300ms.
This only happens when timeout is sent as zero and
can be seen quite clearly in ethereal. This is the
real replacement for old do_lock_spin() code.
Re-worked the blocking lock select timeout to correctly
use milliseconds instead of the old second level
resolution (far too coarse for this work).
Jeremy.
(This used to be commit b81d6d1ae9)
2007-10-10 11:38:12 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
ce61fb21d9 r16397: Fix Klocwork #11767 and drasticly simplify the
logic in smbd/process.c. All interested (Volker,
Jerry, James etc). PLEASE REVIEW THIS CHANGE.
The logic should be identical but *much* easier
to follow and change (and shouldn't confuse Klockwork :-).
Jeremy.
(This used to be commit d357f8b335)
2007-10-10 11:18:52 -05:00
Volker Lendecke
b3a5633de0 r15495: current_user_info is not referenced in process.c
(This used to be commit 8cedbbfbcf)
2007-10-10 11:16:54 -05:00
Jeremy Allison
010c725b36 r15088: Remove all time() and gettimeofday() calls out of the mainline
packet processing code. Only do these when needed (ie. in the
idle timeout code). We drop an unneccessary global here too.
Jeremy.
(This used to be commit 8272a5ab06)
2007-10-10 11:16:22 -05:00
Jeremy Allison
cc203f3e59 r15084: Try and squeeze more out of the non-read/write code path.
Jeremy.
(This used to be commit 23dcff4d50)
2007-10-10 11:16:22 -05:00
Jeremy Allison
fc13f28417 r15030: On a performace hunt... Remove as many extraneous
memset's as possible.
Jeremy.
(This used to be commit 1217ed392b)
2007-10-10 11:15:58 -05:00
Jeremy Allison
eecdc6c956 r15022: Fix core dumps on normal server exit.
Jeremy.
(This used to be commit 13c3abf031)
2007-10-10 11:15:57 -05:00
Jeremy Allison
22dbd67708 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
(This used to be commit 08e52ead03)
2007-10-10 11:15:57 -05:00
James Peach
4fa5559800 r14898: This change is an attempt to improve the quality of the information that
is produced when a process exits abnormally.

First, we coalesce the core dumping code so that we greatly improve our
odds of being able to produce a core file, even in the case of a memory
fault. I've removed duplicates of dump_core() and split it in two to
reduce the amount of work needed to actually do the dump.

Second, we refactor the exit_server code path to always log an explanation
and a stack trace. My goal is to always produce enough log information
for us to be able to explain any server exit, though there is a risk
that this could produce too much log information on a flaky network.

Finally, smbcontrol has gained a smbd fault injection operation to test
the changes above. This is only enabled for developer builds.
(This used to be commit 56bc02d644)
2007-10-10 11:15:53 -05:00