694 Commits

Author SHA1 Message Date
Jeffrey Altman
ebedc461f4 STABLE14-windows-smb-fid-faster-20060531
Speed up the performance of the cache manager by not holding the
smb_fid_t mutex across calls to cm_SyncOp and AFS RPCs.

Ensure that all smb_fid_t flag references are protected.


(cherry picked from commit 87313c96b1271b4730a27dcee1b6c062b0a37425)
2006-06-01 04:48:19 +00:00
Jeffrey Altman
767677783f STABLE14-windows-smb-fid-deadlock-20060530
remove a deadlock introduced in 1.4.1


(cherry picked from commit 134669a912a99b212fb4768d2a9a969cda5fffff)
2006-05-30 17:57:38 +00:00
Jeffrey Altman
9b16804c5f STABLE14-windows-get-acls-20060528
It is possible to have a valid callback but not to have the
required ACL info for the current user.  Force acquisition of
a FetchStatus but do so without making multiple calls.


(cherry picked from commit 83732fdb158e79b64774667ee09fc1b81062707e)
2006-05-29 00:09:52 +00:00
Jeffrey Altman
8851009ade STABLE14-windows-vcp-release-fix-20060527
smb_SendPacket cannot release the vcp since it does not own the
reference.
2006-05-28 01:18:29 +00:00
Jeffrey Altman
8a9d284519 STABLE14-windows-access-fetchstatus-20060526
Do not call cm_GetCallback() directly.  Always
use cm_SyncOp(CM_SCACHESYNC_NEEDCALLBACK)


(cherry picked from commit 40415fe265d8e660f3698d8ab7f93004d589f902)
2006-05-26 22:12:41 +00:00
Jeffrey Altman
f41589fef6 STABLE14-windows-dynamic-thread-priority-20060525
Dynamically adjust the priority of server threads based upon the age
of the cifs request that is being processed.  Bump the priority one
level for each 15 seconds of age.


(cherry picked from commit 7ca1a339cb488fd97015e959e2a17e91e9b56409)
2006-05-26 07:38:05 +00:00
Jeffrey Altman
a618bab24c STABLE14-windows-head-tail-queue-removal-20060525
while investigating the cause of the delayed write errors it was observed
that all of the sleep queues are LIFO.  This has the side effect of
encouraging starvation.  Changing the queues to FIFOs revealed a serious
problem affecting the use of all queues which use both head and tail
pointers.  The removal function osi_QRemove does not take a tail pointer
and therefore the pointer is always left hanging.  If the number of elements
ever drops to zero the queue becomes corrupted.

Added osi_QRemoveHT to be used whenever head and tail pointers are used.
Updated all callers in afsd.

====================
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.
====================

fix typo caused by pullup failure


(cherry picked from commit c1e79275079cfa68d73cc3a008c3fb3b201f1068)
2006-05-25 18:40:59 +00:00
Jeffrey Altman
4ced6b5f3e STABLE14-windows-smb-mods-20060524
Prevent smb_FindVCP from returning dead virtual circuits

Treat "*." as an alias for "all"


(cherry picked from commit b753ef7265b1970d1e38f3c65532af929102e1d6)
2006-05-25 00:06:48 +00:00
Jeffrey Altman
8e51fa393b STABLE14-windows-aklog-afsid-lookup-20060519
if the cell matches the realm, do not lookup with realm


(cherry picked from commit 36f3bafb44aae8472453a1c39e9585b920a1bada)
2006-05-20 04:15:58 +00:00
Jeffrey Altman
eb7ad3002d STABLE14-windows-smb-vcp-cleanup-races-20060511
Only allow one thread to mark the vcp dead


(cherry picked from commit f6833e96f961de1c1d402646c87681f27bf926e9)
2006-05-11 13:37:05 +00:00
Jeffrey Altman
93ad76c5d4 STABLE14-windows-addr-change-mods-20060509
When the client changes IP addresses, in order to obtain optimal
performance it must:

(1) force the replacement of all existing rx connections

(2) ping all up and down servers


