summaryrefslogtreecommitdiffstats
path: root/source/locking
Commit message (Collapse)AuthorAgeFilesLines
* sync with SAMBA_2_2 for 2.2.6rc1Gerald Carter2002-10-091-1/+1
|
* beginning to sync up for 2.2.5 release....Gerald Carter2002-06-171-3/+4
|
* Start of merge to 2_2_RELEASE branch for release.Jeremy Allison2002-04-302-14/+73
| | | | Jeremy.
* Move over to RELEASE branch.Jeremy Allison2002-02-013-123/+252
| | | | Jeremy.
* Sync-up with SAMBA_2_2 branch.Jeremy Allison2001-10-113-224/+294
| | | | Jeremy.
* Syncup getting ready for release.Jeremy Allison2001-07-063-27/+181
| | | | Jeremy.
* need map_lock_offset when we don't have large offsetsAndrew Tridgell2001-04-131-2/+0
|
* need map_lock_offset in reply.c for systems without a 64 bit integerAndrew Tridgell2001-04-131-1/+1
|
* This is a big, rather ugly patch. Whilst investigating the files not truncatedJeremy Allison2001-03-301-32/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | when copying to a full disk problem, I discovered that we were not allowing the delete on close flag to be set properly, this led to other things, and after investigation of the proper delete on close semantics and their relationship to the file_share_delete flag I discovered there were some cases where we weren't doing the deny modes properly. And this after only 5 years working on them..... :-) :-). So here's the latest attempt. I realised the delete on close flag needs to be set across all smbds with a dev/ino pair open - in addition, the delete on close flag, allow share delete and delete access requested all need to be stored in the share mode tdb. The "delete_on_close" entry in the fsp struct is now redundant and should really be removed. This may also mean we can get rid of the "iterate_fsp" calls that I didn't like adding in the first place. Whilst doing this patch, I also discovered we needed to do the se_map_generic() call for file opens and POSIX ACL mapping, so I added that also. This code, although ugly, now passes the deny mode torture tests plus the delete on close tests I added. I do need to add one more multiple connection delete on close test to make sure I got the semantics exactly right, plus we should also (as Andrew suggested) move to random testing here. The good news is that NT should now correctly delete the file on disk full error when copying to a disk :-). Jeremy.
* Dead code removal from SGI compiler.Jeremy Allison2001-03-091-7/+4
| | | | Jeremy.
* Removed dead code... SGI compiler warnings.Jeremy Allison2001-03-091-2/+0
| | | | Jeremy.
* - Fix Makefile.in so that clisecdesc.o is in SMBCACLS_OBJ, not LIBSMB_OBJDavid O'Neill2000-12-061-4/+4
| | | | | | | | | Also, fix etags/ctags rules to work when srcdir != builddir - updated configure - compiler warning fixes from APPLIANCE_HEAD (source/lib/util_sec.c source/smbd/vfs-wrap.c) - tdb_chainlock() no longer returns a value. (source/locking/locking.c source/tdb/tdbutil.c source/include/proto.h)
* Changed to sourceforge tdb code. This includes spinlocks (so we now haveJeremy Allison2000-12-052-17/+17
| | | | | | | | 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.
* get rid of compiler warningsHerb Lewis2000-11-171-1/+1
|
* fix what I believe was a typo in does_lock_overlap which would cause itHerb Lewis2000-10-061-1/+1
| | | | | | to always return true Jeremy you may want to check this out
* Restructuring of vfs layer to include a "this" pointer - can be an fsp orJeremy Allison2000-10-061-6/+6
| | | | | | | | | | | | | | a conn struct depending on the call. We need this to have a clean NT ACL call interface. This will break any existing VFS libraries (that's why this is pre-release code). In addition - added Herb's WITH_PROFILE changes - Herb - please examine the changes I've made to the smbd/reply.c code you added. The original code was very ugly and I have replaced it with a START_PROFILE(x)/END_PROFILE(x) pair using the preprocessor. Please check this compiles ok with the --with-profile switch. Jeremy.
* the first cut of the internal messaging system.Andrew Tridgell2000-09-111-1/+1
| | | | | The motivation for this system is to replace the UDP message for oplocks, but this commit only does the "set debug level" message.
* allow posix locking database to be opened read-only (for smbstatus)Andrew Tridgell2000-06-132-11/+11
|
* add some bracketsAndrew Tridgell2000-06-131-1/+1
|
* Fixed misunderstanding found during CIFS conference. Overlapping lockJeremy Allison2000-05-251-340/+278
| | | | | | ranges (not just included lock ranges) should be handled correctly. UNIT test still needed. Jeremy.
* Using a structure for a tdb key can lead to insideous, hardHerb Lewis2000-05-103-20/+25
| | | | | | | | | | | | | | | | | 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-052-2/+3
| | | | | to correctly set the fnum, as the brl_conflict code looks at it. Jeremy.
* Two fixes. Added missong logic & case in lock split code.Jeremy Allison2000-05-051-4/+12
| | | | | Fixed range split into two, as DLIST_ADD has the wrong semantics... Jeremy.
* Updated to fix overlapping problem.Jeremy Allison2000-05-041-68/+142
| | | | Jeremy.
* Fix for debug statement crash.Jeremy Allison2000-05-041-1/+1
| | | | Jeremy.
* Fix based on Elrond's code to reduce the store size on removing dead records.Jeremy Allison2000-05-031-0/+1
| | | | Jeremy.
* Fixed the bug locktest.c found, it was an off-by-one error in the non-overlapJeremy Allison2000-05-031-1/+1
| | | | | case. Jeremy.
* Fixed silly bug where I wasn't checking for matching fd's in closing a file.Jeremy Allison2000-05-031-7/+24
| | | | | This caused smbd crashes on SIGKILL. Jeremy.
* Added range info to the panic message to track down the bug withJeremy Allison2000-05-031-1/+5
| | | | | locktest. 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-032-92/+130
| | | | | | | | 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.
* Implemented the last (I hope:-) part of the locking puzzle, the referenceJeremy Allison2000-05-021-23/+90
| | | | | | | counting when Windows downgrades a write lock to a read lock, then reference counts the unlocks to match the locks. With this code the POSIX unlock isn't done until the final Windows unlock. Jeremy.
* split the username in the vuser structure into a separateAndrew Tridgell2000-05-021-1/+2
| | | | | | | | userdom_struct. As the name implies this also contains a domain (unused at the moment). This will be important shortly, as operation in appliance mode needs the domain to be always carried with the username.
* Moved uglyness needed in fcntl locking (64->32 bit mapping, NFSJeremy Allison2000-05-021-3/+121
| | | | | | | errors etc.) into locking/posix.c, where it is needed. fcntl_lock in lib/util.c is now very small and clean. Added (*lock) op to vfs layer. Jeremy.
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-8/+8
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* locking/posix.c: Fixed double-free nasty crash bug found by insure.Jeremy Allison2000-05-011-3/+0
| | | | | | utils/make_smbcodepage.c: utils/make_unicodemap.c: Insure 'make install' fixes. Jeremy.
* added TDB_INTERNAL, TDB_NOLOCK and TDB_NOMMAP flags.Andrew Tridgell2000-05-011-3/+3
| | | | TDB_INTERNAL replaces the old method of passing a null filename
* - removed all our old wildcard matching code and replaced it with aAndrew Tridgell2000-04-301-2/+2
| | | | | | | | | | | | | | | | call to ms_fnmatch(). This also removes all the Win9X semantics stuff and a bunch of other associated cruft. - moved the stat cache code into statcache.c - fixed the uint16 alignment requirements of ascii_to_unistr() and unistr_to_ascii() - trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as unicode always (at least thats what NT4 does) - fixed some errors in the in-memory tdb code. Still ugly, but doesn't crash as much
* Removed tdb locking calls (picky Andrew...:-)Jeremy Allison2000-04-291-25/+12
|
* Ok - this is the *third* implementation of this (third time's the charm :-).Jeremy Allison2000-04-283-1122/+137
| | | | | | | | | | | | | | | | | 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.
* Split off of POSIX locking into separate unit as Andrew requested.Jeremy Allison2000-04-281-0/+1208
| | | | | Done so I don't lose my edits... :-). Jeremy.
* Forgot to close when "posix locking" is set to False.Jeremy Allison2000-04-281-2/+5
| | | | Jeremy.
* Added optimization where we are single opener (don't free POSIX locks).Jeremy Allison2000-04-281-1/+21
| | | | Jeremy.
* Made changes suggested by Andrew review.Jeremy Allison2000-04-281-37/+52
| | | | | | | fd_close now calls fd_close_posix() directly. set_posix_lock/release_posix_lock() now handle the reference counting. More changes due when this gets moved to the file locking/posix.c Jeremy.
* Ok - this is more subtle than it looks :-).Jeremy Allison2000-04-272-7/+15
| | | | | | | | | | | | | | | 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-272-16/+32
| | | | | | | | 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.
* Did the rewrite Andrew wanted where all knowledge of POSIX locking isJeremy Allison2000-04-271-5/+179
| | | | | | | | | | removed from the smbd/open.c code. We now use a dlink list of structures indexed by dev/inode to store all pending fd's for close. This could be rewritten to use lib/hash.c if this is discovered to be too slow in use. Andrew, please take a look and let me know if this is what you had in mind. Jeremy.
* Fixed crash bugs Andrew pointed out with LOCK4 smbtortureJeremy Allison2000-04-271-10/+7
| | | | | | | test. Was miscounting posix locks, plus was not taking into account the case where other_fsp == fsp in the 'move locks' case. DOH ! This code will be re-written anyway :-). Jeremy.
* Added the hard code :-).Jeremy Allison2000-04-252-77/+453
| | | | | | | | | | 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.
* Added the code that keeps fd's open across a close if there are other fsp'sJeremy Allison2000-04-241-36/+23
| | | | | | | | | | | | | | | open on the same dev/inode pair with existing POSIX locks. This is done at the smbd/open layer, so smbd just calls fd_close() and the transfer of any open fd's is done under the covers of fd_close(). When an fsp is closed and no other fsp's open on the same dev/inode pair have existing POSIX locks then all fd's associated with this fsp are closed. Now only the hard part of doing the POSIX range unlock code when read locks overlap remains for full POSIX/SMB lock integration.... Jeremy.