1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-18 19:17:08 +03:00

380 Commits

Author SHA1 Message Date
Volker Lendecke
3da3086dbf r23169: Merge 535 of Tridge's bzr tree:
store the right data after cleaning lock records. This fixes
  RAW-BENCH-LOCK after a recovery on a cluster
2007-10-10 12:22:51 -05:00
Volker Lendecke
84f9885cf8 r23165: Convert brlock.tdb to dbwrap 2007-10-10 12:22:50 -05:00
Volker Lendecke
8de1ac9fad r23164: Minor cosmetic checkin 2007-10-10 12:22:50 -05:00
Volker Lendecke
afe90224bf r23163: Convert locking.tdb to dbwrap 2007-10-10 12:22:50 -05:00
Volker Lendecke
3f8186fe85 r23162: Make use of messaging_send_buf 2007-10-10 12:22:50 -05:00
Jeremy Allison
a301467d5f r23100: Implement the delete on close semantics I've just tested for
in Samba4 smbtorture. Fix rename on an open file handle.
Needed for 3.0.25a.
Jeremy.
2007-10-10 12:22:46 -05:00
James Peach
853f41edb8 r23096: Make the lock failure message prettier. 2007-10-10 12:22:45 -05:00
Jeremy Allison
fa18fc25a5 r23014: For all branches, ensure that if we're blocked on a POSIX
lock we know nothing about that we retry the lock every
10 seconds instead of waiting for the standard select
timeout. This is how we used to (and are supposed to)
work.
Jeremy.
2007-10-10 12:22:15 -05:00
Volker Lendecke
bbb5084146 r22846: Chunk one to replace message_send_pid with messaging_send: Deep inside
locking/locking.c we have to send retry messages to timed lock holders.
The majority of this patch passes a "struct messaging_context" down
there. No functional change, survives make test.
2007-10-10 12:22:02 -05:00
Volker Lendecke
0ad4b1226c r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch.
This changes "struct process_id" to "struct server_id", keeping both is
just too much hassle. No functional change (I hope ;-))

Volker
2007-10-10 12:21:52 -05:00
Volker Lendecke
8e0e278961 r22688: Change lock_data in struct byte_range_lock from void * to struct lock_struct * 2007-10-10 12:21:46 -05:00
Jeremy Allison
8ad13718af r22588: Make all uses of TALLOC_MEMDUP consistent.
Jeremy.
2007-10-10 12:19:48 -05:00
Jeremy Allison
f6fa3080fe r22542: Move over to using the _strict varients of the talloc
calls. No functional changes. Looks bigger than it is :-).
Jeremy.
2007-10-10 12:19:44 -05:00
Stefan Metzmacher
3a28443079 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
2007-10-10 12:19:00 -05:00
Jeremy Allison
84ed7bcbe6 r21726: Fix stupid cut-n-paste typo. Thanks to volker for
being on the ball..... :-).
Jeremy.
2007-10-10 12:18:26 -05:00
Jeremy Allison
1b063496f9 r21724: Optimization pointed out by Volker. If we don't
have any outstanding locks or blocking locks then
we don't need to read the lock db. on close.
Jeremy.
2007-10-10 12:18:26 -05:00
Volker Lendecke
f3421ae4cf r21723: Make use of the per-hashchain "freelists" 2007-10-10 12:18:25 -05:00
Volker Lendecke
b73685d207 r21706: get_delete_on_close_flag() is the perfect candidate for tdb_parse_record() 2007-10-10 12:18:24 -05:00
Jeremy Allison
2dab892876 r21257: Better fix for bug #4188 :
Windows Vista RC1 and RC2 can't delete directory on Samba share
based on work by Joe Meadows <jmeadows@webopolis.com>.
Jeremy.
2007-10-10 12:17:51 -05:00
Jeremy Allison
83dbbdff34 r21191: Add in the POSIX open/mkdir/unlink calls.
Move more error code returns to NTSTATUS.
Client test code to follow... See if this
passes the build-farm before I add it into
3.0.25.
Jeremy.
2007-10-10 12:17:47 -05:00
Jeremy Allison
7f817067a7 r20916: Add in the delete on close final fix - but only enabled
with -DDEVELOPER.
Jeremy.
2007-10-10 12:17:19 -05:00
Jeremy Allison
f2df77a149 r20883: W00t! I now understand how "delete on close" really
works - even with the strange "initial delete on close"
semantics. The "initial delete on close" flag isn't
committed to the share mode db until the handle is
closed, and is discarded if any real "delete on close"
was set. This allows me to remove the "initial_delete_on_close"
flag from the share db, and move it into a BOOL in files_struct.
Warning ! You must do a make clean after this. Cope with
the wrinkle in directory delete on close which is done
differently from files. We now pass all Samba4 smbtortute
BASE-DELETE tests except for the one checking that files
can't be created in a directory which has the delete on
close set (possibly expensive to fix).
Jeremy.
2007-10-10 12:17:18 -05:00
Jeremy Allison
0296358858 r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.
Allow us to correctly refuse to set delete on close on a
non-empty directory. There are still some delete-on-close
wrinkles to be fixed, but I understand how to do that better
now. I'll fix this tomorrow.
Jeremy.
2007-10-10 12:17:16 -05:00
Volker Lendecke
609dbec600 r19668: Convert the locking params to use struct share_param instead of snum 2007-10-10 12:15:46 -05:00
Volker Lendecke
2b3b9ce2a1 r19078: talloc_strdup can fail 2007-10-10 12:15:09 -05:00
Volker Lendecke
70edd716ef r17924: Get rid of warnings now that talloc is merged.
Destructors now take a pointer to the "real" destroyed object as an argument.

