Commit Graph

11428 Commits

Author SHA1 Message Date
Jeffrey Altman
975c11cb35 Windows: NotifyHardLink avoid null ptr reference
In AFSNotifyHardLink, if the TargetDirectoryCB out parameter is non-NULL
but pDirNode is NULL, do not attempt to increment the
DirOpenReferenceCount because doing so will trigger an exception.

Change-Id: I9d50e05aff9a4922113f814dd3d50e115725ecca
Reviewed-on: http://gerrit.openafs.org/9903
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-13 10:39:26 -07:00
Jeffrey Altman
4a91ac6f83 Windows: Fix trace msg typo in AFSDeleteDirEntry
The name of the function in the trace messages is wrong.

Change-Id: I7a1b86765ca8fde828615069c66e51f5e5dce4ca
Reviewed-on: http://gerrit.openafs.org/9899
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-11 13:05:02 -07:00
Anders Kaseorg
ad6e31d5fe Linux: osi_TryEvictVCache: Don’t skip the first dentry if D_ALIAS_IS_HLIST
An hlist doesn’t begin with a sentinel like a list does, so the old
code would skip the first dentry or crash with a NULL dereference if
there wasn’t one.  Use the kernel’s list_for_each_entry or
hlist_for_each_entry macros instead of trying to do it manually.

Should fix a crash observed by Alex Chernyakhovsky on kernel 3.6 and
newer.

Change-Id: I6d7bd190013a0250ca896af8d5182df55a3376b0
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/9857
Reviewed-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-11 08:43:32 -07:00
Derrick Brashear
13a3ba7ba2 pt_util: gcc warning fix
it's claimed these are not initialized before use.
squelch compiler errors. has to be in parent as otherwise
we will zero them in our loop where we potentially want the
parent group id, which is not on "this" line as we add members.

Change-Id: I3014765ad1935cbe20421560329b5bdf465db8af
Reviewed-on: http://gerrit.openafs.org/9840
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-11 08:41:40 -07:00
Derrick Brashear
00b230d693 pt_util: be admin
cheat and use the noauth flag so we pass the admin checks

Change-Id: Ie064db4fb930529fe474317d096238c915d1ef5b
Reviewed-on: http://gerrit.openafs.org/9839
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-11 08:40:47 -07:00
Jeffrey Altman
c42912d6da Windows: AFSCleanup move CCb access inside try block
A crash dump was examined which showed a deadlock due to the leak
of a SectionObjectResource in a code path in which the holding thread
could not have obtained it.  The FileObject->FsContext2 (Ccb) pointer
referred to invalid memory which may have been due to pool corruption.
The only code path in which the SectionObjectResource is held exclusive
and then the Ccb pointer is used outside of a try-except block is in
AFSCleanup().  Move this reference inside the try-except block just in
case.  If the Ccb is invalid, at least this way AFSRedirLib will catch
the exception and free the SectionObjectResource before continuing.

Change-Id: I08c9baacfc8897ae8d8b551a74976daf7effbcef
Reviewed-on: http://gerrit.openafs.org/9892
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-11 08:08:54 -07:00
Jeffrey Altman
dcae72c87e Windows: AFSClose Set FsContext* to NULL
After the Fcb OpenReferenceCount is decremented it is no longer
safe for the Fcb pointer to be referenced.  Set FsContext to NULL.

After the AFSRemoveCcb() call, it is no longer safe to reference
the Ccb pointer.  Set FsContext2 to NULL.

Change-Id: I5be1367c599222df02269bf1ed85ec89ac5d279c
Reviewed-on: http://gerrit.openafs.org/9890
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-11 08:08:03 -07:00
Jeffrey Altman
6c42bc9090 Windows: AFSClose remove dead code
Change-Id: Ia844d7e01bcf7a04a7115416e83d45bf5319d739
Reviewed-on: http://gerrit.openafs.org/9889
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-11 08:07:15 -07:00
Jeffrey Altman
d1577c80bb Windows: AFSCommonWrite do not leak SectionObjectResource
If the write request is neither an extending write nor a non-cached
write and (liStartingByte.QuadPart + ulByteCount) >=
pFcb->Header.FileSize.QuadPart, then the SectionObjectResource pointer
will be leaked.  Instead release it before retrying.