(cherry picked from commit 66596cc677e8cbf7fa40ad2962ccc4547692afb5)
2006-05-09 06:20:40 +00:00
Jeffrey Altman
d57f679ab9 STABLE14-windows-smb-vcp-clean-20060508
don't grab the vcp mutex after releasing the vcp


(cherry picked from commit 77fbc6a158a570f1816c87433c0e4c44c0fc8fce)
2006-05-09 02:41:17 +00:00
Jeffrey Altman
d0989f7a14 STABLE14-windows-less-power-mgmt-logging-20060508
comment out some of the power mgmt log entries
reducing the size of afsd_init.log


(cherry picked from commit cabc803a62c2f3d20d41356bc177873bcf79c033)
2006-05-09 02:39:06 +00:00
Jeffrey Altman
ae7a614e26 STABLE14-windows-pthread-cleanup-20060424
A number of crash reports have been filed with Microsoft in afspthread.dll.
The crashes are occuring as the processes are terminating.  In order to
attempt to address this problem this patch adds support for a DllMain()
entry point that is used to cleanup Thread Local Storage and the various
RX queues.  One theory is that processes are loading and unloading DLLs
that are linked to afspthread.dll leaving the pthread data in a very
inconsistent state after each unload.  By cleaning up the static data
during the unload, if afspthread is loading again it will be forced to
initialize the data once again.


(cherry picked from commit edff1e8788a2cadfd6bb9e08f9cfdbfb491924a6)
2006-05-02 04:51:55 +00:00
Tommie Gannert
9353675a54 STABLE14-windows-ansi-filenames-fix-20060430
FIXES 31202

Remember to perform an OemToChar() conversion of the file name being
queried in Trans2QueryFileInfo


(cherry picked from commit 97a9d1964347e2b4b0f75e749b4d8f36d09fc876)
2006-04-30 06:00:31 +00:00
Jeffrey Altman
47eb71737f STABLE14-windows-deadlock-and-race-removal-20060427
This patch fixes:

* race conditions around cm_Lock() calls that were not protected
  by cm_SyncOp(LOCK) [asanka@secure-endpoints.com]

* deadlocks caused by obtaining smb_fid_t->mx after cm_scache_t->mx

* removes an extra Release smb_fid_t->mx that could result in
  releasing a mutex that is not currently held

* changes the log representation of several return codes and fids to
  be consistent with other output


(cherry picked from commit bf7404c3510d63b90c2cb15766f8455f79da90fe)
2006-04-27 16:55:38 +00:00
Jeffrey Altman
de60742535 STABLE14-windows-remove-active_vcp-20060410
The 'active_vcp' variable is no longer being used for any useful
purpose and is the center of a race condition that could lead to
an undercount of references to 'vcp' objects.  Remove it.


(cherry picked from commit f1ef60c020feffb73b2aee4c1871afba039afb67)
2006-04-10 18:56:30 +00:00
Jeffrey Altman
f7d266f864 STABLE14-STABLE-windows-vs2005-compat-20060409
correct the makefile so it is compatible with the latest nmake
2006-04-09 08:52:50 +00:00
Jeffrey Altman
4f166f64e4 STABLE14-windows-getvolstatus-20060408
don't prevent all calls to getvolstatus, just the ones that are
not AFS pioctl calls.


(cherry picked from commit 632d0c701b31877b4d74f5f3849a5a8054f7326a)
2006-04-09 08:29:37 +00:00
Jeffrey Altman
86ec92d807 STABLE14-windows-protect-against-vcp-undercount-20060408
An undercount has been detected of the smb_vc_t objects stored
in the smb_allVCsp list.  Unfortunately, we have yet to be able
to find the cause of the undercount so this patch adds logic to
protect against the side effects until such time as the cause
can be identified.


(cherry picked from commit b9f22f0b7b9bf9aa746d3ef8ea63465b1cdadb97)
2006-04-09 05:56:36 +00:00
Jeffrey Altman
7225c251b5 STABLE14-windows-minidump-20060402
change minidump default to include data segments


(cherry picked from commit 0fd8768c859b549c2294dcb4dc4cb315deb7caad)
2006-04-03 00:56:06 +00:00
Jeffrey Altman
95ef5fc9d2 STABLE14-windows-mkmount-20060306
allow case-insensitive matches for the parent of the mount point


