summaryrefslogtreecommitdiff
path: root/source3/locking/locking.c
AgeCommit message (Collapse)AuthorFilesLines
2007-11-18Add a commentVolker Lendecke1-1/+7
(This used to be commit 144014096a41de293ce7ec15f82681a469dd3aa1)
2007-11-18Fix a valgrind errorVolker Lendecke1-3/+4
(This used to be commit b82120f9b7f5aad83d8b4ece0261e9693eedca0c)
2007-11-15Add MAX_DNS_NAME_LENGTH, remove more pstrings.Jeremy Allison1-9/+9
Jeremy. (This used to be commit a1725f4ff7ed375808c78ac661b539557748d0a5)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-26/+26
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r25055: Add file_id_string_tosVolker Lendecke1-2/+2
This removes file_id_string_static and file_id_string_static2 (This used to be commit 638c848c9afe374feb30e34c494f89b2a6c64f7b)
2007-10-10r24266: Remove the "open files database hash size" parameterVolker Lendecke1-2/+1
This has been superseded by the "tdb_hashsize:<tdbname>" parameter (This used to be commit df40d336afd256f05a0ec3724cc2096fb7114d81)
2007-10-10r24117: use locking_key() instead of forming the TDB_DATA keyStefan Metzmacher1-4/+1
by hand metze (This used to be commit a7449e4ab390b3c1d9d5a0bbc466f71de17918e0)
2007-10-10r23956: merge from 3_2-ctdb-tridge:Stefan Metzmacher1-0/+8
fixed a bug with dead share mode entries jra: please tell me if it's ok to merge this to 3_2_0. metze (This used to be commit 044ac6afa7a36b352f4cb203879af082d4726417)
2007-10-10r23908: Fix bug with interaction of optimization withJeremy Allison1-8/+24
POSIX locking. We can't do lock counts with POSIX, so stop counting if we get a POSIX lock request. Jeremy. (This used to be commit a48e4a29e6774e5e72b9b361a17207b053474521)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23510: Tidy calls to smb_panic by removing trailing newlines. Print theJames Peach1-12/+12
failed expression in SMB_ASSERT. (This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713)
2007-10-10r23486: Ok, this time with a hopefully successful make test in the right place:Volker Lendecke1-4/+0
Remove two local variables (This used to be commit 575e594e936c3cb197945063309f0b424dcdefc8)
2007-10-10r23222: share_mode_forall() is only for counting and status display stuff, soVolker Lendecke1-1/+1
traverse_read is enough here (This used to be commit 40991badef046233326815e50097aa7f493790e8)
2007-10-10r23183: Check in a change made by Tridge:Volker Lendecke1-51/+35
This replaces the internal explicit dev/ino file id representation by a "struct file_id". This is necessary as cluster file systems and NFS don't necessarily assign the same device number to the shared file system. With this structure in place we can now easily add different schemes to map a file to a unique 64-bit device node. Jeremy, you might note that I did not change the external interface of smb_share_modes.c. Volker (This used to be commit 9b10dbbd5de8813fc15ebbb6be9b18010ffe8139)
2007-10-10r23164: Minor cosmetic checkinVolker Lendecke1-2/+2
(This used to be commit 8de1ac9fadb1b0dcac28eef32f7826e9e3a7eca4)
2007-10-10r23163: Convert locking.tdb to dbwrapVolker Lendecke1-91/+109
(This used to be commit afe90224bf151acf6c7be8974408f79cfd459dbf)
2007-10-10r23162: Make use of messaging_send_bufVolker Lendecke1-4/+2
(This used to be commit 3f8186fe85a897b104cd825a005333259d6d008b)
2007-10-10r23100: Implement the delete on close semantics I've just tested forJeremy Allison1-1/+45
in Samba4 smbtorture. Fix rename on an open file handle. Needed for 3.0.25a. Jeremy. (This used to be commit a301467d5f645dada27093ddfd74890b88bb4ce8)
2007-10-10r23014: For all branches, ensure that if we're blocked on a POSIXJeremy Allison1-2/+4
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. (This used to be commit fa18fc25a50cf13c687ae88e7e5e2dda1120e017)
2007-10-10r22846: Chunk one to replace message_send_pid with messaging_send: Deep insideVolker Lendecke1-9/+17
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. (This used to be commit bbb508414683eeddd2ee0d2d36fe620118180bbb)
2007-10-10r22542: Move over to using the _strict varients of the tallocJeremy Allison1-1/+1
calls. No functional changes. Looks bigger than it is :-). Jeremy. (This used to be commit f6fa3080fee1b20df9f1968500840a88cf0ee592)
2007-10-10r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher1-10/+10
and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
2007-10-10r21726: Fix stupid cut-n-paste typo. Thanks to volker forJeremy Allison1-1/+1
being on the ball..... :-). Jeremy. (This used to be commit 84ed7bcbe6dc14b18a7e913b153c82da1856a835)
2007-10-10r21724: Optimization pointed out by Volker. If we don'tJeremy Allison1-0/+20
have any outstanding locks or blocking locks then we don't need to read the lock db. on close. Jeremy. (This used to be commit 1b063496f93f78347a6e67549bde54c845499a7d)
2007-10-10r21723: Make use of the per-hashchain "freelists"Volker Lendecke1-0/+3
(This used to be commit f3421ae4cfa263c0e7a8e934b40342ee9885d239)
2007-10-10r21706: get_delete_on_close_flag() is the perfect candidate for ↵Volker Lendecke1-7/+21
tdb_parse_record() (This used to be commit b73685d20751ac343faab79332552cd7ee92d831)
2007-10-10r21257: Better fix for bug #4188 :Jeremy Allison1-36/+1
Windows Vista RC1 and RC2 can't delete directory on Samba share based on work by Joe Meadows <jmeadows@webopolis.com>. Jeremy. (This used to be commit 2dab8928769938ab79da7b7ce2d165fc388f9b00)
2007-10-10r21191: Add in the POSIX open/mkdir/unlink calls.Jeremy Allison1-3/+6
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. (This used to be commit 83dbbdff345fa9e427c9579183f4380004bf3dd7)
2007-10-10r20916: Add in the delete on close final fix - but only enabledJeremy Allison1-0/+4
with -DDEVELOPER. Jeremy. (This used to be commit 7f817067a70930ee3502ea3373173e0c23733253)
2007-10-10r20883: W00t! I now understand how "delete on close" reallyJeremy Allison1-23/+16
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. (This used to be commit f2df77a1497958c1ea791f1d2f4446b5fc3389b3)
2007-10-10r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.Jeremy Allison1-0/+40
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. (This used to be commit 029635885825a5562e7974a6f5675cce3bf1b5dc)
2007-10-10r19668: Convert the locking params to use struct share_param instead of snumVolker Lendecke1-8/+7
(This used to be commit 609dbec600048718b86cd1ecdc2ce49bbdeb803c)
2007-10-10r19078: talloc_strdup can failVolker Lendecke1-0/+6
(This used to be commit 2b3b9ce2a122ec5fd945728c117c321087d85203)
2007-10-10r17924: Get rid of warnings now that talloc is merged.Volker Lendecke1-3/+1
Destructors now take a pointer to the "real" destroyed object as an argument. Volker (This used to be commit 70edd716ef0ccb218fe18d1233bd30abe46b62bf)
2007-10-10r17346: Add optimisation vl needs for the cluster code whereJeremy Allison1-3/+3
we don't get the chainlock when getting the byte range lock record read-only. Jeremy. (This used to be commit fcd798ca0c1b76adb2bcda4a99c40c7aacb0addb)
2007-10-10r17314: Optimisation for POSIX locking. If we're downgradingJeremy Allison1-2/+4
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. (This used to be commit a7a0b6ba50f4cf7c5a0a29809fdff9e1266a29e7)
2007-10-10r17293: After the results from the cluster tests in Germany,Jeremy Allison1-2/+0
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. (This used to be commit 4ace291278d9a44f5c577bdd3b282c1231e543df)
2007-10-10r17177: Get rid of a global variable by adding a private data pointer toVolker Lendecke1-5/+22
share_mode_forall(). Volker (This used to be commit f97f6cedffdc4d10afcac90a163b93a801acf514)
2007-10-10r17105: Fix the race Volker found - we had a non-lockedJeremy Allison1-10/+12
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 b81d6d1ae95a3d3e449dde629884b565eac289d9)
2007-10-10r17098: Samba3 now cleanly passes Samba4 RAW-LOCK tortureJeremy Allison1-56/+46
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. (This used to be commit f1a9cf075b87c76c032d19da0168424c90f6cb3c)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-48/+39
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16661: Fix from jason@ncac.gwu.edu for bug #3875,Jeremy Allison1-1/+1
bad cast warning. Jeremy. (This used to be commit d60e6e0abc17361fe180d6723b970552dc377741)
2007-10-10r16435: Add in the uid info that Jerry needs into theJeremy Allison1-9/+14
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. (This used to be commit d929323d6f513902381369d77bcd7b714346d713)
2007-10-10r16281: Start fixing up gcc4 -O6 warnings on an x86_64 box. size_t != unsignedJeremy Allison1-1/+1
int in a format string. Jeremy. (This used to be commit c49ad9200bf3fdd8b9404d93182c2e04e662190a)
2007-10-10r15943: Update misleading DEBUG statements and comments that refer toJames Peach1-1/+1
open_file_shared. (This used to be commit 784126edff942d1c2f79f7c9feb59980426f331e)
2007-10-10r15670: Fix valgrind-spotted issue in BASE-DELETE test.Jeremy Allison1-0/+1
We were forgetting to increment after copying the primary group gid. Jeremy (This used to be commit 31d16c434e1ee94691f013ed0b31d9f26baeb2cb)
2007-10-10r15668: DOS or FCB opens share one share mode entry from differentJeremy Allison1-16/+7
fsp pointers. Ensure we cope with this to pass Samba4 DENY tests (we used to pass these, there must have been a regression with newer code). We now pass them. Jeremy (This used to be commit fd6fa1d4eaf61783df74ee2da50d331477f06998)
2007-10-10r15083: Using talloc with destructors is nice and all, but in thisJeremy Allison1-12/+12
case it's in a performace critical path and it *hurts* us. Go back to plain malloc/free with an explicit destructor call. Jeremy. (This used to be commit 1c99aed563c29e1b3d70939878af747a0660bfec)
2007-10-10r15018: Merge Volker's ipc/trans2/nttrans changes overJeremy Allison1-118/+187
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 08e52ead03304ff04229e1bfe544ff40e2564fc7)