Change-Id: Id1ea7a3829a6e2be19280f366e665a11e14fba62
Reviewed-on: http://gerrit.openafs.org/9888
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-11 08:06:32 -07:00
Marc Dionne
641b2fd8d6 ubik: Avoid use of freed string
If cellName was just set to dir->cellName, afsconf_Close() will
free the string before fprintf uses it.  Just change the order
so we don't access freed memory and print garbage.

Change-Id: I66792dc50addf2d8242f71923db09fcc178cc450
Reviewed-on: http://gerrit.openafs.org/9886
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-10 12:00:44 -07:00
Jeffrey Altman
2608ce67f1 Windows: RDR_GetVolumeInfo do not always return success
If the call failed because all servers are down or all instances
of the volume are offline or busy, tell the caller.  Do not return
fake data.

Change-Id: I4e89cefba19161c7d75cfdfd04a1cf7dfc2398f4
Reviewed-on: http://gerrit.openafs.org/9882
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-08 14:22:02 -07:00
Jeffrey Altman
5342de7a58 Windows: cm_Analyze if no retry don't sleep
If error handling response is not going to result in a retry of the
call, do not sleep.

Change-Id: I12435612f94a2e6afb77b5a2975f90f66e02823a
Reviewed-on: http://gerrit.openafs.org/9881
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-08 14:21:39 -07:00
Jeffrey Altman
663f32e93e Windows: only retry ALLBUSY for five minutes
Add a volbusyCount field to cm_req_t.  Increment the count each time
CM_ERROR_ALLBUSY is processed by cm_Analyze for a given request.
Wait 15 seconds between retries and retry up to 20 times and then
fail.  This prevents requests from blocking for a volume that isn't
going to come back online for hours.

Change-Id: I25e68565700dddceebecedf552d1e04cbe39b22a
Reviewed-on: http://gerrit.openafs.org/9876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-08 14:21:23 -07:00
Ben Kaduk
a63e6747ab FreeBSD: VOP_MMAP has been dead since 1996
Clang complains that our (K&R!) declaration of struct vop_mmap_args
will only be visible within the (empty) function.
With the kernel's CFLAGS, though, this is fatal.
Remove the dead code.

Change-Id: I8fd768b36b73f9e2f727dae4e748931f307444c8
Reviewed-on: http://gerrit.openafs.org/9856
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-05-08 12:32:31 -07:00
Jeffrey Altman
79c7b34afd Windows: Release Notes updates
Document ReparsePointPolicy registry value.

Document known Explorer Shell Paste bug.

Update ShortNames registry value.

Document Cygwin 1.7.18-1 support for AFS Symbolic Links.

Change-Id: Ifdcea9c71fb23d4e9cf9ad50907dd6f50c5c619e
Reviewed-on: http://gerrit.openafs.org/9869
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 18:52:58 -07:00
Jeffrey Altman
4cda20f3d7 Windows: AFSLibExFreePool*() macros
Introduce the AFSLibExFreePool() and AFSLibExFreePoolWithTag() macros
which simply call ExFreePool() and ExFreePoolWithTag().

The prefix AFSLib indicates that memory allocated by
AFSLibExAllocatePoolWithTag() must be freed before unloading.
AFSExFreePool*() cannot be used because that is a pointer to a
function provided by AFSRedir.sys which may not be assigned when
memory must be freed.

The only time that ExFreePool() should be used is if the memory was
allocated by a system function.

Change-Id: If56b762d2b6d857dbe415171401d64ca10a1e9ea
Reviewed-on: http://gerrit.openafs.org/9853
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 18:48:03 -07:00
Jeffrey Altman
b655055a26 Windows: Use AFSLibExAllocatePool for library local
If the memory allocation is for an object that must be freed before
the afsredirlib.sys driver unloads, use the AFSLibExAllocatePoolWithTag
interface.   AFSExAllocatePoolWithTag allocates the memory from
afsredir.sys which prevents Verifier from being used to detect leaks.

Change-Id: I3e384ff2da069a594d2cafe7b4b1a9bb942cbd08
Reviewed-on: http://gerrit.openafs.org/9852
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 18:47:51 -07:00
Jeffrey Altman
5ea6e66433 Windows: RDR_Initialize must cleanup threads on failure
If RDR_Initialize() fails after instantiating the worker thread
pool it must call RDR_ShutdownFinal() to destroy the pool before
exiting.  Otherwise, the threads will spin endlessly as each
DeviceIoControl call to the redirector fails.

