summaryrefslogtreecommitdiffstats
path: root/source/locking
Commit message (Collapse)AuthorAgeFilesLines
* Failing to find an entry when doing mod_share_entry isn't a errorJeremy Allison2002-05-211-3/+4
| | | | | | condition, as we look for the entry before locking the chain - thus someone else could have legitimately deleted it. 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)
* Fix the mp3 rename bug - also tidy up our open code and remove the specialJeremy Allison2002-03-231-3/+4
| | | | | cases for rename and unlink. Had to add desired_access into the share mode record. Jeremy.
* if our lock spin code fails then return the first error code, not theAndrew Tridgell2002-03-151-4/+11
| | | | last one. This is what caused the lock1 and lock2 tests to fail.
* Use sys_usleep not usleep.Jeremy Allison2002-03-141-1/+1
| | | | Jeremy.
* Ensure we attempt to lock at least once. Only sleep if time param set.Jeremy Allison2002-03-131-1/+5
| | | | Jeremy.
* include/smb_macros.h: Don't round up an allocation if the size is zero.Jeremy Allison2002-03-131-1/+25
| | | | | | | | | | | | | | "One of these locks is not like the others... One of these locks is not quite the same" :-). When is a zero timeout lock not zero ? When it's being processed by Windows 2000 of course.. This code change, ugly though it is - completely fixes the foxpro/access multi-user file system database problems that people have been having. I used a *wonderful* test program donated by "Gerald Drouillard" <gerald@drouillard.ca> which allowed me to completely reproduce this problem, and to finally determine the correct fix. This also explains why Windows 2000 is *so slow* when responding to the smbtorture lock tests. I *love* it when all these things come together and finally make sense :-). Jeremy.
* this attempts to handle the rather bizarre lock cache semantics inAndrew Tridgell2002-03-102-1/+15
| | | | 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-303-6/+3
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Debugs that print out a share mode table in debug level 10. This codeJeremy Allison2002-01-081-4/+46
| | | | | enabled me to track down a *nasty* bug. Jeremy.
* Added DEBUG in set_share_mode to track down logic insanity.Jeremy Allison2002-01-051-0/+8
| | | | Jeremy.
* Removed unused function, delete_fn()Tim Potter2001-12-181-57/+0
|
* After conversations with Andrew, improved the robustness of theJeremy Allison2001-11-301-26/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | sharemode db in the following way. Originally, on startup and shutdown, smbd would scan the share mode db to ensure it was correct. This lead to scalability issues as scans lock the db for quite a long time. Andrew had the brainstorm that we only care about the record we're about to read. This new code (small change really, but quite significant) causes get_share_modes() to do a process_exists() call against each pid in each record, and to delete any that don't and re-write the entry if any dead records were detected. This allowed me to remove the startup/shutdown scans of the db (they can be added into smbstatus if anyone really cares to have them back). This will please the vfs author who was worried about the time taken on open() calls, and will lead to much greater robustness and scalability in the share mode db. We need much testing of this, and also netbench tests to ensure the extra process_exists() calls don't hurt performance (they shouldn't it's a very simple system call). Jeremy.
* Don't scan locking db on closedown.Jeremy Allison2001-11-211-0/+4
| | | | Jeremy.
* Move from timestamp to gen count file id's for finding oplocked filesJeremy Allison2001-10-201-6/+19
| | | | | in a tdb. Jeremy.
* Ensure we mask off deny modes correctly on being set (this shouldn't haveJeremy Allison2001-10-191-2/+2
| | | | | | caused problems but is tidier). Fix debug statement in locking.c Jeremy.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-023-4/+0
|
* Removed test code that got added by accident.Jeremy Allison2001-09-191-22/+0
| | | | Jeremy.
* Correct fix for unaligned memcpy - malloc'ed memory incremented by ↵Jeremy Allison2001-09-181-18/+20
| | | | | | | | | | sizeof(struct locking_data) was not forced to be 8 byte aligned. Use union to force it to be correctly aligned for memcpy and use void *, to tell compiler not to optimize aligned copy (this last fix suggested by Trond @ RedHat). The first fix should be sufficient, but this provides a "belt and braces" fix. Jeremy.
* Use structure copy to fix unaligned accesses on 64bit architectures onJeremy Allison2001-09-181-1/+1
| | | | | Linux. Jeremy.
* move to SAFE_FREE()Simo Sorce2001-09-173-39/+31
|
* Fix the 62bit locking onto 32 bit NFS mounts problem generically for HPUX.Jeremy Allison2001-09-061-94/+21
| | | | | Don. please check this out. Jeremy.
* got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell2001-09-062-2/+2
|
* use NTSTATUS not BOOL in do_lock()Andrew Tridgell2001-09-062-21/+24
|
* 2nd DELETE_ON_CLOSE_FLAG fix ...Andrew Tridgell2001-09-051-3/+3
| | | | | | | | | | we set the DELETE_ON_CLOSE_FLAG on all share modes on the file, which means the share mode in the fsp will not match the one in the tdb when we come to close for other file handles, which means we end up with share modes on files after all handles are closed fixed by making the comparison function that says if two shares modes are equal ignore the DELETE_ON_CLOSE_FLAG
* NFS v2 can return ENOLCK when greater than 31 bit offsets are used.Jeremy Allison2001-09-051-2/+2
| | | | | Treat this the same as an EFBIG error. Jeremy
* the next stage in the NTSTATUS/WERROR change. smbd and nmbd now compile, but ↵Andrew Tridgell2001-09-041-6/+6
| | | | the client code still needs some work
* converted another bunch of stuff to NTSTATUSAndrew Tridgell2001-08-271-1/+1
|
* started converting NTSTATUS to be a structure on systems with gcc in order ↵Andrew Tridgell2001-08-271-6/+6
| | | | to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs
* converted smbd to use NTSTATUS by defaultAndrew Tridgell2001-08-272-33/+73
| | | | | | | | | | | | | | | | 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
* Ignore locks of length zero as they mean different things in Win32Jeremy Allison2001-08-261-5/+18
| | | | | and POSIX. Jeremy.
* 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
|
* 0 byte lock ranges ARE validAndrew Tridgell2001-08-241-6/+3
|
* Tidyup fixes for fcntl spin problem.Jeremy Allison2001-08-221-11/+30
| | | | Jeremy.
* Fixed the (incorrect) paranioa fix I put in for the fcntl lock spin.Jeremy Allison2001-08-221-17/+35
| | | | | | Don't delete a share mode that failed to remove the oplock (doh!), just set the oplock entry to zero.... Jeremy.
* Missed uninitialized variable return for del_share_mode().Jeremy Allison2001-08-211-1/+1
| | | | Jeremy.
* This is Jeremy pretending to be Volker, 'cos theVolker Lendecke2001-08-211-64/+136
| | | | | | | | | | | | | | | | | link from Seattle is having problems. I've added 3 things here to work on the fcntl spin problem. 1). Check *all* tdb return codes... :-). 2). If we're asking ourselves to break an oplock, and we can't find a fsp pointer that matches the entry, this is a *logic bug* and we should abort and panic so someone with gdb can pick up the pieces. 3). After we've broken an oplock, ensure that the entry itself has been removed, and if not remove it ourselves. This should not be neccessary in a correctly working environmen,t, but will provide an added layer of robustness in error situations. 4). I hate german keyboards :-) :-). Jeremy.
* Ensure we are very explicit about what we're comparing whenJeremy Allison2001-08-201-4/+4
| | | | | | | we're comparing structures (ie. don't just do a memcmp). I don't think this will fix the fcntl spin issue, but it's a "just in case" change. Jeremy.
* Add printing of errno when POSIX lock requests fail.Jeremy Allison2001-08-131-3/+3
| | | | Jeremy.
* this is a big global fix for the ptr = Realloc(ptr, size) bug.Simo Sorce2001-08-122-6/+13
| | | | | | many possible mem leaks, and segfaults fixed. someone should port this fix to 2.2 also.
* Added "use mmap" for HPUX.Jeremy Allison2001-07-302-2/+2
| | | | Jeremy.
* Fixed the nastiest locking bug to track down.... smb_pids are sent in theJeremy Allison2001-07-022-7/+6
| | | | | lockingX calls - use that instead of smb_pid in the packet. Jeremy.
* Ensure we return correct error on trying to unlock a region not locked.Jeremy Allison2001-06-301-2/+2
| | | | Jeremy.
* Fixed the first locking error (test #8 found by locktest code fromJeremy Allison2001-06-302-6/+45
| | | | | Clarion locktest. Jeremy.
* use LDSHFLAGS not -shared in several placesAndrew Tridgell2001-06-043-4/+4
|
* Stupid typo. Should be if (!tdb).Jeremy Allison2001-05-231-1/+1
| | | | Jeremy.
* Defensive brlock and locking database cleaning code.Jeremy Allison2001-05-222-8/+124
| | | | Jeremy.