summaryrefslogtreecommitdiffstats
path: root/source/locking/brlock.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.