Change-Id: I347a509703a44c6b8ca25a084ea10dc0df801eb9
Reviewed-on: http://gerrit.openafs.org/9860
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 17:44:08 -07:00
Jeffrey Altman
ff2a5fed4d Windows: IOCTL_AFS_GET_DEBUG_TRACE
Pemrit the active Debug Flags and Trace Configuration to be
queried by administrators.

Change-Id: I0c798bd2eb8f2445c81a0b45c112bbaf72d15522
Reviewed-on: http://gerrit.openafs.org/9798
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 17:40:11 -07:00
Jeffrey Altman
edea22524a Windows: Add IOCTL_AFS_GET_REPARSE_POLICY
Introduce IOCTL_AFS_GET_REPARSE_POLICY to permit the global
and active authgroup reparse point policies to be queried.

Change-Id: I9ec4bfd177cac1a4ed77f3b376694ec6864a479c
Reviewed-on: http://gerrit.openafs.org/9797
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 17:39:58 -07:00
Jeffrey Altman
aa09c83070 Windows: "ReparsePointPolicy" registry key
HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters

  DWORD "ReparsePointPolicy"

Valid values are:

 0 - No global policy set
 1 - Reparse Points to Files treated as the target File

Change-Id: Ib8f4f6a4c5c3b2faaf86a6650a4ce3ebcbbdf0e0
Reviewed-on: http://gerrit.openafs.org/9789
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 17:39:46 -07:00
Jeffrey Altman
6a3eca32a6 Windows: CreateFile Reparse Point to File as File
Apply the Reparse Point to File as File Policy to CreateFile.  If the
FILE_OPEN_REPARSE_POINT flag is specified to the CreateFile operation
and AFSIgnoreReparsePointToFile() returns TRUE, evaluate the target
object (if possible) and if the object is a FILE, then ignore the
FILE_OPEN_REPARSE_POINT flag.  Otherwise, re-evaluate the request to
attempt to open a reparse point if it exists.

Change-Id: Ia1a3d5f4c4d638d7d94209c9b4a9dfc2e8aa2005
Reviewed-on: http://gerrit.openafs.org/9343
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 17:39:36 -07:00
Jeffrey Altman
dfd8ec397c Windows: DirControl Reparse Point to File as File
Implement the Reparse Point to File as File Policy for directory queries.

Change-Id: I6458ae4721f6d8ddea59e78731893fa7b108de19
Reviewed-on: http://gerrit.openafs.org/9342
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 17:39:24 -07:00
Jeffrey Altman
f782d1dd20 Windows: AFSRedirLib AFSIgnoreReparsePointToFile
AFSIgnoreReparsePointToFile() is a helper routine that uses the
global reparse point policy to decide whether or not a reparse point
whose target is a file should be reported to applications as a file.
When per-AuthGroup or per-Process policy is supported, this function
should be modified.

Change-Id: Ifa1b82f92859ede1cef311680ff93a1e38a81a6d
Reviewed-on: http://gerrit.openafs.org/9788
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 17:39:13 -07:00
pete scott
1ff59729dc Windows: IOCTL_AFS_SET_REPARSE_POLICY
IOCTL_AFS_SET_REPARSE_POLICY is a new ioctl that can be executed
by anyone to alter the behavior of AFS Symlink-to-File reparse point
processing.   Policy can be set for a global default or for the active
authentication group.  If the AFS_REPARSE_POINT_TO_FILE_AS_FILE policy is
active, afs symlinks will not be reported as reparse points if the symlink
target is known to be a file.

This patchset implements the ioctl but not the "reparse point to file as
file" functionality.  Per authgroup policy setting is not permitted by the
ioctl but is not supported at this time.

This patchset was modified by Jeffrey Altman.

Change-Id: I6fd8b3c7f94dd97e15d6b82642f43cb2d8193563
Reviewed-on: http://gerrit.openafs.org/9341
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-07 17:38:56 -07:00
Jeffrey Altman
5ae397146a Windows: Report Case Sensitive Search
Return the FILE_CASE_SENSITIVE_SEARCH volume flag as part of afs
volume properties.   NTFS does and our search algorithm is case
sensitive first, then case insensitive.

