summaryrefslogtreecommitdiff
path: root/source3/locking/brlock.c
AgeCommit message (Collapse)AuthorFilesLines
2003-10-09Changes to allow Samba3 to pass the Samba4 RAW-READ tests.Jeremy Allison1-2/+7
Jeremy. (This used to be commit e7565dbba696adbb0fd8cca6b86a1a7e5a655f2e)
2003-04-04Fix for very subtle POSIX lock interaction race condition found byJeremy Allison1-1/+12
Herb. We need to unlock POSIX locks before notifying pending lock processes. Jeremy. (This used to be commit 6999eef51c3e597b3b2cd9cc26138acdfbb6a23a)
2003-02-27Fix to allow blocking lock notification to be done rapidly (no waitJeremy Allison1-6/+76
for smb -> smb lock release). Adds new PENDING_LOCK type to lockdb (does not interfere with existing locks). Jeremy. (This used to be commit 766928bbba1e597c9c2b12458dd8d37e6080593e)
2003-02-22When checking is_locked() new WRITE locks conflict with existing READ locks evenJeremy Allison1-3/+10
if the context is the same. See LOCKTEST7 in smbtorture. Jeremy. (This used to be commit 1698092ba5a169de369ad1182a6f270de174c3f5)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-6/+17
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-03-10this attempts to handle the rather bizarre lock cache semantics inAndrew Tridgell1-0/+14
w2k. It isn't entirely accurate, but its close (This used to be commit e02d7364707c4939efa4ff0ddf9b6d4f48e5d411)
2002-03-05accept the 0/0 lock but don't treat it in any sort of special wayAndrew Tridgell1-1/+0
(This used to be commit 8f7bf38de16a1f5316aa6a413fb697c43862c4c6)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter1-2/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-17move to SAFE_FREE()Simo Sorce1-8/+8
(This used to be commit e61aec84edaf55b9ee087b076d2f1311033dc839)
2001-09-06got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell1-1/+1
(This used to be commit c26e0d3f27a05ecc8bd2390f9aab7f9451524e47)
2001-09-06use NTSTATUS not BOOL in do_lock()Andrew Tridgell1-9/+15
(This used to be commit b1b2a5fa5d084dad8ae47777419ab75db1e51eff)
2001-08-27converted smbd to use NTSTATUS by defaultAndrew Tridgell1-11/+60
major changes include: - added NSTATUS type - added automatic mapping between dos and nt error codes - changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT() these calls auto-translate to the client error code system - got rid of the cached error code and the writebmpx code We eventually will need to also: - get rid of BOOL, so we don't lose error info - replace all ERROR_DOS() calls with ERROR_NT() calls but that is too much for one night (This used to be commit 83d9896c1ea8be796192b51a4678c2a3b87f7518)
2001-08-26Don't use CLEAR_IF_FIRST if opening read-only.Jeremy Allison1-1/+1
Jeremy. (This used to be commit f5ba19c12989dd1e996473869468afcfc5dce72e)
2001-08-24we now have all but the dreaded 0/0 lock workingAndrew Tridgell1-30/+67
(This used to be commit 98b6aef18c793187f392f944af516c8b9ebf86e9)
2001-08-12this is a big global fix for the ptr = Realloc(ptr, size) bug.Simo Sorce1-2/+4
many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also. (This used to be commit fa8e55b8b465114ce209344965c1ca0333b84db9)
2001-07-30Added "use mmap" for HPUX.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 840802f10677cb0009cb4df4c37c7d01aa5edacd)
2001-06-30Fixed the first locking error (test #8 found by locktest code fromJeremy Allison1-3/+30
Clarion locktest. Jeremy. (This used to be commit 5c42845b5bb6fafd0ebf93fbdd23d9bf861da865)
2001-06-04use LDSHFLAGS not -shared in several placesAndrew Tridgell1-1/+1
(This used to be commit 8ec9c87b5d1a7dae17d5b1a30f58effaf5e69e4b)
2001-05-23Stupid typo. Should be if (!tdb).Jeremy Allison1-1/+1
Jeremy. (This used to be commit d3496897f167a8deb1d0034797e8b29f2c51acef)
2001-05-22Defensive brlock and locking database cleaning code.Jeremy Allison1-6/+43
Jeremy. (This used to be commit d7aa42e4593b02ee6e487f7a4633bd7e7620ef2f)
2001-03-11Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison1-2/+0
RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy. (This used to be commit 0be41d5158ea4e645e93e8cd30617c038416e549)
2000-12-06Changed to sourceforge tdb code. This includes spinlocks (so we now haveJeremy Allison1-13/+13
a --with-spinlocks option to configure, this does mean the on-disk tdb format has changed, so 2.2alphaX sites will need to re-create their tdb's. The upside is no more tdb fragmentation and a +5% on netbench. Swings and roundabouts.... Jeremy. (This used to be commit 9dea7b7c257db487f8ced7dad3fce92fba03ea91)
2000-11-17Fix from John Reilly for equivalence tests.Jeremy Allison1-1/+1
Jeremy. (This used to be commit b456274a7ba22d512bab5ede979cd9363398825b)
2000-06-13add some bracketsAndrew Tridgell1-1/+1
(This used to be commit bf67721ef5cc6d5ad1762fca320ef612025b4593)
2000-05-10Using a structure for a tdb key can lead to insideous, hardHerb Lewis1-20/+21
to find bugs. On 64 bit IRIX, structure packing means that a struct { SMB_DEV_T dev /* 4 bytes */ SMB_INO_T ino /* 8 bytes */ } has 4 bytes of padding between the two members. If you don't null the memory before using it as a tdb key, you randomly can't find keys depending on what is in the padding. This caused me immense pain and was hard to track down.... :-) Jeremy. (This used to be commit f2a5ba3f0939f59097f0ef6a25f1cf9b5574f157)
2000-05-05Fix for uninitialized memory read in brlock code. brl_locktest now needsJeremy Allison1-1/+2
to correctly set the fnum, as the brl_conflict code looks at it. Jeremy. (This used to be commit df87259a356b91989604a10b3691480dcd16cf3f)
2000-05-03Fix based on Elrond's code to reduce the store size on removing dead records.Jeremy Allison1-0/+1
Jeremy. (This used to be commit 09e92a61a966d09f543ba541ddb3240cc4718579)
2000-05-03- clear dead locks at startupAndrew Tridgell1-2/+47
- fixed a bug which caused lock records to not decrease in size (This used to be commit 51624a3a2f5a4ac55b4f26f572a2fc399f9c808e)
2000-05-03Fix for stacking locks in brlock and POSIX. Windows only allows a read lockJeremy Allison1-1/+1
to overlay a write lock on the same fnum. When overlaying read locks onto a write lock, the number of locks is counted, and the first unlock removes the write lock and downgrades this to a read lock. Do the same when mapping to POSIX. Jeremy. (This used to be commit 74d42644e6e52808037975e909aa56c850838b76)
2000-04-28Ok - this is the *third* implementation of this (third time's the charm :-).Jeremy Allison1-295/+1
This implementation keeps all POSIX lock records in a separate in memory tdb database only known about in locking/posix.c. In addition, the pending close fd's are also held in a tdb which has an array of fd's indexed by device and inode. The walk-split code uglyness has been moved to posix.c from brlock.c, which is the only place that needs to know about it, and the extra functions hacked into brlock to expose internal state have been removed. This implementation passes smbtorture locktest4, the only thing I need to check now for completeness is what to do about lock upgrade/downgrades which Win32 allows under some *very* strange circumstances. Jeremy. (This used to be commit 3f655de1c764b9ee1472a111621d4317f19f624d)
2000-04-27Ok - this is more subtle than it looks :-).Jeremy Allison1-0/+2
When a file is being closed, once it passes the fnum and tid tests then the locking context should be ignored when removing all locks. This is what is done in the brl close case, but when you have outstanding POSIX locks, then you cannot remove all the brl locks in one go, you have to get the lock list and call do_unlock individually. As this uses global_smbpid as the locking context, you need to make sure that this is set correctly for the specific lock being removed. I now do this by storing the smbpid in each entry in the unlock list returned from the query call. I removed the smbpid from fsp (not needed) and things seem ok (even with the stupid smbpid tricks that smbtorture plays :-). Jeremy. (This used to be commit 6baa96bb466915cc17e8cbad50254d6bd47b967b)
2000-04-27Fixed subtle unlocking bug when a file is closed. We need to store theJeremy Allison1-10/+27
smbpid used when a file was opened in the files_struct. Else we use the wrong global_smbpid when we are closing the file and trying to remove the brl locks - this causes the brl locks to be left when the file is closed as the samba_context check fails. Jeremy. (This used to be commit 2746e5602e493e5b022764b4b839eb4d2f14363b)
2000-04-25Added the hard code :-).Jeremy Allison1-27/+332
HEAD should now map brl locks correctly into POSIX locks, including the really nasty case of large range unlock. There is a lot of pretty ASCII art in locking/brlock.c explaining exactly how this code works. If it is unclear, please ask me. Jeremy. (This used to be commit 135855dbd3b8934a49229b81646cd4469acba926)
2000-02-041) added void* state argument to tdb_traverse. guess what! there wereLuke Leighton1-10/+5
two places i found where it was appropriate to _use_ that third argument, in locking.c and brlock.c! there was a static traverse_function and i removed the static variable, typecast it to a void*, passed it to tdb_traverse and re-cast it back to the traverse_function inside the tdb_traverse function. this makes the use of tdb_traverse() reentrant, which is never going to happen, i know, i just don't like to see statics lying about when there's no need for them. as i had to do in samba-tng, all uses of tdb_traverse modified to take the new void* state argument. 2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient. i don't know how the other samba team members would react if i deleted rpcclient from cvs main. damn, that code's so old, it's unreal. 20 rpcclient commands, instead of about 70 in SAMBA_TNG. (This used to be commit 49d7f0afbc1c5425d53019e234d54ddf205c8e9a)
2000-01-16added code to allow traversal of the byte range lock databaseAndrew Tridgell1-2/+42
this is used with "smbstatus -B" to dump the lock list (This used to be commit 5f022629146701e6d543f77007dc944e4277ab0c)
2000-01-14damn, Solaris already has a "enum lock_type"Andrew Tridgell1-4/+5
changed it to "enum brl_type" (This used to be commit 6b9ee7662c7afa70f6b20889e6b0ae1dcd677f9f)
2000-01-14we now pass all byte range locking testsAndrew Tridgell1-2/+57
the last piece was to use a smb timeout slightly larger than the locking timeout in bloking locks to prevent a race (This used to be commit 1b54cb4a33a65e62c2e3189b78ef073869a60c75)
2000-01-13the bulk of the new byte range locking coodeAndrew Tridgell1-0/+275
it doesn't map to posix locks yet, that will come later. (This used to be commit 7f2a493095887cb0aae915ac36b9cded71d3a7a7)