Commit Graph

5178 Commits

Author SHA1 Message Date
Jeffrey Altman
cb455744d4 windows-client-osi-20080825
LICENSE MIT

add more asserts to attempt to catch locks released in threads other
than the one that obtained them.
2008-08-26 05:14:14 +00:00
Derrick Brashear
12c8abc690 server-argument-consistency-and-jumbograms-off-20080824
LICENSE IPL10
FIXES 108703

go through and make servers able to take debug log level on command line;
add -jumbo; default to -nojumbo
2008-08-25 02:14:39 +00:00
Jeffrey Altman
a88d12746a windows-smb-more-check-open-done-20080824
LICENSE MIT

call cm_CheckNTOpenDone() in error conditions as well
2008-08-24 22:45:24 +00:00
Jeffrey Altman
82741251b1 windows-prefetch-lock-order-20080824
LICENSE MIT

lock order violation between cm_daemonLock and cm_scache_t rw lock
2008-08-24 18:46:23 +00:00
Jeffrey Altman
24f8b1b4c3 windows-smb-locks-20080224
LICENSE MIT

smb_dirSearch_t refCount field is protected by smb_globalLock not the
smb_dirSearch_t mutex.

Do not hold the smb_fid_t mutex across calls to smb_NotifyChange()
2008-08-24 17:31:28 +00:00
Jeffrey Altman
cc48a5a3b4 windows-check-nt-open-lock-sync-20080224
LICENSE MIT

Move cm_SyncOpDone(CM_SCACHESYNC_LOCK) from cm_CheckNTOpen to
cm_CheckNTOpenDone.  This is necessary to synchronize lock operations.
2008-08-24 17:25:57 +00:00
Jeffrey Altman
25b819543e windows-callback-shutdown-head-20080801
LICENSE MIT

When the cache manager is shutting down, return an error to all
callback requests.  Otherwise, it is possible for a callback to get
stuck waiting for a lock and when the lock clears to be left with
nothing but invalid memory addresses to crash on.

In the meantime, the file server is waiting for the response.
2008-08-22 21:57:53 +00:00
Derrick Brashear
186f707378 darwin-fake-afs-bigger-20080822
LICENSE IPL10
FIXES 112564

set up max uint64 "free" in afs so finder isn't dumb.
2008-08-22 20:26:38 +00:00
Derrick Brashear
ea81e608ba analyze-srvr-safety-check-20080822
LICENSE IPL10
FIXES 112681

safety check to make sure a conn's srvr is set before dereferencing it
2008-08-22 19:52:44 +00:00
Jeffrey Altman
ef10390e12 windows-misc-20080822
LICENSE MIT

1. In multi-threaded applications deadlocking is always a problem.
Deadlock avoidance requires a strict adherence to a documented
hierarchy.  The lock hierarchy for OAFW is described in a file
called locks.txt.  There are two problems.  First, some of the
locks are not included in locks.txt.  Second, it is nearly
impossible given the depth of function calls for any programmer
 to identify all of the locks that are held at any given time
a function is called.  This patch implements a new locking order
verification mechanism.  Each lock is assigned a lock level at
initialization.  Each thread maintains a queue of held locks.
Each time a lock is acquired the queue is checked to ensure that
no locks with a higher level than the requested lock has already
been acquired.  If a violation occurs, the service panics.

2. When the service panics ensure that a minidump will always be generated.

3. Remove unused lock cm_bufGetMutex.

4. The lock order verifier identified approximately a dozen
lock order violations that are corrected.

5. A race condition within the function path cm_GetSCache() ->
cm_GetNewSCache() -> cm_RecycleSCache() permitted a cm_scache_t
object to be issued simultaneously to two threads.  This would
eventually result in a panic due to the resulting under count.

6. Fix interpretation of the empty string as the ioctl path to
mean the current directory.   "fs lsm", "symlink list", etc.
now return a "not a ..." error instead of "does not exist".

7. Add SMB_STRF_SRCNULTERM flag to smb_ParseStringXXX functions
to indicate that the input string is a nul terminated string.
Assign it when input strings are nul terminated.