Change-Id: I64857cdf8712847064c8271956cebe2bdbe487df
Reviewed-on: http://gerrit.openafs.org/9850
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-04 09:40:28 -07:00
Jeffrey Altman
0e2d4c0fcb Windows: Introduce CM_CONN_FLAG_NEW
The new CM_CONN_FLAG_NEW flag is set on the cm_conn object whenever
a new rx_connection has been created.   The flag is cleared in cm_Analyze
if the call succeeded or if the error is one that is generated as a
result of communicating with the peer.  If no communication with the
peer has taken place the connection is considered "new".

For errors that would result in forcing a new connection, check whether
the existing connection is already "new".  This avoids an extra
RX_CALL_DEAD timeout period in the case where a "new" connection was
already in use.

Change-Id: If23a5f4b98e7599e4b4e62b474661e9d91aba81b
Reviewed-on: http://gerrit.openafs.org/9847
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-04 08:21:08 -07:00
Jeffrey Altman
1fed4439da Windows: Use interlocked ops for cm_conn flags
cm_conn flags can be modified by multiple threads.
Use interlocked operations for thread safety.

Change-Id: Iaaec54ca0962f8f78e1ddaee2c0a8a68041f5ed9
Reviewed-on: http://gerrit.openafs.org/9846
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-04 08:21:01 -07:00
Marc Dionne
b5550d1877 Windows: Use mtafsutil library when linking with pthreads
Use the multi-threaded version of the util library in a few places
that are linking with pthreads but use the standard version.

Change-Id: If4b72d4785fb3bfac9b7c133d323ebf95c72f804
Reviewed-on: http://gerrit.openafs.org/9844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-03 06:53:51 -07:00
Marc Dionne
e6a2bf7649 doc: Fix a few typos in vlserver man page
Fix a few errors in the vlserver manpage, a typo in a word and a
few missing delimiters that mess up the formatting slightly.

Change-Id: I1ec9887dfcbfd4f2a38c0a15fe7760d99682a194
Reviewed-on: http://gerrit.openafs.org/9804
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-03 06:42:28 -07:00
Derrick Brashear
7eed34dc81 dasalvager: use pthreads
salvageserver already uses this code, and it appears to do the
right thing.

Change-Id: I4c0f2ec503f2388a1483e89a04ff78eda270659b
Reviewed-on: http://gerrit.openafs.org/9843
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-03 06:22:52 -07:00
Derrick Brashear
53ac98931a pt: let pt_util create the groups it wants
if you are rebuilding from pt_util, data sanitization should
not randomly chown and/or rename your groups. likewise,
an admin should have the ability to do this.

Change-Id: Id76cd16acc4af712b9be6d0c7110e8db10ce3fff
Reviewed-on: http://gerrit.openafs.org/9841
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-03 06:22:40 -07:00
Ken Dreyer
32d823c52f doc: quote list items in POD
Recent versions of Pod::Simple complain if we use integers or other
special characters in an =item list. We have a couple bulleted lists
that happen to have integers or other special characters as the list
values. Quote the items with C<> so that Pod::Simple can correctly parse
them again.

Change-Id: If456781fe219b73ae01feb9aef2fb2639e097534
Reviewed-on: http://gerrit.openafs.org/9838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-05-01 13:58:56 -07:00
Ben Kaduk
d97c96d67f Remove unused variable
volser has apparently never supported bcrypt from the intial IBM
import.  There's no need to keep around the code to fetch that key.

Change-Id: I6c903f0016ef8129da7e52b4f08b38c390b847e9
Reviewed-on: http://gerrit.openafs.org/9808
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-05-01 07:19:38 -07:00
Michael Meffie
9c391e7f7d pt_util: fix group line check for input files
Fix the check for requiring group lines before any membership lines. Do
not clear flag indicating the presence of a group after reading each
line.  (This error was caught by the pt_util-t unit test.)

Fix for commit 12ced70c95

Change-Id: Iaa47e3ab7936668e8a5b761dd8d3f933d459a16a
Reviewed-on: http://gerrit.openafs.org/9832
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-05-01 07:19:21 -07:00
Michael Meffie
04605389d7 tests: make a plan for man page checks
Split the man page check routine into two routines; one to get the list
of sub-commands for a command, and another to verify a man page exists
for each sub-command.  Use the list of sub-commands to set up the
Test::More plan before running the tests.

