summaryrefslogtreecommitdiff
path: root/source3/smbd/oplock_linux.c
AgeCommit message (Collapse)AuthorFilesLines
2010-09-28s3: Lift smbd_server_conn from file_find_fdVolker Lendecke1-1/+1
2010-07-05s3: Remove smbd_messaging_context() from linux_oplock_signal_handler()Volker Lendecke1-1/+1
2009-09-03Hopefully last part of the fix for bug 6651 - smbd SIGSEGV when breaking ↵Jeremy Allison1-2/+2
oplocks. This one is subtle. There is a race condition where a signal can be queued for oplock break, and then the file can be closed by the client before the signal can be processed. Currently if this occurs we panic (we can't match an incoming signal fd with a fsp pointer). Simply log the error (at debug level 10 right now, might be too much) and then return without processing the break request. It looks like there is another race condition with this fix, but here's why it won't happen. If the signal was pending (caused by a kernel oplock break from a local file open), and the client closed the file and then re-opened another file which happened to use the same file descriptor as the file just closed, then theoretically the oplock break requests could be processed on the wrong fd. Here's why this should be very rare.. Processing a pending signal always take precedence over an incoming network request, so as long as the client close request is non-chained then the break signal should always be harmlessly processed *before* the open can be called. If the open is chained onto the close, and the fd on the new open is the same as the old closed fd, then it's possible this race will occur. However, all that will happen is that we'll lose the oplock on this file. A shame, but not a fatal event. Jeremy.
2009-08-24Help debug for bug 6651 - smbd SIGSEGV when breaking oplocks.Jeremy Allison1-0/+4
Should help track if we get invoked with an invalid fd from the signal handler. Jeremy.
2009-07-20s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty1-4/+5
2009-02-09s3 oplocks: Make the level2 oplock contention API more granularTim Prouty1-2/+4
This replaces release_level2_oplocks_on_change with contend_level2_oplock_begin/end in order to contend level2 oplocks throughout an operation rather than just at the begining. This is necessary for some kernel oplock implementations, and also lays the groundwork for better correctness in Samba's standard level2 oplock handling. The next step for non-kernel oplocks is to add additional state to the share mode lock struct that prevents any new opens from granting oplocks while a contending operation is in progress. All operations that contend level 2 oplocks are now correctly spanned except for aio and synchronous writes. The two write paths both have non-trivial error paths that need extra care to get right. RAW-OPLOCK and the rest of 'make test' are still passing with this change.
2009-02-09s3 oplocks: Differentiate between releasing an oplock vs. downgrading to ↵Tim Prouty1-1/+1
Level 2 for kernel oplocks Pass in an extra argument when releasing an oplock so kernel oplock implementations can support downgrading from Level 1 to Level 2.
2009-01-27s3:smbd: make kernel oplocks event drivenStefan Metzmacher1-49/+17
And use signal events for Linux oplocks. metze
2009-01-22s3:smbd: restructure kernel oplocks codeStefan Metzmacher1-12/+24
This converts the irix oplocks code to use a fd event and removes the last special case for file descriptors for the main sys_select(). metze
2009-01-08s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher1-18/+14
The goal is to move all this variables into a big context structure. metze
2008-05-28Fix Bug #5285. (libcap header mismatch)Günther Deschner1-46/+2
Can someone with gpfs available test this ? The only codepath using this function is the modules/gpfs.c module. The fix resolves at least the build issues Samba has with recent kernel / libcap versions by using the portable cap_get_proc()/cap_set_proc() interface (instead of using capget/capset). Guenther (This used to be commit 177955141247a4eb56ba0d82dc1add7f52175c40)
2008-01-16Merge CTDB-related fixes from samba-ctdb 3.0 branch ↵Alexander Bokovoy1-6/+16
(http://samba.org/~tridge/3_0-ctdb) Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 0c8e23afbbb2d081fc23908bafcad04650bfacea)
2008-01-07Remove redundant parameter fd from SMB_VFS_LINUX_SETLEASE().Michael Adam1-2/+2
Michael (This used to be commit 8880eb82f16d561a4023ec8426f8ea35c579a7a6)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-3/+3
bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10r25055: Add file_id_string_tosVolker Lendecke1-4/+4
This removes file_id_string_static and file_id_string_static2 (This used to be commit 638c848c9afe374feb30e34c494f89b2a6c64f7b)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23183: Check in a change made by Tridge:Volker Lendecke1-12/+12
This replaces the internal explicit dev/ino file id representation by a "struct file_id". This is necessary as cluster file systems and NFS don't necessarily assign the same device number to the shared file system. With this structure in place we can now easily add different schemes to map a file to a unique 64-bit device node. Jeremy, you might note that I did not change the external interface of smb_share_modes.c. Volker (This used to be commit 9b10dbbd5de8813fc15ebbb6be9b18010ffe8139)
2007-10-10r21324: Add linux setlease to the vfs layer. Next round, as Volker points out,Jim McDonough1-9/+18
it should be abstracted a little higher up so other os'es can have an entry, but it will take a bit more work. Thanks to Chetan Shringarpure and Mathias Dietz. I didn't increment the vfs number again because the kernel change notify stuff hasn't been released yet anyway. (This used to be commit 9463211bf3b46ee408b88dfbf42d498e3839d4cc)
2007-10-10r17896: Reformatting. I did not want to do it anymore, but these ones looked ↵Volker Lendecke1-12/+19
just silly :-) Volker (This used to be commit 8b6f5937db4b18db711dd0c4f1ae904087249000)
2007-10-10r15668: DOS or FCB opens share one share mode entry from differentJeremy Allison1-3/+3
fsp pointers. Ensure we cope with this to pass Samba4 DENY tests (we used to pass these, there must have been a regression with newer code). We now pass them. Jeremy (This used to be commit fd6fa1d4eaf61783df74ee2da50d331477f06998)
2007-10-10r15446: Tidy up the formatting of locking debug messages and make it moreJames Peach1-0/+1
consistent. Bring oplocks withing the purview of the locking debug channel. (This used to be commit e817cfd7d3a42d141198122eada58b5a7ba90e9c)
2007-10-10r12735: After talking to Tridge and Jeremy... This needs to be made more genericVolker Lendecke1-16/+6
before it goes in. Volker (This used to be commit 2c3d5c029a31111e1fe84ddc13c1bfc183d8bfde)
2007-10-10r12721: GPFS 2.4 on Linux will contain some windows semantics, ie share ↵Volker Lendecke1-6/+16
modes and oplocks across the cluster. Adapt Samba to it. The gpfs API is called via libgpfs.so. This code is written with dlopen(), so that you can compile on a system with gpfs installed and later on run on systems without gpfs available. So to actually make Samba call gpfs share mode calls you need to compile with gpfs.h and libgpfs.so around and set 'gpfs share = yes' on the shares you export from GPFS. Volker (This used to be commit 2253b17a1a88555291b59d52c826c81c2b8f7e7f)
2007-10-10r10656: BIG merge from trunk. Features not copied overGerald Carter1-53/+3
* \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
2007-10-10r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison1-4/+4
tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb)
2007-10-10r7440: * merge registry server changes from trunk (so far) for moreGerald Carter1-1/+1
printmig.exe work * merge the sys_select_signal(char c) change from trunk in order to keeo the winbind code in sync (This used to be commit a112c5570a7f8ddddde1af0fa665f40a6067e8cf)
2007-10-10r6586: get rid of a few more compiler warningsHerb Lewis1-0/+2
(This used to be commit 173375f8d88bf8e8db8d60e5d5f0e5dcc28767d9)
2007-10-10r6225: get rid of warnings from my compiler about nested externsHerb Lewis1-16/+16
(This used to be commit efea76ac71412f8622cd233912309e91b9ea52da)
2007-10-10r6149: Fixes bugs #2498 and 2484.Derrell Lipman1-3/+9
1. using smbc_getxattr() et al, one may now request all access control entities in the ACL without getting all other NT attributes. 2. added the ability to exclude specified attributes from the result set provided by smbc_getxattr() et al, when requesting all attributes, all NT attributes, or all DOS attributes. 3. eliminated all compiler warnings, including when --enable-developer compiler flags are in use. removed -Wcast-qual flag from list, as that is specifically to force warnings in the case of casting away qualifiers. Note: In the process of eliminating compiler warnings, a few nasties were discovered. In the file libads/sasl.c, PRIVATE kerberos interfaces are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED kerberos interfaces are being used. Someone who knows kerberos should look at these and determine if there is an alternate method of accomplishing the task. (This used to be commit 994694f7f26da5099f071e1381271a70407f33bb)
2003-11-03Fix more 64-bit printf warnings.Tim Potter1-2/+2
(This used to be commit 23443e3aa079710221557e18158d0ddb8ff48a36)
2003-05-15Fix from Steve G <linux_4ever@yahoo.com>. Ensure sigemptyset is called onJeremy Allison1-0/+1
the sa_mask to prevent valgrind complaints. Jeremy. (This used to be commit e065c3a58f5c7f2612596574046a73869183dbd3)
2003-03-28merged real time signal fixes from headAndrew Tridgell1-1/+4
(This used to be commit 03a5e62300f3cfb96d14570b73a758e6fa64c449)
2003-01-14Merge indirection, signed/unsigned and uninitialiased-value fixes from HEAD.Andrew Bartlett1-0/+2
Andrew Bartlett (This used to be commit 2a1adb8f81d8966e8919fffb9b4c69f3e6acd44f)
2002-07-15updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell1-27/+30
(This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2001-11-06Fixed unsigned / long unsigned format missmatch.Jeremy Allison1-4/+4
Jeremy (This used to be commit 86c2f9636635283beb8e496315a7bfac881355dd)
2001-10-20Move from timestamp to gen count file id's for finding oplocked filesJeremy Allison1-46/+46
in a tdb. Jeremy. (This used to be commit 058ae6b58f61ef46013dd076af3a84de5fbaaab1)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter1-2/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-08convert more code to using d_printfAndrew Tridgell1-1/+2
(This used to be commit 60d297303488ed583537ca2853828fccd6da2ade)
2001-06-25fixed usage of socklen_t and also tidied up SIG_ATOMIC_T, using a typedef ↵Andrew Tridgell1-5/+5
instead of a define (This used to be commit e2ecff419fdc0a0dc7551b33b377dc11061ef2a3)
2001-05-08More compiler warning fixes.Tim Potter1-2/+2
(This used to be commit 88a7b2c3f80b17ca8ab2112e9a98f55f1a11d88c)
2001-04-27Fix from matthew.hart@veritas.com - bad error return from ↵Jeremy Allison1-2/+2
linux_oplock_receive_message(). Jeremy. (This used to be commit b35ca2c6b13877bc6e09c7c4179d9529a7d3e0b3)
2001-03-11Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison1-5/+0
RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy. (This used to be commit 0be41d5158ea4e645e93e8cd30617c038416e549)
2000-06-19Paranoia changes to ensure that anything touched by a signal handlerJeremy Allison1-7/+7
and the main code is declared as VOLATILE SIG_ATOMIC_T. Jeremy. (This used to be commit b737c784e34b0e1af014cb828ef37d5b6d73c3e2)
2000-06-12enable the Linux change notify code and change some notify debug codeAndrew Tridgell1-6/+17
(This used to be commit c6be511fcc1be79619a0184f03d4c33dbfe12f04)
2000-06-12totally rewrote the async signal, notification and oplock notificationAndrew Tridgell1-12/+17
handling in Samba. This was needed due to several limitations and races in the previous code - as a side effect the new code is much cleaner :) in summary: - changed sys_select() to avoid a signal/select race condition. It is a rare race but once we have signals doing notification and oplocks it is important. - changed our main processing loop to take advantage of the new sys_select semantics - split the notify code into implementaion dependent and general parts. Added the following structure that defines an implementation: struct cnotify_fns { void * (*register_notify)(connection_struct *conn, char *path, uint32 flags); BOOL (*check_notify)(connection_struct *conn, uint16 vuid, char *path, uint32 flags, void *data, time_t t); void (*remove_notify)(void *data); }; then I wrote two implementations, one using hash/poll (like our old code) and the other using the new Linux kernel change notify. It should be easy to add other change notify implementations by creating a sructure of the above type. - fixed a bug in change notify where we were returning the wrong error code. - rewrote the core change notify code to be much simpler - moved to real-time signals for leases and change notify Amazingly, it all seems to work. I was very surprised! (This used to be commit 44766c39e0027c762bee8b33b12c621c109a3267)
2000-06-11a better test for oplocks being enabled in this kernelAndrew Tridgell1-1/+18
(This used to be commit cc0e919fdcb116c8f9688a4f5d7803fc8d7f9588)
2000-06-11fixed Linux capabilities handlingAndrew Tridgell1-21/+39
I used a trick where CAP_LEASE isn't claimed until it is needed. This means we avoid a system call per setreuid(), and never call capset() unless a user tries to get a oplock on a file that they don't own (This used to be commit afa98d511f70f455d599c3a36dd25e49fe74ac09)
2000-06-11Linux kernel oplocks now seem to work, but need a _lot_ of testingAndrew Tridgell1-6/+57
I had to modify sys_select() to not loop on EINTR. I added a wrapper called sys_select_intr() which gives the old behaviour. (This used to be commit b28cc4163bc2faaa80c5782fc02c8f03c410cdeb)