8. The CIFS protocol specification for handling NT_TRANSACT_CREATE
does not match the observed behavior.  The 'nameLength' is specified
in bytes not in characters.  Fix the implementation to match.

9. The cm_HaveAccessRights() attempt at deadlock avoidance by calling
lock_TryRead() on the parent directory cm_scache_t rw-lock does not
avoid the deadlock.  Avoid the deadlock by enforcing the lock order
of lowest vnode first.  Then remove the infinite loop avoidance in
cm_SyncOp() that was returning an unwarranted access denied error.
2008-08-22 19:06:04 +00:00
Derrick Brashear
46dbd67871 rx-allow-jumbogram-disabling-really-20080822
LICENSE IPL10

right now, jumbograms can still be sent when -nojumbo is specified. make the
current macro a default and override when we're supposed to.
2008-08-22 05:31:32 +00:00
Jeffrey Altman
a00f706eb6 windows-list-symlink-20080820
LICENSE MIT

Another casaulty of the Unicode transition, the return value of the
ListLink operation was not being convered from wchar to char before
it was copied into the output buffer.
2008-08-20 20:44:56 +00:00
Jeffrey Altman
9488898fdb windows-afsd-service-20080820
LICENSE MIT

When afsd_service.exe is not running as a service do not call the
Service Manager functions.  Doing so causes invalid access exceptions
to be thrown in the kernel and can corrupt the heap.
2008-08-20 20:41:17 +00:00
Derrick Brashear
651f25b9c8 redhat-spec-default-build-authlibs-20080820
LICENSE IPL10
FIXES 101879

make build_authlibs default usefully
2008-08-20 19:45:05 +00:00
Derrick Brashear
03982bd548 namei-by-default-on-sol10-20080816
LICENSE IPL10

default to namei, not inode, on solaris 10 except by request
2008-08-16 22:37:29 +00:00
Dan Hyde
b080c5d82b volser-initialize-volume-updatedate-20080816
LICENSE IPL10
FIXES 110943

right now this isn't set until a vnode update happens. technically creating
the root directory is an update, so let's set it to now.
2008-08-16 21:07:30 +00:00
Tracy Di Marco White
8190e75b38 netbsd-sigwait-broken-til-nbsd5-20080816
LICENSE IPL10
FIXES 111404

work around netbsd sigwait brokenness
2008-08-16 20:46:44 +00:00
Marc Dionne
d7a5619e5b linux-2-6-27-20080816
LICENSE IPL10
FIXES 111634

add support for 2.6.27, which removes asm/semaphore.h
2008-08-16 20:42:34 +00:00
Jeffrey Altman
4274e854c5 windows-build-20080815
LICENSE MIT

remove duplicate rules for man-pages
2008-08-16 18:39:33 +00:00
Jeffrey Altman
dbd98583d3 windows-rx-extra-packets-20080816
LICENSE MIT

Make the default number of pre-allocated rx packets equal to the number
of threads times the rx window size.
2008-08-16 18:00:50 +00:00
Jeffrey Altman
ffbee95174 windows-pioctl-getdrivetype-20080816
LICENSE MIT

Use GetDriveType() to check if the current path is a local disk.
If it is, fail the pioctl attempt immediately.  This should avoid
the reported 30 second delay in the AFS Shell Extension.
2008-08-16 17:48:17 +00:00
Jeffrey Altman
20d38bc268 windows-freelance-deadlock-20080815
LICENSE MIT

avoid a deadlock in cm_reInitLockMountPoints() and make the function
useful again by actually using the index value in the construction
of the FIDs
2008-08-15 21:17:02 +00:00
Jeffrey Altman
aa011cc0d8 windows-shlibafsauthent-20080814
LICENSE MIT

export pioctl_utf8
2008-08-15 00:37:20 +00:00
Jeffrey Altman
357223aefd windows-server-dereference-null-two-20080814
LICENSE MIT

protect against a potential null pointer dereference of a cm_server_t
object
2008-08-14 21:22:49 +00:00
Jeffrey Altman
90fe95e994 windows-server-dereference-null-20080814
LICENSE MIT