Volker
2007-10-10 11:38:59 -05:00
Volker Lendecke
e4b8c79a9d r17452: Some C++ warnings 2007-10-10 11:38:34 -05:00
Jeremy Allison
fcd798ca0c r17346: Add optimisation vl needs for the cluster code where
we don't get the chainlock when getting the byte range
lock record read-only.
Jeremy.
2007-10-10 11:38:27 -05:00
Jeremy Allison
a7a0b6ba50 r17314: Optimisation for POSIX locking. If we're downgrading
a POSIX lock (applying a read-lock) and we overlap
pending read locks then send them an unlock message,
we may have allowed them to proceed.
Jeremy.
2007-10-10 11:38:25 -05:00
Jeremy Allison
4ace291278 r17293: After the results from the cluster tests in Germany,
fix the messaging code to call the efficient calls :

save_re_uid()
set_effective_uid(0);

messaging_op

restore_re_uid();

instead of using heavyweight become_root()/unbecome_root()
pairs around all messaging code. Fixup the messaging
code to ensure sec_init() is called (only once) so that non-root
processes still work when sending messages.

This is a lighter weight solution to become_root()/unbecome_root()
(which swaps all the supplemental groups) and should be more
efficient. I will migrate all server code over to using this
(a similar technique should be used in the passdb backend
where needed).

Jeremy.
2007-10-10 11:38:24 -05:00
Volker Lendecke
afa6e90946 r17279: conn->cnum is the tid we've given to the client. This has nothing to do with
our internal share number.

Funny that it worked at all :-)

Volker
2007-10-10 11:38:23 -05:00
Jeremy Allison
42dec2192c r17276: Don't change the POSIX lock ref count if posix locking = no.
Jeremy.
2007-10-10 11:38:23 -05:00
Jeremy Allison
2c82a159ae r17181: Fix the build farm RAW-READ bug. When making a copy
of the lock array in order to delete them individually
it's also important to make a copy of the *size* of
this array. Otherwise the unlock decrements the termination
index of your for loop :-). Doh ! Big thanks to Volker
for showing me how to set up the build farm to track
this one down. This is not a 3.0.23a issue.
Jeremy.
2007-10-10 11:38:18 -05:00
Volker Lendecke
f97f6cedff r17177: Get rid of a global variable by adding a private data pointer to
share_mode_forall().

Volker
2007-10-10 11:38:17 -05:00
Jeremy Allison
b81d6d1ae9 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.
2007-10-10 11:38:12 -05:00
Jeremy Allison
f1a9cf075b r17098: Samba3 now cleanly passes Samba4 RAW-LOCK torture
test. Phew - that was painful :-). But what it means
is that we now implement lock cancels and I can add
lock cancels into POSIX lock handling which will fix
the fast/slow system call issue with cifsfs !
Jeremy.
2007-10-10 11:38:11 -05:00
Jeremy Allison
a8df1863bf r17046: Ensure we're using the right pointers ...
Jeremy.
2007-10-10 11:19:22 -05:00
Jeremy Allison
1201383e7a r17043: Fix memleak when processing CIFS POSIX lock/unlock
requests. Maybe the Linux kernel OOM killer will
be kinder to smbd now :-). Back to tdbtorture
tests on cifsfs.
Jeremy.
2007-10-10 11:19:21 -05:00
Jeremy Allison
43d24fbd41 r17041: Trying to track down a *big* memory leak in the new lock code.
Fix a small one first.... (easy to valgrind).
Jeremy
2007-10-10 11:19:21 -05:00
Jeremy Allison
2f8cabe98d r17000: Allow CIFS POSIX locks to coexist with Windows locks.
We shouldn't allow this on the same smbd, but the cifsfs
client negotiates POSIX locks then sends Windows ones.
Doh ! Can't fix shipped client code....
Jeremy.
2007-10-10 11:19:17 -05:00
Jeremy Allison
f11933b3ac r16992: Fix bug #3922 reported by jason@ncac.gwu.edu, correctly
look at the return code.
Jeremy.
2007-10-10 11:19:17 -05:00
Jeremy Allison
edd72d37de r16987: Fix the logic errors in ref-counting Windows locks.
Hopefully will fix the build farm. Still a few errors
in RAW-LOCK to look at though...
Jeremy.
2007-10-10 11:19:16 -05:00
Jeremy Allison
53094435d8 r16973: Fix subtle logic error in lock ref counting found by
cifsfs client code.
Jeremy.
2007-10-10 11:19:16 -05:00
Jeremy Allison
9dafb7f48c 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.
2007-10-10 11:19:14 -05:00
Jeremy Allison
d60e6e0abc r16661: Fix from jason@ncac.gwu.edu for bug #3875,
bad cast warning.
Jeremy.
2007-10-10 11:19:06 -05:00
Jeremy Allison
d929323d6f r16435: Add in the uid info that Jerry needs into the
share_mode struct. Allows us to know the unix
uid of the opener of the file/directory. Needed
for info level queries on open files.
Jeremy.
2007-10-10 11:18:54 -05:00
Jeremy Allison
e8d86362ba r16307: Make sure we know we must pass a valid pointer here.
Klocwork #1129.
Jeremy.
2007-10-10 11:17:32 -05:00
Jeremy Allison
c49ad9200b r16281: Start fixing up gcc4 -O6 warnings on an x86_64 box. size_t != unsigned
int
in a format string.
Jeremy.
2007-10-10 11:17:30 -05:00
James Peach
784126edff r15943: Update misleading DEBUG statements and comments that refer to
open_file_shared.
2007-10-10 11:17:14 -05:00
Jeremy Allison
31d16c434e r15670: Fix valgrind-spotted issue in BASE-DELETE test.
We were forgetting to increment after copying
the primary group gid.
Jeremy
2007-10-10 11:17:06 -05:00