(cherry picked from commit 9dc84c8c6c4682ab3c0a536a7ac10e997724f2b0)
2006-03-06 21:24:08 +00:00
Jeffrey Altman
fe7c06e956 STABLE14-windows-smb-log-packet-20060305
packet strings can contain %; do not parse as a format


(cherry picked from commit 9c687f10d013e423fb75d8049cc224218257c104)
2006-03-06 05:01:52 +00:00
Jeffrey Altman
230c80fe71 STABLE14-windows-no-smb-ioctl-info-20060305
don't support functions we don't implement.  the CIFS trans2 get info
ioctl is not equivalent to the AFS Get Volume Status function


(cherry picked from commit cea063c0d48bb81c6349298ecdf5dfcc0f39733b)
2006-03-05 20:55:14 +00:00
Jeffrey Altman
ba17b213b8 STABLE14-windows-brl-fix-20060222
make sure that we obtain a LockWrite if AGRESSIVE_LOCKS is defined
2006-02-22 14:29:22 +00:00
Jeffrey Altman
b7d61723b6 STABLE14-windows-do-not-mark-servers-down-without-ping-20060216
undo damage caused by an inadvertent pullup of code that caused all
servers to be marked down once every two hours.  They would remain
down for one CheckDownServersInterval after the first contact to the
cell.
2006-02-17 21:44:39 +00:00
Jeffrey Altman
0605e114b8 STABLE14-windows-reg-fix-20060215
cleanup the back connection hostname code


(cherry picked from commit 658338b015fa6cd081726a6c96ab8c756857974a)
2006-02-15 16:37:40 +00:00
Jeffrey Altman
2f310b0dff STABLE14-windows-findacl-optimize-20060213
don't remove an entry from the queue and add it to the head if it already
is the head.


(cherry picked from commit bfdc909b5477e493656b3e9fb744fdf5cd16e179)
2006-02-13 16:33:06 +00:00
Jeffrey Altman
7b953313e0 STABLE14-windows-new-server-ping-20060213
when adding a new server, mark it down to start.
this will allow the Ping to use the short timeout when checking the real
status.


(cherry picked from commit 8a6bfc54e5ff81bea0b78b45986f5115b2978adc)
2006-02-13 16:29:43 +00:00
Jeffrey Altman
044e8557cd STABLE14-windows-off-to-the-races-20060211
several race conditions were introduced over the last couple of weeks.
let's fix them.


(cherry picked from commit d9d798f78617026349e3c087c714e474e9eb2b7f)
2006-02-12 06:24:27 +00:00
Jeffrey Altman
328632fdce STABLE14-windows-vcp-fidsp-empty-20060210
protect against the case in which the vcp->fidsp list is empty
which de-queuing smb_fid_t objects


(cherry picked from commit 81cfded7dbdf25d774375719ce02ebbfe698d77c)
2006-02-10 18:44:17 +00:00
Jeffrey Altman
e910710f85 STABLE14-windows-afslogon-20060209
replace sizeof(opt) with sizeof(LogonOption_t)

add more debug statements


(cherry picked from commit 4b3c120e8e571f650e8274da553b1489cc34bd5e)
2006-02-09 15:29:41 +00:00
Jeffrey Altman
0b95cfab6f STABLE14-windows-winqual-20060206
Fix two bugs reported via Windows Crash Reporting:

 * Freelance initialization is somehow broken allowing the number of
   locally defined mountpoints to become negative.  Due to the use of
   != instead of < in loops, it is possible to read/write unallocated
   memory.

 * GetTextualSid() was not properly handling a NULL output buffer
   pointer as an indication that the desired size should be returned.


(cherry picked from commit 77de32ed745d912e35990c5602b4a69a1b654973)
2006-02-06 07:07:08 +00:00
Jeffrey Altman
dbbfa9adc8 STABLE14-windows-mountpoints-20060205
* if the mountpointstring is empty, return No Such Path; do not panic