Setting the plan before running the tests allows the the man page tests
to run on systems which ship older versions the Test::More module.

Change-Id: I1ed6fb87989e1deff4696562f3b917140592ed17
Reviewed-on: http://gerrit.openafs.org/9835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-05-01 07:19:01 -07:00
Michael Meffie
b88ff242df tests: posix signal constants in rx/perf test
Export the posix signal constants in the rx/perf perl test. Fixes a
perl syntax error on solaris.

Change-Id: Iaad361b8533787f9ad97fa00221e01e687f50723
Reviewed-on: http://gerrit.openafs.org/9836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-05-01 07:18:19 -07:00
Andrew Deason
479c34614f afs: Do not invalidate all dcaches on startup
Commit 20b0c65a28 changed
afs_UFSGetDSlot to always treat a dslot entry as invalid if
'datavalid' was 0. This was to force the invalidation of the given
dslot if we were reading in a dslot from the free or discard list,
since the data in that dslot is not valid.

However, 'datavalid' is also 0 when we read in dcache entries from
disk on startup. So, this means that we invalidated all cache entries
when the client started up, effectively making our persistent cache
worthless.

Fix this by only forcing this invalidation when we are reading from a
free or discarded dcache, and not during the initial cache scan. That
is, when 'indexvalid' is 1, and 'datavalid' is 0.

The parameters for these Get*DSlot variants should maybe be changed to
be a little more clear, but for now, this is a targeted fix for this
specific issue.

FIXES 131655

Change-Id: Ic23f1e17cd966b8468849f54fc6fda37e1f61c0c
Reviewed-on: http://gerrit.openafs.org/9833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-05-01 07:17:28 -07:00
Jeffrey Altman
a7165067d7 Windows: pSrcObject instead of pSrcFcb->ObjectInformation
In AFSSetFileLinkInfo and AFSSetRenameInfo consistently use the
variable pSrcObject instead of pSrcFcb->ObjectInformation.  pSrcObject
is a local alias.  Mixing both forms in the same function is confusing.

Change-Id: I6b078d783389eb57ed5d36cbc463018e6199e17d
Reviewed-on: http://gerrit.openafs.org/9810
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:24:43 -07:00
Jeffrey Altman
cb9d0ff3da Windows: AFSLocateNameEntry incorrect pCurrentObject
pCurrentObject is supposed to be an alias for pDirEntry->ObjectInformation
but it was not always being updated when pDirEntry was replaced.  As a
result several tests were being performed incorrectly and the wrong data
was being logged.

Change-Id: I69913788acd243d0bfdfee88e281a1eaa2adca6a
Reviewed-on: http://gerrit.openafs.org/9809
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:24:32 -07:00
Jeffrey Altman
18ba93882f Windows: More ObjectInformation RefCnt Protection
Protect addition ObjectInformation Reference count
transitions with the VolumeCB.ObjectInfoTree.TreeLock.

AFSProcessUserFsRequest
AFSSetRenameInfo
AFSInvalidateCache
AFSInvalidateVolume
AFSAllocateObjectInfo
AFSDeleteObjectInfo
AFSGetObjectStatus
AFSDeleteDirEntry

Change-Id: Icd108bb8253e5e84c673f3de04f882afea725274
Reviewed-on: http://gerrit.openafs.org/9799
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:24:18 -07:00
Jeffrey Altman
5952cc139c Windows: AFSExamineVolume drop TreeLock if waiters
After each call to AFSExamineObject drop the ObjectInfoTree.TreeLock
if there are threads waiting for access.  The garbage collection process
should not delay real work.

Change-Id: I2bd009d71b534d92d7e1b321b6db2204643e4666
Reviewed-on: http://gerrit.openafs.org/9786
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:24:04 -07:00
Jeffrey Altman
a6037b153d Windows: AFSPerformObjectInvalidate hold TreeLock
When decrementing the ObjectInfoCB reference count hold the Volume's
ObjectInfoTree.TreeLock shared.

