Age | Commit message (Collapse) | Author | Files | Lines |
|
metze
|
|
Several places want "milliseconds from current time", and several were
simply doing "msec * 1000" which can (and does in one place) result in
a usec value over 1 a million.
Using a helper to do this is safer and more readable.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
|
|
|
|
|
metze
|
|
metze
|
|
|
|
The UNLOCK bit is only used from the first lock structure
(This used to be commit 9483b7c137b61d3029a1e1e7d8d8d0723b541129)
|
|
(This used to be commit c50e7a15f9a7f2c5821b5ee468f9ade6eaa0ed55)
|
|
metze
(This used to be commit b8c42a1ff8fd4131ef2a1ad92a7405a2e4d335d3)
|
|
metze
(This used to be commit 27ec7bfc8b7f46c97e6878caf5cd694c517ce053)
|
|
metze
(This used to be commit 3b70331536d2402814db13a9f1f226a39373313a)
|
|
(This used to be commit 566aa14139510788548a874e9213d91317f83ca9)
|
|
(This used to be commit aa0a3489646ee0ce9d69e4c57c60f83e4894c8a3)
|
|
There are still a few tidyups of old FSF addresses to come (in both s3
and s4). More commits soon.
(This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa)
|
|
if they're on the same handle and the same range
metze
(This used to be commit 36384bb4a071dcc366ae1039bd0579f08b84e238)
|
|
locking requests.
This fixes a bug noticed by Ronnie Sahlberg (thanks!)
(This used to be commit b4ac085816cbec93c9fd4543a7ce48c5f3f9dca6)
|
|
(This used to be commit 507266b951272534f0a0bad5fd5e2450438dcdf1)
|
|
* Move dlinklist.h, smb.h to subsystem-specific directories
* Clean up ads.h and move what is left of it to dsdb/
(only place where it's used)
(This used to be commit f7afa1cb77f3cfa7020b57de12e6003db7cfcc42)
|
|
- to use a struct ntvfs_handle instead of a uint16_t fnum.
(to make it independend from the frontend protocol)
- the allocation of handles now is provided by the frontend
(smbsrv_*) via callbacks and not by each backend module
- this also makes sure that file handles are only passed
to the ntvfs subsystem when the tcon and session matches,
so modules can rely on this and need to check this.
- this allows multiple modules in the ntvfs module chain
to allocate file handles. This can be used for virtual
files like "\\$Extend\\$Quota:$Q:$INDEX_ALLOCATION"...
- also this will make SMB2 with 128 bit file handles possible
metze
(This used to be commit 287fc1c22d670f6e568014b420f7f4cb31dc7958)
|
|
per file handle and not per tree connect
metze
(This used to be commit 5d825261c0b8341f0a7f0f6d96d83807352566f4)
|
|
(both are '1')
metze
(This used to be commit de9d04abcceae7b1e21f521d0bb2fa5129c237b2)
|
|
- move it into the in/out substructs again
- allow file.path only on smb_fileinfo/smb_setfileinfo
metze
(This used to be commit be6d5298a2cdb7e7c61d70471bad445645af5963)
|
|
a union smb_file, to abtract
- const char *path fot qpathinfo and setpathinfo
- uint16_t fnum for SMB
- smb2_handle handle for SMB2
the idea is to later add a struct ntvfs_handle *ntvfs
so that the ntvfs subsystem don't need to know the difference between SMB and SMB2
metze
(This used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f)
|
|
(for now we just do #define ntvfs_request smbsrv_request,
but it's the first step...)
- rename ntvfs_openfile() -> ntvfs_open()
- fix the talloc hierachie in some places in the ntvfs_map_*() code
metze
(This used to be commit ed9ed1f48f602354810937c0b0de850b44322191)
|
|
(This used to be commit c722f665c90103f3ed57621c460e32ad33e7a8a3)
|
|
(This used to be commit d77b3820d16f60fb9119ac6eb70007363990b20d)
|
|
when you cancel a lock, w2k3 gives NT_STATUS_FILE_LOCK_CONFLICT not
NT_STATUS_CANCELLED. Strange.
(This used to be commit a4f17fcd9218f16b6cc166b2f797e8889d6f63f4)
|
|
code. On lock cancel don't retry the lock.
(This used to be commit dffeb3c3d44d1b837a6036c47eb809ce1bd53b22)
|
|
large commit. I thought this was worthwhile to get done for
consistency.
(This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0)
|
|
The trickiest part about this was getting the sharing and locking
rules right, as alternate streams are separate locking spaces from the
main file for the purposes of byte range locking, and separate for
most share violation rules.
I suspect there are still problems with delete on close with alternate
data streams. I'll look at that next.
(This used to be commit b6452c4a2068cf7e837778559da002ae191b508a)
|
|
fixes a directory creation problem from WinXP
(This used to be commit 4b3afc6c395b430e7e56d8ebe0ddf85c556a5df5)
|
|
(This used to be commit bdabb3f836d56ab0af9201321c00c8b385e053a5)
|
|
preparation for adding code to pass the BASE-DENY1 and BASE-DENYDOS
tests, which require a shared filesystem handle for some specific
combinations of two DENY_DOS opens on the same connection.
(This used to be commit 6e4fdf01d19051e3923d7703dbf990fc1722b09a)
|
|
- added initial support for MODE_INFORMATION in setfileinfo (I have no
idea what "mode information" on a file is - it takes a value of 0,
2, 4 or 6. What could it be?)
(This used to be commit e53ec2f6b68e1d19149c36ea8fcd25a204db38fb)
|
|
(This used to be commit a1a0118bd3f1cae034a1c564d05c3aa8019ff932)
|
|
testing. Interestingly, w2k3 does not allow the cancel of an
outstanding async open request, whereas it does allow the cancel of an
outstanding async lock request. To support this I have changed the
pvfs_wait interface to provide a enum on why the event is happening,
so the callback can decide what to do.
(This used to be commit f23d6a28008a13588cde24b5012ec21e488ac47a)
|
|
deferred reply is short-circuited immediately when the file is
closed by another user, allowing it to be opened by the waiting user.
- added a sane set of timeval manipulation routines
- converted all the events code and code that uses it to use struct
timeval instead of time_t, which allows for microsecond resolution
instead of 1 second resolution. This was needed for doing the pvfs
deferred open code, and is why the patch is so big.
(This used to be commit 0d51511d408d91eb5f68a35e980e0875299b1831)
|
|
ioctl.h)
(This used to be commit b97e395c814762024336c1cf4d7c25be8da5813a)
|
|
(This used to be commit 264ce9181089922547e8f6f67116f2d7277a5105)
|
|
ntvfs modules
the idea is that a passthru module can use ntvfs_async_state_push() before
calling ntvfs_next_*() and in the _send function it calls
ntvfs_async_state_pop() and then call the upper layer send_fn itself
- ntvfs_nbench is now fully async
- the ntvfs_map_*() functions and the trans(2) mapping functions are not converted yet
metze
(This used to be commit fde64c0dc142b53d128c8ba09af048dc58d8ef3a)
|
|
preparation for the full share modes and ntcreatex code that I am
working on.
highlights include:
- changed the way a backend determines if it is allowed to process a
request asynchronously. The previous method of looking at the
send_fn caused problems when an intermediate ntvfs module disabled
it, and the caller then wanted to finished processing using this
function. The new method is a REQ_CONTROL_MAY_ASYNC flag in
req->control_flags, which is also a bit easier to read
- fixed 2 bugs in the readbraw server code. One related to trying to
answer a readbraw with smb signing (which can't work, and crashed
our signing code), the second related to error handling, which
attempted to send a normal SMB error packet, when readbraw must
send a 0 read reply (as it has no header)
- added several more ntvfs_generic.c generic mapping functions. This
means that backends no longer need to implement such esoteric
functions as SMBwriteunlock() if they don't want to. The backend
can just request the mapping layer turn it into a write followed by
an unlock. This makes the backends considerably simpler as they
only need to implement one style of each function for lock, read,
write, open etc, rather than the full host of functions that SMB
provides. A backend can still choose to implement them
individually, of course, and the CIFS backend does that.
- simplified the generic structures to make them identical to the
principal call for several common SMB calls (such as
RAW_WRITE_GENERIC now being an alias for RAW_WRITE_WRITEX).
- started rewriting the pvfs_open() code in preparation for the full
ntcreatex semantics.
- in pvfs_open and ipc_open, initially allocate the open file
structure as a child of the request, so on error we don't need to
clean up. Then when we are going to succeed the open steal the
pointer into the long term backend context. This makes for much
simpler error handling (and fixes some bugs)
- use a destructor in the ipc backend to make sure that everthing is
cleaned up on receive error conditions.
- switched the ipc backend to using idtree for fnum allocation
- in the ntvfs_generic mapping routines, use a allocated secondary
structure not a stack structure to ensure the request pointer
remains valid even if the backend replies async.
(This used to be commit 3457c1836c09c82956697eb21627dfa2ed37682e)
|
|
an extremely efficient way of mapping from an integer handle (such as
an open file handle) to a pointer (such as the structure containing
the open file information). The code is taken from lib/idr.c in the
2.6 Linux kernel, and is very fast and space efficient. By using
talloc it even has auto cleanup.
This commit converts the handling of open file handles and open
directory search handles to use the idtree routines. In combination
with talloc destructors, this simplifies the structure handling in the
pvfs backend a lot. For example, we no longer need to keep a linked
list of open directory searches at all, and we no longer need to do
linear scans of the list of open files on most operations.
The end result is that the pvfs code is now extremely scalable. You
can have 10s of thousands of open files and open searches and the code
still runs very fast.
I have also added a small optimisation into the file close path, to
avoid looking in the byte range locking database if we know that there
are no locks outstanding.
(This used to be commit 16835a0ef91a16fa01145b773aad8d43da215dbf)
|
|
operation asynchronously (such as the nbench module), then ignore lock
timeouts, as they would make no sense
(This used to be commit 2894dd0ac0ddd0ae5b4d536d5cff0690bbfab1a0)
|
|
messaging_deregister()
- added a pvfs_lock_close_pending() hook to remove pending locks on file close
- fixed the private ptr argument to messaging_deregister() in pvfs_wait
- fixed a bug in continuing lock requests after a lock that is blocking a pending lock is removed
- removed bogus brl_unlock() call in lock continue
- corrected error code for LOCKING_ANDX_CHANGE_LOCKTYPE
- expanded the lock cancel test suite to test lock cancel by unlock and by close
- added a testsuite for LOCKING_ANDX_CHANGE_LOCKTYPE
(This used to be commit 5ef80f034d4aa4dd6810532c63ad041bfc019cb8)
|
|
an early lock timeout
added support for more of the bizarre special lock offset semantics of w2k3
(This used to be commit d5bfc910b1200fb283e26572dc57fcf93652fd32)
|
|
This adds a pvfs_wait_message() routine which uses the new messaging
system, event timers and talloc destructors to give a nice generic
async event handling system with a easy to use interface. The
extensions to pvfs_lock.c are based on calls to pvfs_wait_message()
routines.
We now pass all of our smbtorture locking tests, although while
writing this code I have thought of some additonal tests that should
be added, particularly for lock cancel operations. I'll work on that
soon.
This commit also extends the smbtorture lock tests to test the rather
weird 0xEEFFFFFF locking semantics that I have discovered in
win2003. Win2003 treats the 0xEEFFFFFF boundary as special, and will
give different error codes on either side of it. Locks on both sides
are allowed, the only difference is which error code is given when a
lock is denied. Anyone like to hazard a guess as to why? It has
me stumped.
(This used to be commit 4395c0557ab175d6a8dd99df03c266325949ffa5)
|
|
enough for us to pass locktest, but does not yet support lock timeouts
and some of the other esoteric features.
(This used to be commit 58a92abd88f190bc60894a68e0528e95ae33fe39)
|