(cherry picked from commit 3da66f26980d7cfcde54f6ba9c9a0114e23f6f40)
2006-02-05 17:47:49 +00:00
Jeffrey Altman
ef2660831c STABLE14-windows-afslogon-20060205
* AFS_Logoff_Event must destroy tokens even if integrated logon is not
   being used unless LogoffPreserveTokens is non-zero


(cherry picked from commit 18e7ef272ab4efbd599c5d10174f0afd87c57c2e)
2006-02-05 17:47:12 +00:00
Jeffrey Altman
0843a5cc8c STABLE14-windows-release-notes-20060204
update release notes for 1.4.1
2006-02-05 08:14:16 +00:00
Jeffrey Altman
7936f8d721 STABLE14-windows-afslogon-20060204
* fix LogoffPreserveTokens to work in the correct direction

 * modify behavior to avoid domain controller queries when integrated
   logon is disabled or the logon account is local


(cherry picked from commit f213588374ab92e27bb524cd747152270f9290ca)
2006-02-05 07:46:55 +00:00
Jeffrey Altman
c21a070a4c STABLE14-windows-todays-bugs-20060203
* cell names must be treated as case insensitive

* smb logoff messages do not mean the user is logging off the machine.
  do not use as an indication that tokens should be destroyed

* use the correct lock and avoid a deadlock when handling dead VCs


(cherry picked from commit 22b02189ecc70a94410fb1648da987d0964ddcaf)
2006-02-03 23:05:26 +00:00
Jeffrey Altman
9a12b3d0e0 STABLE14-windows-more-cleanup-20060201
missed one case where the vcpCounter wrapped fids at 0


(cherry picked from commit 57d3a8b72168bf03400ed42e8a8eab78ea75271c)
2006-02-01 18:29:49 +00:00
Jeffrey Altman
1e53ca0084 STABLE14-windows-more-cleanups-20060201
* remove all references to 'dead_vcp'; cleanup smb_vc_t's as soon as
  we know they are dead

* add mx holds across the cm_cell_t updates

* add cm_FindSCacheParent() and remove duplicate code elsewhere

* add mx holds across scp->flags updates

* add cm_CleanFile()

* clear CM_SCACHEFLAG_CALLBACK when discarding callbacks

* fix smb fid wrapping.  wrap at 0xFFFF instead of 0 because 0xFFFF
  is -1 which is INVALID_HANDLE

* add missing mx holds around vcp->flags updates


(cherry picked from commit 8b39114d5b36f60904e5a615a16b43b7e65c3017)
2006-02-01 18:03:18 +00:00
Jeffrey Altman
da19dc02e4 STABLE14-windows-smb_fid_t-mx-20060130
Fixup token deletion logic

Surround all references to smb_fid_t flags and other references
by obtaining and releasing the 'mx' lock.


(cherry picked from commit bceabce8498127c550bbe5a9a430c8589f76d162)
2006-01-31 09:09:59 +00:00
Jeffrey Altman
21c576178b STABLE14-windows-smb_fid_t-audit-20060125
Further testing revealed that some smb_vc_t objects could not be freed
because the associated smb_fid_t objects never reached a zero refcount.
Additional auditing uncovered cases in which there were holds not being
released and others in which they were released to many times.  This
patch fixes the problems and improves auditability by modifying the
behavior of the smb_IoctlXXX() functions to not release a reference
that was obtained by the caller.  Now the caller releases the reference.
2006-01-26 06:09:47 +00:00
Jeffrey Altman
becae29977 STABLE14-windows-continued-refcount-cleanup-20060124
* re-enable LogoffTokenTransferTimeout and LogoffTokenTransfer.
  Tokens are now destroyed at logoff based upon the values specified
  here.  Default is ON and 120 seconds.  Setting this to OFF will
  result in tokens never being destroyed.  This will leak memory.

* protect global queues with mutexes and avoid a variety of race
  conditions.


(cherry picked from commit 97304b84f76154d067717e3b34a3525abebc0cf7)
2006-01-24 17:16:05 +00:00
Jeffrey Altman
33589811b6 STABLE14-windows-smb-logoff-or-abandonment-detection-20060121
This patch:

(1) removes the rest of the dead logoff code that was originally
    stripped of any meaning by DELTA
    winnt-win2000-win98-afs-client-updates-20010623.

(2) gives new meaning to smb_TokenTransfer and smb_TokenTransferTimeout.
    these variables now control how long a smb_username_t and its
    associated cm_user_t and its cm_cellinfo_t (including tokens)
    will be preserved after a logoff.

(3) adds logic to detect logoff conditions

(4) adds cm_CheckVCs().  This function probes the SMB client with a ECHO
    response to determine if the associated SMB virtual circuit is still
    valid.   This is executed once every five minutes by smb_Daemon()
    and whenever the machine's IP addresses change.  This allows
    abandoned VCs to be detected and the associated user credentials,
    file handles, and locks to be cleaned up.  This will also prevent
    the exhaustion of the limited number of SMB sessions.

====================
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.
====================

and remember to mark the session dead so it can be re-used

====================

fix an error caused by patch conflict during pullup


(cherry picked from commit 7fde756a2c6f17e6a3b0db7659c6edcc2eaa0bd7)
2006-01-21 23:40:36 +00:00
Jeffrey Altman
a1e514c0f7 STABLE14-windows-integrated-logon-hack-fix-for-proper-refcounts-20060119
The Integrated Logon hack of setting a token for a smb name different
than the one associated with the current smb session fails when smb
virtual circuits, sessions and username objects are properly reference
counted.  When refcounts are not leaked the constructed smb_username_t
is destroyed immediately after the token is set since there are not
references to it from a current session.

The fix is to mark the smb_username_t object with a flag indicating that
it was created by the Network Provider.  This flag prevents the destruction
when the refcount is zero so that it will be available at the time the
smb session is created (just a moment or two later.)  During the binding
of the smb_username_t to the smb_vc_t the flag is cleared allowing the
tokens to be destroyed when the smb session is closed.


(cherry picked from commit 70b76b3a1cff1dabe9b10b8222cd84fc207b6704)
2006-01-19 23:08:44 +00:00
Jeffrey Altman
a51692ee6d STABLE14-windows-truncate-after-lock-check-20060116
In smb_ReceiveNTCreateX the lock check, cm_CheckNTOpen(), must take place
before we allow the file to be truncated.


(cherry picked from commit d921ee381aa46e4385524f0c31ca5ad606aa920a)
2006-01-17 21:45:12 +00:00
Jeffrey Altman
78ad3f7154 STABLE14-windows-afsmap-20060116
strcpy -> strncpy


(cherry picked from commit 4bb334ef6e40250630aec96b319de8db72619134)
2006-01-17 03:58:05 +00:00
Jeffrey Altman
0eeab1d675 STABLE14-windows-vc-locks-and-more-20060115
This patch fixes several issues:

 * the smb virtual circuits can be active and/or dead.   this patch
   improves the handling of vc's making the transition from active
   to dead

 * correct the refcounts on the smb_user_t and smb_vc_t objects

 * replace the deprecated GetCurrentTime() with GetTickCounts() which
   is the new name.  This function needs to be replaced with something
   else because its return value wraps after 49.7 days

 * hold the correct locks when adjusting the scp->fileLocksH queue


(cherry picked from commit 880a6b66a5477e092d5bb74febbf24639d786c64)
2006-01-16 02:06:58 +00:00
Jeffrey Altman
cdd514a350 STABLE14-windows-cmfinduserbyname-20060112
FIXES 25347

Fix invalid access after freeing newly allocated data structure


(cherry picked from commit af202cac551ad541a0a1ca4525b03c2ec05f6507)
2006-01-12 05:55:58 +00:00
Jeffrey Altman
29a68de93b STABLE14-windows-smb-username-refcount-20060110
the smb_username_t objects are reference counted but they were never
released on their own accord.  Instead the smb_uid_t objects when
released were also cleaning up the smb_username_t.  Since the smb_username_t
is reused, now that smb_user_t objects are being cleaned up, this was
a problem.


(cherry picked from commit a9df3ca715f483a31c14b72bae3f548a4c9291d4)
2006-01-10 13:28:01 +00:00