Change-Id: I6ac2fe3cc19bcc97a2a6e38f2e1a4b3d0952b304
Reviewed-on: http://gerrit.openafs.org/9785
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:23:51 -07:00
Jeffrey Altman
d2b54c0ac4 Windows: ObjectInfoCB update last access time
Each time the ObjectInformationCB object is looked up
from the ObjectInfoTree the LastAccessCount field should be updated
except in cases of invalidation, garbage collection, and extent
processing.  This is particularly important when an ObjectInfoCB
is attached to DirectoryCB in AFSInitDirEntry and when constructing
directory snapshots or validating directory content.

Change-Id: Ife412b723a1bdc922ffdfeca71061fcfd1ce721a
Reviewed-on: http://gerrit.openafs.org/9784
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:23:36 -07:00
Jeffrey Altman
c51e9b3581 Windows: AFSFindObjectInfo update last access time
Add a boolean parameter to AFSFindObjectInfo() which is used
to indicate whether or not the last access time for the found
ObjectInfoCB should be updated.

Set the new parameter in all calls to AFSFindObjectInfo().

Change-Id: Ib50d772af6857db7b8c13f2054e910f1ef5a1b7e
Reviewed-on: http://gerrit.openafs.org/9783
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:23:20 -07:00
Jeffrey Altman
ed76e573ae Windows: AFSInvalidateVolume ObjectInfo refcnt decrement
In AFSInvalidateVolume a reference count is obtained in order to
ensure that the object is valid throughout the invalidation request.
Although the refcnt is obtained while holding the TreeLock the refcnt
was not released while holding the TreeLock which could open the door
for another thread to race.

Change-Id: I5c7ee91b78a2ce5f03cdc5f835b15357ecbec443
Reviewed-on: http://gerrit.openafs.org/9782
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:23:10 -07:00
Jeffrey Altman
a1aa06e82c Windows: AFSInitDirEntry allocated ObjInfoCBs valid
In AFSInitDirEntry the pattern was to find or allocate an
ObjectInfoCB then destroy it if the DirectoryCB creation fails
for some reason.  The problem with this approach is that once the
VolumeCB ObjectInfoTree.TreeLock is dropped the ObjectInfoCB is findable.
That means that the contents of the ObjectInfoCB must be valid.

This patchset makes three changes.  First, in the case where the
ObjectInfoCB is allocated, the fields of the ObjectInfoCB are populated
from the DirEnumEntry before the TreeLock is dropped.  Second, if the
DirectoryCB allocation fails the ObjectInfoCB is not deleted.  It is
perfectly valid and can be used by a subsequent AFSInitDirEntry call.
Perhaps one that is racing with this thread.   It will eventually be
cleaned up by the AFSPrimaryVolumeWorkerThread.  Finally, when the
ObjectInfoCB reference count is decremented the TreeLock is held shared in
order to prevent races with other threads that might be incrementing it
themselves.

Change-Id: If3091d4fa640bbb614a1a405c3afc910d649aad6
Reviewed-on: http://gerrit.openafs.org/9781
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-26 06:23:00 -07:00
Jeffrey Altman
9fd825790e Windows: AFSSetDispositionInfo Verify Dir Enum
Before testing whether or not a directory is empty, the directory
must be enumerated.  If it is not, enumerate it.

Change-Id: I0302733821e1d5c6be3198be7fe75333d8e01245
Reviewed-on: http://gerrit.openafs.org/9780
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-25 14:25:06 -07:00
Jeffrey Altman
e11da4c586 Windows: Reset CM_VOLUMEFLAG_RO_SIZE_VALID flag
The CM_VOLUMEFLAG_RO_SIZE_VALID flag was being reset using the
wrong field which resulted in the flag never being cleared and
the correct volume size not being reported.

Change-Id: Ic6cefcefcd2c0ad20ad79a98cf0603f09efabcba
Reviewed-on: http://gerrit.openafs.org/9805
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-25 10:12:56 -07:00
Jeffrey Altman
4512b47be8 Windows: fail if pSrcParentObject cannot be resolved
In AFSSetFileLinkInfo and AFSSetRenameInfo return STATUS_INVALID_PARAMETER
if pSrcParentObject cannot be determined.  Otherwise, a NULL pointer
dereference will occur.

Change-Id: I0e265433aa85066005e90b3584f8e865c5be79c8
Reviewed-on: http://gerrit.openafs.org/9807
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-04-25 10:11:57 -07:00