protect against a null pointer dereference of a cm_server_t object
2008-08-14 21:19:34 +00:00
Jeffrey Altman
f430aee67c windows-memdump-20080814
LICENSE MIT

add locks, waiting lock requests, smb user, smb tid, and cell expiration
to the memory dump output (fs memdump)
2008-08-14 18:23:28 +00:00
Jeffrey Altman
06b5006517 windows-free-server-deadlock-20080813
LICENSE MIT

avoid a deadloc when freeing servers.  cm_serverLock must be released
around cm_GCConnections()
2008-08-14 03:36:43 +00:00
Jeffrey Altman
4e7e66d4dc windows-search-cell-file-20080813
LICENSE MIT

if a cell has been found with addresses and the next cell name
is reached before the EOF, return success.

If the cell has been found and there are no addresses, return -6
2008-08-14 03:32:54 +00:00
Jeffrey Altman
919fb5e14b rx-buffer-allocation-corrected-20080813
LICENSE MIT

a corrected version of delta rx-buffer-allocation-20080812
2008-08-14 03:27:36 +00:00
Jeffrey Altman
844d7e5707 windows-build-man-pages-20080813
LICENSE MIT

move building of man pages to installer phase
2008-08-14 03:15:34 +00:00
Derrick Brashear
04a25e0a40 nfstrans-extra-protection-20080813
LICENSE IPL10

ensure, at least, that there is a filehandle for everything we check
2008-08-14 00:49:15 +00:00
Rainer Toebbicke
e5bf9b91ea salvager-dont-corrupt-dir-lengths-20080812
LICENSE IPL10
FIXES 111585

make the int64 macros work when the "64 bit" number to fill isn't.
use the correct variable type for length in salvager
2008-08-14 00:44:16 +00:00
Jeffrey Altman
156b13f74d rx-buffer-allocation-pulled-20080813
LICENSE MIT

remove delta rx-buffer-allocation-20080812 as it leads to data corruption
2008-08-13 15:10:42 +00:00
Jeffrey Altman
643a632a38 rx-buffer-allocation-20080812
LICENSE MIT

Prevent rxi_MorePacketsNoLock() from dereferencing a NULL pointer if
the requested allocation size cannot be satsified.  In that case back
off the number of packets until osi_Alloc() succeeds or panic if no
packets can be allocated at all.

In AllocPacketBufs() do not transfer more than rx_TSFPQGlobSize packets.

Modify RX_TS_FPQ_GTOL2() macro to protect against transfering more packets
that are actually free.

Modify RX_TS_FPQ_COMPUTE_LIMITS() to enforce a rx_TSFPQGlobSize maximum
value of 64 packets to prevent ever increasing allocation sizes within
AllocPacketBufs()
2008-08-12 19:39:59 +00:00
Jeffrey Altman
c19c4b3ebb windows-stack-overruns-20080811
LICENSE MIT

prevent stack overruns
2008-08-12 05:29:52 +00:00
Jeffrey Altman
1f6c7ca14a windows-fs-mkmount-20080811
LICENSE MIT

fix volume name validity test.  strip trailing '.' from volume name
2008-08-12 00:54:48 +00:00
Jeffrey Altman
eaf2843a81 windows-make-nls-win2000-compat-20080809
LICENSE MIT

make the nls module compatible with windows 2000.
cannot use LOCALE_INVARIANT instead must lie and
say everyone is US English.  windows 2000 does not
have normalization functions and now doesn't have
case insensitive string comparison functions either
for languages other than English.

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
LICENSE MIT

not all applications that link to cm_nls perform initialization.
Call initialization if it has not already been done explicitly.
2008-08-10 01:00:59 +00:00
Jeffrey Altman
d5af3b4236 windows-freelance-deadlock-20080809
LICENSE MIT

avoid a deadlock between cm_freelanceLock and cm_scacheLock
2008-08-09 23:31:09 +00:00
Jeffrey Altman
cd316ff51c windows-rx-udpbufsize-20080809
LICENSE MIT

Set UdpBufSize to 256K.  Add RxUdpBufSize registry value to permit
runtime configuration.
2008-08-09 05:52:36 +00:00
Jeffrey Altman
4eea9caac3 windows-smb-skip-nuls-20080809
LICENSE MIT

