summaryrefslogtreecommitdiffstats
path: root/source/locking
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Merge of Andrew's changes in 2.2.Jeremy Allison2001-04-131-3/+1
| | | | Jeremy.
* 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.
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-112-9/+4
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* tdb_unlockchain() no longer returns a valueTim Potter2000-12-061-4/+4
|
* Changed to sourceforge tdb code. This includes spinlocks (so we now haveJeremy Allison2000-12-062-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.
* Fix from John Reilly for equivalence tests.Jeremy Allison2000-11-171-1/+1
| | | | Jeremy.
* Herb's warning fixes. Also the POSIX locking fix.Jeremy Allison2000-10-061-1/+1
| | | | | We now use our own vfs layer to do get/set acl calls (hurrah!). Jeremy.
* 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). Andrew gets credit for this one :-) :-). 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
|