summaryrefslogtreecommitdiffstats
path: root/source/locking/brlock.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix for very subtle POSIX lock interaction race condition found byJeremy Allison2003-04-041-1/+12
| | | | | | Herb. We need to unlock POSIX locks before notifying pending lock processes. Jeremy.
* Fix to allow blocking lock notification to be done rapidly (no waitJeremy Allison2003-02-271-6/+76
| | | | | | for smb -> smb lock release). Adds new PENDING_LOCK type to lockdb (does not interfere with existing locks). Jeremy.
* When checking is_locked() new WRITE locks conflict with existing READ locks evenJeremy Allison2003-02-221-3/+10
| | | | | if the context is the same. See LOCKTEST7 in smbtorture. Jeremy.
* Fix unused warnings with deleted code.Jeremy Allison2002-04-171-4/+23
| | | | Jeremy.
* disabled the traversal of the brlock database at startup andAndrew Tridgell2002-04-171-8/+0
| | | | | | | | | shutdown. I have just helped debug a very large Solaris server where the traversal was taking so long that the clients timed out, created a new process which in turn did a traversal! we will need to find some other way of doing a brlock.tdb cleanup (if its even needed at all)
* this attempts to handle the rather bizarre lock cache semantics inAndrew Tridgell2002-03-101-0/+14
| | | | w2k. It isn't entirely accurate, but its close
* accept the 0/0 lock but don't treat it in any sort of special wayAndrew Tridgell2002-03-051-1/+0
|
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
|
* move to SAFE_FREE()Simo Sorce2001-09-171-8/+8
|
* got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell2001-09-061-1/+1
|
* use NTSTATUS not BOOL in do_lock()Andrew Tridgell2001-09-061-9/+15
|
* converted smbd to use NTSTATUS by defaultAndrew Tridgell2001-08-271-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
* Don't use CLEAR_IF_FIRST if opening read-only.Jeremy Allison2001-08-261-1/+1
| | | | Jeremy.
* we now have all but the dreaded 0/0 lock workingAndrew Tridgell2001-08-241-30/+67
|
* this is a big global fix for the ptr = Realloc(ptr, size) bug.Simo Sorce2001-08-121-2/+4
| | | | | | many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also.
* Added "use mmap" for HPUX.Jeremy Allison2001-07-301-1/+1
| | | | Jeremy.
* Fixed the first locking error (test #8 found by locktest code fromJeremy Allison2001-06-301-3/+30
| | | | | Clarion locktest. Jeremy.
* use LDSHFLAGS not -shared in several placesAndrew Tridgell2001-06-041-1/+1
|
* Stupid typo. Should be if (!tdb).Jeremy Allison2001-05-231-1/+1
| | | | Jeremy.
* Defensive brlock and locking database cleaning code.Jeremy Allison2001-05-221-6/+43
| | | | Jeremy.
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-111-2/+0
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* Changed to sourceforge tdb code. This includes spinlocks (so we now haveJeremy Allison2000-12-061-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.
* Fix from John Reilly for equivalence tests.Jeremy Allison2000-11-171-1/+1
| | | | Jeremy.
* add some bracketsAndrew Tridgell2000-06-131-1/+1
|
* Using a structure for a tdb key can lead to insideous, hardHerb Lewis2000-05-101-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.
* Fix for uninitialized memory read in brlock code. brl_locktest now needsJeremy Allison2000-05-051-1/+2
| | | | | to correctly set the fnum, as the brl_conflict code looks at it. Jeremy.
* Fix based on Elrond's code to reduce the store size on removing dead records.Jeremy Allison2000-05-031-0/+1
| | | | Jeremy.
* - clear dead locks at startupAndrew Tridgell2000-05-031-2/+47
| | | | - fixed a bug which caused lock records to not decrease in size
* Fix for stacking locks in brlock and POSIX. Windows only allows a read lockJeremy Allison2000-05-031-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.
* Ok - this is the *third* implementation of this (third time's the charm :-).Jeremy Allison2000-04-281-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.
* Ok - this is more subtle than it looks :-).Jeremy Allison2000-04-271-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.
* Fixed subtle unlocking bug when a file is closed. We need to store theJeremy Allison2000-04-271-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.
* Added the hard code :-).Jeremy Allison2000-04-251-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.
* 1) added void* state argument to tdb_traverse. guess what! there wereLuke Leighton2000-02-041-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.
* added code to allow traversal of the byte range lock databaseAndrew Tridgell2000-01-161-2/+42
| | | | this is used with "smbstatus -B" to dump the lock list
* damn, Solaris already has a "enum lock_type"Andrew Tridgell2000-01-141-4/+5
| | | | changed it to "enum brl_type"
* we now pass all byte range locking testsAndrew Tridgell2000-01-141-2/+57
| | | | | the last piece was to use a smb timeout slightly larger than the locking timeout in bloking locks to prevent a race
* the bulk of the new byte range locking coodeAndrew Tridgell2000-01-131-0/+275
it doesn't map to posix locks yet, that will come later.