rename SMB_STF_IGNORENULL to SMB_STF_IGNORENUL

apply SMB_STR_IGNORENUL when copying length tagged strings into
the smb response packets.
2008-08-09 05:48:10 +00:00
Jeffrey Altman
423cdb708f windows-lock-corrections-20080808
LICENSE MIT

Derrick helped identify a few locations where rw or mx locks where
not properly being tracked.  As a result there were some locations
in which an assertion could be thrown due to releasing the wrong
type of lock.

Also added lock_AssertXXX calls to some locations to ensure that
the correct lock type is being held when the calls are made.  volume
location updates, cm_SyncOp, cm_SyncOpDone.
2008-08-08 17:43:37 +00:00
Jeffrey Altman
425d6e2e15 windows-max-cell-name-20080807
LICENSE MIT

Anywhere cm_GetCell_Gen() is called CELL_MAXNAMELEN must be used
otherwise there will be a stack overflow error.
2008-08-07 14:46:11 +00:00
Jeffrey Altman
467ac5e32d windows-misc-20080806
LICENSE MIT

Return CM_ERROR_READONLY if the caller wants PRSFS_DELETE and the
volume is readonly.

In cm_CheckNTDelete() do not call cm_SyncOpDone if cm_SyncOp failed

Do not force the use of fake directory data if the user does not
have PRSFS_READ on the directory.  Let the bulkstatus call take
place now that it is actually being used efficiently.

In ApplyV3SearchDirPatches, use cm_SyncOp(CM_SCACHESYNC_GETSTATUS)
to obtain the status info for Freelance entries instead of the
bulkstatus call.

Fix the truncation of 8.3 names in directory search responses.
2008-08-07 06:35:36 +00:00
Jeffrey Altman
d0ed34baa0 windows-cell-name-length-consistency-two-20080806
LICENSE MIT

fix what I broke
2008-08-06 21:25:43 +00:00
Jeffrey Altman
d44f1a17e4 windows-afssw-20080806
LICENSE MIT

prevent buffer underrun and overrun errors
2008-08-06 06:10:14 +00:00
Jeffrey Altman
255d055e61 windows-cell-name-length-consistency-20080806
LICENSE MIT

make all cell name lengths consistent so that safer string copy/cat
functions can be used to prevent buffer overruns
2008-08-06 06:09:34 +00:00
Jeffrey Altman
aab4b2b32f windows-getaccessrights-20080805
LICENSE MIT

Do not permit GetAccessRights() to be called multiple times within
cm_SyncOp for the same rights check.  If the GetAccessRights() succeeded
and in the next loop the rights check fails, the user simply doesn't
have the rights.

Move a call to cm_SyncOpDone(FETCHSTATUS) from GetBuffer() to MergeStatus().
Anytime an RPC completes successfully we get updated status info for
the object.  Might as well allow threads waiting for status info to us
it.
2008-08-05 16:45:35 +00:00
Jeffrey Altman
a021b79556 windows-ioctl-make-submount-20080802
LICENSE MIT
FIXES 109951

Restore the ascii version of cm_NormalizeAfsPathAscii() so that it
can be used by cm_IoctlMakeSubmount().
2008-08-03 04:28:32 +00:00
Jeffrey Altman
1fbbaaa878 windows-afsconfig-header-20080802
LICENSE MIT

Enable Bos Restricted mode for Windows
2008-08-02 20:46:14 +00:00
Jeffrey Altman
cc8e39872e windows-smb-dir-search-20080802
LICENSE MIT

Apply the bulk stat improvements to smb_ApplyDirListPatches() and
smb_ReceiveCoreSearchDir() for consistency even though
smb_ReceiveCoreSearchDir() is no longer called by any of the platforms
we support.

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================
LICENSE MIT

Only return 50 items at a time to the caller.
Do not apply patches based on buffer boundaries.  Instead
apply patches when AFSCBMAX entries are ready to be processed
in order to minimize the number of RPCs.
2008-08-05 15:29:14 +00:00