openafs.git
11 years agorxgen: Remove pointless assignment
Simon Wilkinson [Fri, 15 Feb 2013 16:35:08 +0000]
rxgen: Remove pointless assignment

The value we assign to defp is never used (it's almost immediately
overwritten), and it is guaranteed to be the same as the existing
value. So, just remove the assignment.

Caught by clang-analyzer

Change-Id: I362fe08c623b5046f2c8b0b16c42dcfa12009981
Reviewed-on: http://gerrit.openafs.org/9162
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorxgen: Fix memory leak
Simon Wilkinson [Fri, 15 Feb 2013 16:10:18 +0000]
rxgen: Fix memory leak

Don't leak the definition structure when we hit the end of the file

Change-Id: Ief44bb3bdff274167760fda5bcc16903ef8c11ce
Reviewed-on: http://gerrit.openafs.org/9159
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorxgen: Fix NULL pointer dereference
Simon Wilkinson [Fri, 15 Feb 2013 16:05:33 +0000]
rxgen: Fix NULL pointer dereference

Avoid a NULL pointer dereference if strchr doesn't find any occurence
of '*' in the string. Whilst we handle the not found case when inserting
a mid string terminator, we don't handle it when restoring the string to
its previous value.

Change-Id: Ie0b3e18d89073a1694bba2749111c73f59150bdb
Reviewed-on: http://gerrit.openafs.org/9158
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorxgen: Silence some uninitialised variable warnings
Simon Wilkinson [Fri, 15 Feb 2013 16:01:26 +0000]
rxgen: Silence some uninitialised variable warnings

Change-Id: Ida939533afbbf2afb81cce44ea6693d33c172062
Reviewed-on: http://gerrit.openafs.org/9157
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoFix incorrect sizeof() arguments in allocations
Simon Wilkinson [Fri, 15 Feb 2013 11:55:37 +0000]
Fix incorrect sizeof() arguments in allocations

In a number of places we have

struct X *val;
val = malloc(sizeof(struct Y));

If sizeof(struct Y) < sizeof(struct X) this is obviously dangerous,
but it is incorrect regardless of the relative sizes of the
structures. Fix all of the occurences of this that clang points out
to us.

Caught by clang-analyzer

Change-Id: Iad32b4ae460d3f40a45cf33624973bf52fd167d4
Reviewed-on: http://gerrit.openafs.org/9156
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoDon't allocate objects of 0 length
Simon Wilkinson [Fri, 15 Feb 2013 11:37:47 +0000]
Don't allocate objects of 0 length

Fix assorted places in the code where we might have asked malloc to
allocate a block of zero length.

Caught by clang-analyzer

Change-Id: I6e1226ad83a52984ee7c53cbed8c867f38e4f866
Reviewed-on: http://gerrit.openafs.org/9155
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoaklog: Don't reference freed node whilst deleting
Simon Wilkinson [Fri, 15 Feb 2013 16:23:16 +0000]
aklog: Don't reference freed node whilst deleting

Because deletion is implemented using a for loop, the step of the
loop that moves us to the next node references freed memory when
we've deleted an element. Fix this by just shortcircuiting the
return from the function so we immediately exit.

Change-Id: Ia820b20ce5937ac86d849cb746b3bc21f46550fa
Reviewed-on: http://gerrit.openafs.org/9161
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agovos: Remove unused 'done' loop variable
Simon Wilkinson [Tue, 19 Feb 2013 14:41:26 +0000]
vos: Remove unused 'done' loop variable

In SendFile we break at the same time as setting the done flag,
so its value is never checked. Just remove it as it is redundant
with the current loop logic.

Caught by clang-analyzer

Change-Id: Ibf8f756b06fd26cb2013ece97eb9196c71ad88bd
Reviewed-on: http://gerrit.openafs.org/9164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agolibadmin: Don't try to release garbage connection
Simon Wilkinson [Fri, 15 Feb 2013 22:34:36 +0000]
libadmin: Don't try to release garbage connection

In bos_ServerOpen, initalise the contents of bos_server structure
to 0 using calloc, so that if we jump to the error handling stuff
before they are assigned real values we don't end up trying to
release garbage.

Change-Id: I687d0b637833a08425e75391eb92a2dd4a150301
Reviewed-on: http://gerrit.openafs.org/9163
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoasetkey: Handle unknown key types
Simon Wilkinson [Fri, 15 Feb 2013 16:13:20 +0000]
asetkey: Handle unknown key types

If the user tries to create a key which is not rxkad, error out
rather than attempt to add a random blob of memory to the KeyFile.

Caught by clang-analyzer

Change-Id: Id2803fe29153f01ab352747caed31b0d0cb4f573
Reviewed-on: http://gerrit.openafs.org/9160
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoUnix CM: Don't check if var is 0, then zero it
Simon Wilkinson [Thu, 14 Feb 2013 20:08:07 +0000]
Unix CM: Don't check if var is 0, then zero it

There's a couple of places in afs_daemons.c where we do:

    if (code != 0)
        return;
    code = 0;

The final line is obviously redundant, and makes clang sulk at us.
So, remove it.

Caught by clang-analyzer

Change-Id: Ic55edf1b05f3f45eb1f0cecdb3c2318e6f7bd0ec
Reviewed-on: http://gerrit.openafs.org/9154
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoUnix CM: Remove unecessary lastXMinCheck init
Simon Wilkinson [Thu, 14 Feb 2013 20:05:43 +0000]
Unix CM: Remove unecessary lastXMinCheck init

Don't init stuff to 0 that's then immediately reinitialised with
a proper value.

Caught by clang-analyzer

Change-Id: Ic0d8b227908fa716167acf64d7653b636e406816
Reviewed-on: http://gerrit.openafs.org/9153
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoUnix CM: Remove unused security class initialisation
Simon Wilkinson [Thu, 14 Feb 2013 20:04:05 +0000]
Unix CM: Remove unused security class initialisation

Caught by clang-analyzer

Change-Id: Iab28a305ae377cabc455132fde3b90146921100b
Reviewed-on: http://gerrit.openafs.org/9152
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agousd: Can't call usd_FileStandard* with NULL
Simon Wilkinson [Tue, 12 Feb 2013 14:07:10 +0000]
usd: Can't call usd_FileStandard* with NULL

It doesn't make sense to call usd_FileStandard{Input,Output} with
a NULL usd_handle_t (and doing so would crash later in the
function), so don't check for attempts to do so.

Caught by clang-analyzer

Change-Id: I03c0b627056108fe0d6f78d8028323cc4ed74758
Reviewed-on: http://gerrit.openafs.org/9151
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agovlserver: bulkaddrs are unsigned ints
Simon Wilkinson [Tue, 12 Feb 2013 13:15:16 +0000]
vlserver: bulkaddrs are unsigned ints

bulkaddrs_val is a pointer to an array of unsigned ints, not to
an array of ints. Fix the sizeof() used in the call to malloc to silence
a clang warning.

Change-Id: If39f34756984200fed1cd3f3de5833012b86af21
Reviewed-on: http://gerrit.openafs.org/9149
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoptserver: Simplify malloc assignment to shut up clang
Simon Wilkinson [Tue, 12 Feb 2013 13:12:47 +0000]
ptserver: Simplify malloc assignment to shut up clang

Using a temporary variable of type (char *) to store the results
of malloc and realloc, and then casting the tmp variable to the
real type causes clang-analyzer to complain. Just simplify this
code by always using the real type in order to shut it up.

Change-Id: I607bb36d1899dc617fdbd9e09e18ff10c9fa9ce9
Reviewed-on: http://gerrit.openafs.org/9148
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoauth: Handle memory errors when parsing key file
Simon Wilkinson [Tue, 12 Feb 2013 12:24:44 +0000]
auth: Handle memory errors when parsing key file

Return an IO error if we run out of memory whilst parsing a key file

Caught by clang-analyzer

Change-Id: I783a193fe9315f08d76d1be9b1c77089df25fd64
Reviewed-on: http://gerrit.openafs.org/9146
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoauth: Remove unecessary assignment
Simon Wilkinson [Tue, 12 Feb 2013 12:19:42 +0000]
auth: Remove unecessary assignment

When we're counting the number of keys available, we don't need to
actually extract each key entry - remove the unused assignment.

Caught by clang-analyzer.

Change-Id: I98a30afccaf9a455ea0a7e77e7ca0d648abe4e70
Reviewed-on: http://gerrit.openafs.org/9145
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agodumpscan: Unsigned ints can't be less than 0
Simon Wilkinson [Fri, 15 Feb 2013 17:23:51 +0000]
dumpscan: Unsigned ints can't be less than 0

'y' is an unsigned int, and therefore can never be less than 0, so
don't bother checking if it is.

Caught by clang-analyzer

Change-Id: I65e9e6e2a6f72a4a1a861234c5db89cc9d99ef15
Reviewed-on: http://gerrit.openafs.org/9138
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agovol: Don't assume enum is an int
Simon Wilkinson [Fri, 15 Feb 2013 17:22:02 +0000]
vol: Don't assume enum is an int

The type that an enum is promoted to for arithmetic is compiler
dependent. We can't assume that it's an int, or a short.

Explicitly cast the volume state enum where clang gets upset.

Change-Id: Iab285d3a04dac698797ab0df2337aee75e3876b2
Reviewed-on: http://gerrit.openafs.org/9137
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoviced: Avoid clang errors with modeBits
Simon Wilkinson [Fri, 15 Feb 2013 17:12:45 +0000]
viced: Avoid clang errors with modeBits

The modeBits element of the VnodeDiskObject structure is defined as
a 12 bit wide bitfield. This causes clang some problems when doing
integer arithmetic, as it appears to the compiler that the field is
being overflowed. For example...

    targetptr->disk.modeBits &= ~04000;

Produces the error:
    implicit truncation from 'int' to bitfield changes value
from -2049 to 2047

Marc Dionne suggested changing this to
    targetptr->disk.modeBits = targetptr->disk.modeBits & ~04000;

in order to suppress the clang error.

Change-Id: Iadb53a3db911f5771d3ab2437ccd43abce2a8ecb
Reviewed-on: http://gerrit.openafs.org/9136
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoFix warnings-as-errors for clang
Simon Wilkinson [Fri, 15 Feb 2013 17:08:45 +0000]
Fix warnings-as-errors for clang

It seems like some versions of clang have a problem with using
pragmas to stop particular warnings being converted to errors with
-Werror. These compilers require that the warning be ignored completely
in order to suppress it.

Make the necessary changes to afsd and bozo, and update README.WARNINGS
to note the problem.

Change-Id: I66038130695d2ad27c289f29bcd8f6f2eddf1ded
Reviewed-on: http://gerrit.openafs.org/9135
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agohcrypto: Suppress empty body warning
Simon Wilkinson [Tue, 19 Feb 2013 10:15:33 +0000]
hcrypto: Suppress empty body warning

clang now complains about statements of the form
    if (blah)
;

There's one of these in hcrypto. Until we can get this fixed upstream,
just mark the file as no-error.

Change-Id: I86d1362552ca9ee7b2c47a7c92bd8d6484ab7dbd
Reviewed-on: http://gerrit.openafs.org/9134
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agobutc: do not use stack garbage for secobj
Ben Kaduk [Tue, 19 Feb 2013 18:06:36 +0000]
butc: do not use stack garbage for secobj

The butc only ever handles connections over rxnull anyway, so just
specify an array of security objects of length one.

Change-Id: Ia073157488ac6b887f972448074ad1615422e26e
Reviewed-on: http://gerrit.openafs.org/9140
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Assert call error for RXS_PreparePacket error
Andrew Deason [Mon, 18 Feb 2013 01:34:06 +0000]
rx: Assert call error for RXS_PreparePacket error

If we've received an error from the underlying security class, we must
not try to send the given packet, or we risk security issues. We
currently achieve this by setting an error on the connection. It is
slightly indirect in how this yields an error on this specific call,
and so it may not be immediately clear, but doing so is critical. If
somehow the call does not have an error by the end of this, we cannot
proceed as this is an error condition we do not handle. So, assert.

Change-Id: Ie0106ab170ecb77bb102c5afa3ec44ba2b704283
Reviewed-on: http://gerrit.openafs.org/9122
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: Honor RXS_PreparePacket errors
Andrew Deason [Mon, 14 Jan 2013 18:45:04 +0000]
rx: Honor RXS_PreparePacket errors

rxi_PrepareSendPacket calls RXS_PreparePacket to allow the security
class to modify the given packet appropriately (to be undone by
CheckPacket on the other endpoint). However, currently
rxi_PrepareSendPacket ignores all errors generated by
RXS_PreparePacket, and processing continues as if there was no error.

For rxkad, an error often results in the given packet being untouched.
This means that the security checksum is not calculated, and thus not
populated in the packet, and for encrypted connections means that the
packet contents are not encrypted.

This occurs for any error generated by the security class
PreparePacket routine. For rxkad, the most common error is probably
RXKADEXPIRED, though some other internal errors are possible as well.

This behavior has a few effects for rxkad:

 1. When any error is generated by PreparePacket, the other endpoint
 generally bails out with the error RXKADSEALEDINCON, since the
 security checksum of the packet is 0, which does not match what the
 checksum should be. This results in error messages like 'rxk: sealed
 data inconsistent'. This can be very confusing if the actual error
 is, say, just that the given credentials have expired.

 2. For connections requiring encryption (rxkad_crypt), an error from
 PreparePacket means that the packet payload is sent in the clear.
 This can happen for about a window size's worth of packets.

 3. If a client ignores errors/inconsistencies with the checksum and
 encryption, etc, they can keep reading data for the call forever,
 even after their credentials have expired.

To fix this, make an error from RXS_PreparePacket cause a connection
error for the given connection, and immediately send a connection
abort. No further error checking should be necessary for the callers
of rxi_PrepareSendPacket, since they already check for call/conn
errors before sending any actual packets.

Change-Id: I87de833730424881dcd3d659870f71191eabafe4
Reviewed-on: http://gerrit.openafs.org/8909
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agotests: Improve failure mode for unresolvable hostname
Marc Dionne [Sun, 17 Feb 2013 18:29:38 +0000]
tests: Improve failure mode for unresolvable hostname

In the case of a host where gethostbyname is unable to resolve
the hostname, afstest_BuildTestConfig() may return NULL which
can cause several tests to crash.

Add a common function to look out for this condition and use it where
appropriate.  When it occurs, the current module is skipped and
the user gets an error message that indicates the configuration
problem.

Change-Id: I7216876eb2424368f415e5759e2b95009ad055b2
Reviewed-on: http://gerrit.openafs.org/9120
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agosalvager: incorrect comment
Mark Vitale [Thu, 14 Feb 2013 15:51:34 +0000]
salvager: incorrect comment

The comment for the code handling the -showsuid option was incorrect.

Change-Id: I0a63211cf5dd8a3b2636d4e4a2cc45a55c3bf62a
Reviewed-on: http://gerrit.openafs.org/9109
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoWindows: Ensure pResultCB exists before Authentication
Jeffrey Altman [Thu, 14 Feb 2013 19:43:58 +0000]
Windows: Ensure pResultCB exists before Authentication

When processing requests from the redirector it is possible for
the ResultCB to not be allocated.  This can occur either due to
an out of memory condition in a synchronous request or due to
an asynchronous extents or byte range lock request.

Move the assignment of the Authenticated state after the allocation
of the ResultCB from the stack in case of out of memory conditions.

Change-Id: I7e98edde712b532010aa15705a62cf91dd9d0ebf
Reviewed-on: http://gerrit.openafs.org/9110
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Unique file ID is per volume
Jeffrey Altman [Thu, 14 Feb 2013 14:26:16 +0000]
Windows: Unique file ID is per volume

The unique file ID returned as part of the BY_HANDLE_FILE_INFORMATION
data structure obtained via GetFileInformationByHandle() is only
guarranteed to be unique within the volume where volume uniqueness is
determined by the volume's serial number.

It therefore doesn't make sense to return the volume id as part of
FILE_INTERNAL_INFORMATION IndexNumber.  Instead return Vnode and
Unique as that is what ensures uniqueness within an existing AFS
volume.

Unfortunately, {VolId, Vnode, Unique} does not guarantee uniqueness
for when multiple cells are in use.

Change-Id: I6c6ea4a04aa79778cce811560d8106a3a5e373cb
Reviewed-on: http://gerrit.openafs.org/9108
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: RXAFS_BulkStat failures
Jeffrey Altman [Thu, 7 Feb 2013 21:53:45 +0000]
Windows: RXAFS_BulkStat failures

The RXAFS_BulkStat RPC is quite brain dead. The client requests
status information on up to AFSCBMAX FIDs.  The file server replies
success only if all of the client credentials provide access to
all of the requested FIDs.  If status info cannot be provided
for any one of the FIDs, the error code of the failure is returned
with no context as to which FID failed.

To simplify the logic within the cache manager a new local error
code, CM_ERROR_BULKSTAT_FAILURE is introduced to replace whatever
error was received from the file server.  This error is returned
by cm_TryBulkStat and cm_TryBulkStatRPC.  The caller of either of
those functions should interpret the error to mean that the current
user context cannot be used to perform a bulkstat operation against
the provided cm_scache directory.  Instead, individual RXAFS_FetchStatus
operations must be performed.

This patchset implements such error handling for both the SMB and
RDR interfaces.  This change permits the Windows cache manager to
properly enumerate a directory for which the user only has list
permission and cannot read the status info for files and symlinks.

Change-Id: I8cc47a5cedfd4e7bf0db55efffc5e95be5172e85
Reviewed-on: http://gerrit.openafs.org/9080
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: cm_BPlusDirNextEnumEntry return all errors
Jeffrey Altman [Tue, 12 Feb 2013 21:32:18 +0000]
Windows: cm_BPlusDirNextEnumEntry return all errors

Return all entries in the directory enumeration regardless of any
errors returned from cm_BPlusDirEnumBulkStatNext().  Set the error
code in the returned cm_direnum_entry_t.errorCode field so that
the caller can determine how the error should be handled on a
per entry basis.

Change-Id: I90a90ab0b0220c8d1e045f9473f5edd0bd01e45e
Reviewed-on: http://gerrit.openafs.org/9103
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Add Cell name to AFSProcessRequest parameters
Jeffrey Altman [Wed, 13 Feb 2013 19:04:28 +0000]
Windows: Add Cell name to AFSProcessRequest parameters

Knowing the cell name for the request can be useful to the file
system driver which otherwise does not have access to a conversion
from FileID.CellID to Cell name.

Change-Id: Ia10bae0d9c8bc7824a400ff30268d7ac0b9b2935
Reviewed-on: http://gerrit.openafs.org/9107
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Add Cell to FS Volume Information Label
Jeffrey Altman [Thu, 14 Feb 2013 02:53:46 +0000]
Windows: Add Cell to FS Volume Information Label

Add the Cell name to the VolumeLabel field of the
FILE_FS_VOLUME_INFORMATION structure.  This permits "cell#volume" to be
displayed by cmd.exe's DIR command and other applications that call the
GetVolumeInformation() or GetVolumeInformationByHandle() Win32 APIs.

Change-Id: I6cc7a7c2b79cb7d0d96cbddcf34dce68e52bf987
Reviewed-on: http://gerrit.openafs.org/9106
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: CellLength reported in octets
Jeffrey Altman [Wed, 13 Feb 2013 18:12:34 +0000]
Windows: CellLength reported in octets

CellLength must be converted from WCHARs to BYTEs in the response
to the redirector.

Change-Id: I79656cc0533c6cdc31a977aa486755c4a506510f
Reviewed-on: http://gerrit.openafs.org/9105
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolibafs: cleanup redundant assignment
Michael Meffie [Fri, 8 Feb 2013 22:08:28 +0000]
libafs: cleanup redundant assignment

Cleanup redundant clearing of the avcp pointer in lookup, which
looks to be a cut and paste error from the ibm afs days.

Change-Id: Ib554d862bd8485be2a4dbeb38fcaacac57c1e818
Reviewed-on: http://gerrit.openafs.org/9085
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoafs: Avoid SetupVolume panic
Andrew Deason [Fri, 8 Feb 2013 23:24:28 +0000]
afs: Avoid SetupVolume panic

Currently SetupVolume panics if it cannot successfully read a
volumeinfo entry from disk. Try to return an error instead, so we
don't panic the machine.

Change-Id: Iad3c2c857f1b736fcf4a142338d9e219bab68969
Reviewed-on: http://gerrit.openafs.org/9094
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoafs: Move SetupVolume tv initialization after loop
Andrew Deason [Fri, 8 Feb 2013 23:26:32 +0000]
afs: Move SetupVolume tv initialization after loop

The fields in tv are not used by the loop looking for the given volume
on disk. If we wait until after that loop to initialize the fields in
tv, it is easier to handle errors encountered in the loop.

This should incur no functional change.

Change-Id: Ib678542bfebaa89ecfa4aad39230fc502ec83edb
Reviewed-on: http://gerrit.openafs.org/9093
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux: Add missing semi-colon
Marc Dionne [Mon, 11 Feb 2013 23:49:21 +0000]
Linux: Add missing semi-colon

Add a missing semi-colon in the error case when missing symbols
are detected.  The effect is strictly cosmetic - a few additional
error messages would follow the "undefined symbols" error.

Change-Id: I2a8bfb0a3ef12b5bcee6946804df025c75d84830
Reviewed-on: http://gerrit.openafs.org/9095
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Do not pass relative paths to redirector
Jeffrey Altman [Wed, 6 Feb 2013 16:58:55 +0000]
Windows: Do not pass relative paths to redirector

RDR_SetInitParams provides two paths to the redirector, the AFSCache
file path and the path of the %TEMP% environment variable.  If either
of these paths are relative paths and not absolute (or full) paths,
the redirector and the service will interpret them differently.
Ensure that the full paths are delivered to the redirector.

Change-Id: I48d9cd09d9292cc0e97c41da430026c20e097de1
Reviewed-on: http://gerrit.openafs.org/9074
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Move Authenticated field to CommResultCB
Jeffrey Altman [Mon, 11 Feb 2013 01:05:49 +0000]
Windows: Move Authenticated field to CommResultCB

Add the Authenticated state of the request to the CommResultCB
so the redirector knows the state of all requests.

Change-Id: I854735c7fbda958a12fa79232b584b4d14dd8569
Reviewed-on: http://gerrit.openafs.org/9091
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Do not double increment cm_data.currentCells
Jeffrey Altman [Mon, 11 Feb 2013 21:40:36 +0000]
Windows: Do not double increment cm_data.currentCells

During cm_cell generation the cm_data.currentCells value was
incremented twice.  As a result cm_currentCells did not equal the
number of cm_cell objects allocated.  Upon restart the AFSCache
contents would be discarded.

Change-Id: I2b62cb8268789e46f5ada4aa039e41c7ea8b47a5
Reviewed-on: http://gerrit.openafs.org/9090
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Move Trace Stmts from FILE to CLEANUP
Jeffrey Altman [Fri, 8 Feb 2013 19:17:12 +0000]
Windows: Move Trace Stmts from FILE to CLEANUP

Relabel trace statements in AFSRemoveDirNodeFromParent,
AFSRemoveNameEntry, AFSDeleteDirEntry, and AFSRemoveFcb from the
FILE subsystem to the CLEANUP subsystem.   This assists in reducing
the noise when attempting to watch the file system requests that
are received by the afs redirector.

Change-Id: I0aa8c090b176a7d2fa6feb9866e7c8e9f621c2df
Reviewed-on: http://gerrit.openafs.org/9089
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSLocateNameEntry tracking DirectoryCB IN/OUT
Jeffrey Altman [Sat, 9 Feb 2013 04:46:44 +0000]
Windows: AFSLocateNameEntry tracking DirectoryCB IN/OUT

AFSLocateNameEntry previously accepted ParentDirectoryCB as an IN/OUT
parameter in which a reference count was passed in but a reference
count was not passed back out.  The DirectoryCB parameter is an OUT
parameter for which a reference count should be returned on success.

This patchset simplifies the logic.  ParentDirectoryCB is IN only
and OutParentDirectoryCB and DirectoryCB are out only.  AFSLocateNameEntry
never releases a reference count provided by the caller and it always
returns OutParentDirectoryCB and DirectoryCB with a new reference count
unless they are NULL.  It is the callers responsibility to determine if
ParentDirectoryCB has changed and to release all of the references.

Change-Id: I4843d1d685917fd3f41409d0b11f5b768c2c1dd6
Reviewed-on: http://gerrit.openafs.org/9087
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSLocateNameEntry separate VolumeCB In/Out
Jeffrey Altman [Fri, 8 Feb 2013 22:28:09 +0000]
Windows: AFSLocateNameEntry separate VolumeCB In/Out

Tracking the VolumeCB references within AFSLocateNameEntry has
proven to be very error prone.  When the VolumeCB parameter is
an in/out parameter the caller cannot reliably determine whether
or not AFSLocateNameEntry replaced the updated the pointer and
whether it properly released the references.  This patchset
changes the interface so that VolumeCB and ParentDirectoryCB
have separate in and out parameters.  The caller is now responsible
for tracking its own Volume reference counts and AFSLocateNameEntry
obtains its own which will either be returned to the caller as a
non-NULL OutVolumeCB or released.

This patchset turns ParentDirectoryCB into an IN only parameter
and adds OutParentDirectoryCB as a dedicated OUT parameter.  However,
it does not alter any associated reference count logic.  That will
be implemented in a subsequent patchset.

Change-Id: Ic271d13496b4af80339c5ccd505fa04ec57b4700
Reviewed-on: http://gerrit.openafs.org/9086
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorx: remove rx_misc.h define trailing semicolons
Jeffrey Altman [Sun, 10 Feb 2013 16:54:44 +0000]
rx: remove rx_misc.h define trailing semicolons

PIN and UNPIN macro definitions should not have trailing
semicolons.

Change-Id: I242c0a7a40cbabe852ed975eb64df52dbb585624
Reviewed-on: http://gerrit.openafs.org/9088
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorx: Remove rx_atomic_add_and_read trailing semi-colon
Marc Dionne [Wed, 6 Feb 2013 23:44:35 +0000]
rx: Remove rx_atomic_add_and_read trailing semi-colon

Remove a stray trailing semi-colon from the definition of
rx_atomic_add_and_read.

Change-Id: Iae9c62c132bcbb3d2e609dde2d54e0435d36cc03
Reviewed-on: http://gerrit.openafs.org/9075
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: GetVolumeInfo cell name
Jeffrey Altman [Thu, 7 Feb 2013 03:44:44 +0000]
Windows: GetVolumeInfo cell name

The service was supposed to provide the redirector the cell name
as part of the AFSVolumeInfoCB response from RDR_GetVolumeInfo.
Add a new field to store it and populate it.

Change-Id: Idcafaee66ed1031dfdeee1804bbdff617e464d3f
Reviewed-on: http://gerrit.openafs.org/9079
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Return full volume name for RO and BK
Jeffrey Altman [Thu, 7 Feb 2013 03:43:16 +0000]
Windows: Return full volume name for RO and BK

RDR_GetVolumeInfo must return the full volume name (not the volume
group name) for RO and BK volume types.

Change-Id: Ic215b205c07faab53f8a899d0f662b64c902dde2
Reviewed-on: http://gerrit.openafs.org/9078
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSFileOpenResultCB.Authenticated
Jeffrey Altman [Thu, 7 Feb 2013 00:35:00 +0000]
Windows: AFSFileOpenResultCB.Authenticated

Notify the redirector whether the the result of a file open
request is the result of a user authenticated action.

Change-Id: If1f7704b3ea31e40e88b3589fd604a7d50653ec1
Reviewed-on: http://gerrit.openafs.org/9077
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoLinux: Detect undefined symbols in kernel modules
Marc Dionne [Mon, 28 Jan 2013 01:52:39 +0000]
Linux: Detect undefined symbols in kernel modules

Undefined symbols in the kernel modules are not currently detected
at build time.  As a result, buildbot may indicate success while
the resulting kernel modules are unusable.

In the kernel build process, modpost warns about missing symbols
but does not return an error in the case of external modules.
Detect these warnings and cause the libafs build to fail.

Change-Id: I2c428a5ce7e3a0d10178679f789b3d787719c397
Reviewed-on: http://gerrit.openafs.org/8981
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: add cm_HaveToken
Jeffrey Altman [Thu, 7 Feb 2013 00:32:28 +0000]
Windows: add cm_HaveToken

cm_HaveToken answers the question of whether a cm_user_t has a
token for a specified cell.

Change-Id: I4dff312a7e9000ccee6952c21fca174700364c4c
Reviewed-on: http://gerrit.openafs.org/9076
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agopam: Build using libtool
Simon Wilkinson [Tue, 8 Jan 2013 14:38:34 +0000]
pam: Build using libtool

Build the pam_afs and pam_afs.krb modules using libtool, so they
fit in with the rest of the new build infrastructure.

This requires some additonal symbol exports from auth and kauth,
which are included

Change-Id: I97a130ba69216cd63ba388f2aaabe830a0c4543f
Reviewed-on: http://gerrit.openafs.org/8900
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: AFSLocateNameEntry double free Volume RefCount
Jeffrey Altman [Tue, 5 Feb 2013 05:29:12 +0000]
Windows: AFSLocateNameEntry double free Volume RefCount

If AFSBuildMountPointTarget fails when called from AFSLocateNameEntry
the pCurrentVolume reference count will have been freed even though
the pointer has not been updated.   If the failure is
STATUS_OBJECT_NAME_NOT_FOUND and AFSLocateNameEntry was called
by AFSCreateCommon, the Volume reference count will be freed twice.

Change-Id: I0b5ccb512ea0ec2e24099dff38bbbeddebf0bee3
Reviewed-on: http://gerrit.openafs.org/9069
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSObjectInfoDecrement correct return value
Jeffrey Altman [Mon, 4 Feb 2013 21:22:56 +0000]
Windows: AFSObjectInfoDecrement correct return value

The return value must be the new ObjectReferenceCount value not
the value of the Reason counter.  This was broken by patchset
e267774f1a4f9cc5bfc32c545df36a4bf7947607.

Change-Id: I9dd3cd56f6c7d43f061bdda8e24666b5f9a4ed9b
Reviewed-on: http://gerrit.openafs.org/9068
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSVolumeCB track RefCount reasons
Jeffrey Altman [Mon, 4 Feb 2013 20:14:16 +0000]
Windows: AFSVolumeCB track RefCount reasons

Introduct AFSVolumeIncrement and AFSVolumeDecrement functions
which are used to increment not only the AFSVolumeCB.VolumeReferenceCount
but also a new VolumeReferences[Reason] counter.  In the future when
a VolumeReferenceCount error occurs it may be possible to isolate the
cause to a subset of the code.

In the process, the VolumeReferenceCount necessary to free the
AFSVolumeCB object is changed from 1 to 0 and AFSInitVolume no longer
initializes the AFSVolumeCB count to 2.

The signature for AFSInitVolume and AFSLocateNameEntry are modified
to permit a volume reference reason to be provided.  This permits
the reference to be allocated in one function and released in another
without resulting in count imbalances.

Change-Id: I021a6efe061817ff044c18a699ee63a7ffbfc7bf
Reviewed-on: http://gerrit.openafs.org/9067
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoOpenBSD: Add config headers for new(er) OS versions.
Antoine Verheijen [Wed, 23 Jan 2013 02:24:25 +0000]
OpenBSD: Add config headers for new(er) OS versions.

The OS-specific config header files have not kept up with the
newer releases of OpenBSD. This patch corrects that by adding
header files for OpenBSD versions from 4.9 to 5.3 (the newest
version currently under development).

Change-Id: I5e233cc7b96be2c1c52824653c42d3c6d77d6f50
Reviewed-on: http://gerrit.openafs.org/8927
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoBuild system: Add LT_LDRULE_shlib_missing
Simon Wilkinson [Tue, 8 Jan 2013 15:26:45 +0000]
Build system: Add LT_LDRULE_shlib_missing

Add a new LT_LDRULE which can be used to build shared libraries which
may not contain all of the symbols listed in their .sym files. This
allows us to build a library like roken, where different symbols
will be present on different operating systems.

Change-Id: I82e0df49131aa7184360130547c82052a6dd704b
Reviewed-on: http://gerrit.openafs.org/8901
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux: crset should use passed credentials
Marc Dionne [Fri, 25 Jan 2013 02:38:28 +0000]
Linux: crset should use passed credentials

When copying credentials in crset, take the passed credentials as
the source instead of the current process credentials.

This doesn't cause any problems currently since crset always gets
called with the current credentials.

Change-Id: Ia6a341e96d00071587443f8eef4a99992b368abc
Reviewed-on: http://gerrit.openafs.org/8980
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLINUX: ifconfig's output has changed
Chas Williams (CONTRACTOR) [Wed, 30 Jan 2013 03:54:00 +0000]
LINUX: ifconfig's output has changed

net-tools in Fedora 18 has changed 'inet addr' to just 'inet' (possibly
to more closely match the ip command).

Change-Id: I9224d0eb4dd77e248c8f8eed966fa26ec7dda08c
Reviewed-on: http://gerrit.openafs.org/8987
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoBuild system: ADd LT_LDRULE_static_NOQ
Simon Wilkinson [Tue, 8 Jan 2013 15:28:17 +0000]
Build system: ADd LT_LDRULE_static_NOQ

Add a NOQ variant of the LT_LDRULE_static build macro, so that it
can be used as part of compound rules.

Change-Id: I45b3d4ff09465d2d472e27c2fd290e0311791403
Reviewed-on: http://gerrit.openafs.org/8902
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agodafs: preattach should wait for exclusive states
Mark Vitale [Fri, 21 Dec 2012 22:56:14 +0000]
dafs: preattach should wait for exclusive states

In rare circumstances an FSYNC_VOL_ON operation may fail silently,
leaving the volume in its previous state.  The only clue is a FileLog
message "volume <nnnn> not in quiescent state".

This is caused by a race condition in the volume package: an
FSYNC_VOL_ON operation is attempting to preattach a volume
(in VPreAttachVolumeByVp_r()) at the same time a fileserver RPC
(e.g. FetchStatus) is detaching the volume (in VReleaseVolumeHandles_r())
at the conclusion of attach2() logic.

The fix calls VWaitExclusiveState_r() before calling
VPreAttachVolumeByVp_r().

Change-Id: Ib66859381d29311fda3e08984dcb740eadafb340
Reviewed-on: http://gerrit.openafs.org/8814
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoParallel libtool build fixes
Marc Dionne [Sat, 2 Feb 2013 17:17:48 +0000]
Parallel libtool build fixes

Serialize the use of libtool in a few places to avoid having
concurrent libtool instances in the same directory..

Change-Id: I5abaeae8f6a31cd84643b7df39c77493d198b600
Reviewed-on: http://gerrit.openafs.org/9024
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Use AFS_OBJECT_REFERENCE_MAX in struct
Jeffrey Altman [Mon, 4 Feb 2013 19:56:27 +0000]
Windows: Use AFS_OBJECT_REFERENCE_MAX in struct

Use AFS_OBJECT_REFERENCE_MAX to size the array in the struct.
This should have been a part of patchset
e267774f1a4f9cc5bfc32c545df36a4bf7947607.

Change-Id: I9323387a27a5bc2e708f8a8424cb38b491d542d7
Reviewed-on: http://gerrit.openafs.org/9066
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoBeautify ubik_print()
Thorsten Alteholz [Sun, 3 Feb 2013 10:58:25 +0000]
Beautify ubik_print()

After lots of intermediate steps a call to ubik_print(), ubik_vprint()
and ubik_dprint*() ends in vFSLog() which adds a timestamp to the output.
So any call to ubik_print(), that does not contain a \n at the end,
makes a mess of the logfile.
The least invasive change will simply add this newline at the end
of any ubik_print() call.
This also prevents long lines in the log, which might appear on
multi-homed hosts with lots of interfaces.

FIXES 1446

Change-Id: I2e44588fcc5b27704dd5fec5a83d99d3a86f86e4
Reviewed-on: http://gerrit.openafs.org/9059
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: cm_SetupFetchBIOD reserving type
Jeffrey Altman [Sun, 3 Feb 2013 19:03:36 +0000]
Windows: cm_SetupFetchBIOD reserving type

Change type of 'reserving' to afs_uint64 to match the return type
of buf_TryReserveBuffers().

Change-Id: I8aaac5a763ec55acada2702b898a9bcd50f82ed0
Reviewed-on: http://gerrit.openafs.org/9062
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: cm_user interlocked operations
Jeffrey Altman [Sun, 27 Jan 2013 20:43:58 +0000]
Windows: cm_user interlocked operations

Convert cm_user refcnts to use interlocked operations.

Change-Id: Ib40d2446792dcde3038ea601281406e013147595
Reviewed-on: http://gerrit.openafs.org/9061
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Fix RDR_BkgFetch rock assigment
Jeffrey Altman [Sun, 3 Feb 2013 06:20:36 +0000]
Windows: Fix RDR_BkgFetch rock assigment

The wrong variables were assigned to the rock base and offset
in the final queuing of a RDR_BkgFetch request within
RDR_RequestFileExtentsAsync.

Introduced in 8b874aa205cd05b8109a296c8cb8ad0bb5114553.

Change-Id: I77af22caed9eceb4c90b8fa18b91945d059995e5
Reviewed-on: http://gerrit.openafs.org/9058
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: dirty threshold 64 * chunksize
Jeffrey Altman [Tue, 29 Jan 2013 17:28:57 +0000]
Windows: dirty threshold 64 * chunksize

must be large enough to keep the pipe full

Change-Id: I1bf8b5800ff286e74dbe57ced19943db891b715f
Reviewed-on: http://gerrit.openafs.org/8996
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: More RDR Garbage Collection
Jeffrey Altman [Tue, 29 Jan 2013 02:12:10 +0000]
Windows: More RDR Garbage Collection

This patchset addresses the failure of AFSVolumeCB, AFSDirectoryCB,
and AFSObjectInformationCB objects to be garbage collected by the
AFSPrimaryVolumeWorker thread.  The AFSPrimaryVolumeWorker thread
is broken up into smaller pieces.

Change-Id: I54749960be8f22313ba7ee5f9f96438be6321f25
Reviewed-on: http://gerrit.openafs.org/8995
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSEvaluateTargetByID Sanity Check Result
Jeffrey Altman [Sun, 27 Jan 2013 20:06:09 +0000]
Windows: AFSEvaluateTargetByID Sanity Check Result

If the file server provides the service with bogus status info
and that status info is inconsistent with the allocated fields
in the associated ObjectInformationCB and FCB structures, it can
result in a BSOD.  Perform some basic sanity checks and if an
inconsistency is discovered, fail the request.  This may result
in the inability to access a file/directory but will prevent a
BSOD.

Change-Id: Iabf66adc5e953dc4ae27ed701148a9ffbf55abcc
Reviewed-on: http://gerrit.openafs.org/8994
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Replace ParentObjectInformation pointer
Jeffrey Altman [Fri, 1 Feb 2013 18:40:22 +0000]
Windows: Replace ParentObjectInformation pointer

Although rare there have been crashes which were the result of
the ObjectInformationCB being freed while another ObjectInformationCB
is pointing to it via the ParentObjectInformation pointer.

This patchset removes the pointer and replaces it with the ParentFileId
which is used to lookup the Parent ObjectInformationCB via the VolumeCB
BTree of all volume objects. The reference counting rules remain the
same.

Change-Id: Iaf66587be2619c8c2f06cd586ef8d423b76d1e79
Reviewed-on: http://gerrit.openafs.org/8993
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Test for PRSFS_INSERT in redirector interface
Jeffrey Altman [Fri, 1 Feb 2013 18:39:22 +0000]
Windows: Test for PRSFS_INSERT in redirector interface

If a test for PRSFS_WRITE fails and the cm_scache.creator is the
current user, then also test for PRSFS_INSERT privilege.

Change-Id: Ib3e34f7ce50216cd9ff82afe9a7184f79d46ce15
Reviewed-on: http://gerrit.openafs.org/8978
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Additional I/O subsystem trace messages for AFSWrite
Jeffrey Altman [Fri, 25 Jan 2013 05:45:21 +0000]
Windows: Additional I/O subsystem trace messages for AFSWrite

When debugging be able to obtain additional details about the
I/O subsystem.

Change-Id: Ie875870cb874c6df0d8f94781656af8a34eeddf5
Reviewed-on: http://gerrit.openafs.org/8977
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: .readonly space reporting
Jeffrey Altman [Fri, 25 Jan 2013 05:18:37 +0000]
Windows: .readonly space reporting

.readonly volumes can be stored on multiple partitions which each
have a different size and free space available.  To ensure consistency
regardless of which partition the .readonly is accessed from and
because .readonly volume sizes cannot change, report the allocation
size of the volume as the partition size.  Continue to report that
volume has zero free sectors because the volume cannot be written to.

Change-Id: Ib57b1175da048344af615b9350d72d9eb3ffe97d
Reviewed-on: http://gerrit.openafs.org/8976
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: FILE_READ_ONLY_VOLUME not FILE_DEVICE_READ_ONLY
Jeffrey Altman [Fri, 25 Jan 2013 05:17:25 +0000]
Windows: FILE_READ_ONLY_VOLUME not FILE_DEVICE_READ_ONLY

Instead of stating that the AFS device is read only; report
that the volume in question is read only using the FILE_READ_ONLY_VOLUME
file system characteristic.

Change-Id: I0b172f8a984802a3cefdea84436c9ed44f34d7f1
Reviewed-on: http://gerrit.openafs.org/8975
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.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>

11 years agoWindows: AFSQueryFsAttributeInfo use service response
Jeffrey Altman [Fri, 25 Jan 2013 05:13:03 +0000]
Windows: AFSQueryFsAttributeInfo use service response

The File System attributes are set by the service in the volume
information request.  Use the values the service provides instead
of returning an incomplete hard coded list.

Change-Id: If620cd520ab29780ef296c6f15dfaee3774c3d41
Reviewed-on: http://gerrit.openafs.org/8974
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: FILE_FS_DEVICE_INFORMATION Device Type
Jeffrey Altman [Fri, 25 Jan 2013 05:11:41 +0000]
Windows: FILE_FS_DEVICE_INFORMATION Device Type

Consistently report our device type as FILE_DEVICE_NETWORK_FILE_SYSTEM
instead of FILE_DEVICE_DISK or FILE_DEVICE_DISK_FILE_SYSTEM except
when returning FILE_FS_DEVICE_INFORMATION where we must lie and state
that the device type is FILE_DEVICE_DISK.  Otherwise, the Win32 API
GetFileType() returns FILE_TYPE_UNKNOWN instead of FILE_TYPE_DISK.

Applications built from msys (but not current cygwin) treat files
of type FILE_TYPE_UNKNOWN as special character devices instead of
files.  This breaks msysGit.

Change-Id: I7107ae84ede31abb01481b2e8c3915588d9fd529
Reviewed-on: http://gerrit.openafs.org/8973
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: RDR_CleanupFile FSync only files
Jeffrey Altman [Tue, 22 Jan 2013 17:46:20 +0000]
Windows: RDR_CleanupFile FSync only files

If the cm_scache type is something other than a file, there
is no point performing an FSync.   Do not incur the overhead.

Take into account any outstanding AsyncStore operations that
might be in-flight.

Change-Id: I66cd59cbcd81f2a7639e478832f921ac393ea3ae
Reviewed-on: http://gerrit.openafs.org/8972
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSCleanupFile always flush on last handle
Jeffrey Altman [Tue, 22 Jan 2013 17:44:21 +0000]
Windows: AFSCleanupFile always flush on last handle

Do not rely on a count of dirty extents to determine if the
service should flush a file during a cleanup operation.  Simply
because there are no dirty extents held by the redirector does
not imply that the service has no dirty buffers for the file.

Change-Id: Ifc7c139a587413626eae145f343c4295dd94f28a
Reviewed-on: http://gerrit.openafs.org/8971
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: clear ASYNCSTORING flag in scache recycle
Jeffrey Altman [Sun, 20 Jan 2013 18:27:51 +0000]
Windows: clear ASYNCSTORING flag in scache recycle

If the scache has been recycled the ASYNCSTORING flag cannot
be accurrate.  Clear it.

Change-Id: Ie5a5a19bf1818e36f6274ba24ddeaf5f4b835ff4
Reviewed-on: http://gerrit.openafs.org/8970
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: restructure daemon state tracking
Jeffrey Altman [Sun, 20 Jan 2013 18:26:24 +0000]
Windows: restructure daemon state tracking

Move all of the per thread state info into a struct and
allocate an array of structs instead of an array for each
data type.

Change-Id: I25b878192a8f919b21d96e981d7369a429b9171d
Reviewed-on: http://gerrit.openafs.org/8969
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: osisleep cleanup
Jeffrey Altman [Sun, 20 Jan 2013 18:23:50 +0000]
Windows: osisleep cleanup

Change-Id: Id76989dfab53a166a4174569973fb0a5f5e5e972
Reviewed-on: http://gerrit.openafs.org/8968
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: remove out of date cm_buf #define
Jeffrey Altman [Fri, 18 Jan 2013 02:02:36 +0000]
Windows: remove out of date cm_buf #define

Change-Id: Id60f509d7c8a1e9eb2f94d4c481d00e9b820b827
Reviewed-on: http://gerrit.openafs.org/8967
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Convert BkgDaemon Procedures to use rock
Jeffrey Altman [Thu, 17 Jan 2013 06:44:27 +0000]
Windows: Convert BkgDaemon Procedures to use rock

The BkgDaemon functions accepted four 32-bit parameters into
which 64-bit offsets and lengths were fit.  Convert the routines
to use a procedure specific rock type which is allocated by the
caller to cm_QueueBkgRequest and freed by cm_BkgDaemon.

The use of a rock will permit greater flexibility for future
background procedures to be implemented that require more complex
data to be passed around.

Change-Id: I4fc06e1d4a3a3ee25c699c95a90a9c9993199ddd
Reviewed-on: http://gerrit.openafs.org/8966
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Set dirty page limit to 2 x ChunkSize / 4096
Jeffrey Altman [Thu, 17 Jan 2013 06:42:54 +0000]
Windows: Set dirty page limit to 2 x ChunkSize / 4096

4096 is the size of a memory manager page.  ChunkSize is in octets.
Windows doesn't wait until the limit is reached to begin flushing
and ChunkSize is not a hard limit.

Change-Id: Ic1d5dda18eefbf309696b8a19ef5623248f54faf
Reviewed-on: http://gerrit.openafs.org/8965
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.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>

11 years agoWindows: Add CM_MERGEFLAG_CACHE_BYPASS
Jeffrey Altman [Fri, 25 Jan 2013 00:42:41 +0000]
Windows: Add CM_MERGEFLAG_CACHE_BYPASS

If a store operation is performed direct to the file server
bypassing the AFSCache, call cm_MergeStatus() with
CM_MERGEFLAG_CACHE_BYPASS to ensure that the valid version
numbers for the cm_scache_t object are incremented appropriately.
After a cache bypass occurs, only buffers with the current
data version number are valid since the cached data will be
incomplete.

Change-Id: I9438f8c9759407de69ab894df4f6fe91027a4b94
Reviewed-on: http://gerrit.openafs.org/8964
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSInitPIOCtlDirectoryCB fixes
Jeffrey Altman [Thu, 31 Jan 2013 02:45:44 +0000]
Windows: AFSInitPIOCtlDirectoryCB fixes

Rename ObjectInfo parameter to ParentObjectInfo since
it does represent the parent of the PIOCtlDirectoryCB
that is being allocated.

If the AFS_DIR_ENTRY_TAG allocation fails, do not call
AFSDeleteObjectInfo( pObjectInfoCB) prior to the try_return
because AFSDeleteObjectInfo() will be executed in the try_exit
block.

Finally, do not increment the pDirNode->ObjectInformationCB
reference count when returning STATUS_REPARSE.  The reference
count is tracked by the pDirNode pointer and has already been
allocated.

Change-Id: Iac3d2b1b58d3bf12eb08c92b96beca43e794aef5
Reviewed-on: http://gerrit.openafs.org/8963
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Additional trace %p and %d changes
Jeffrey Altman [Fri, 25 Jan 2013 00:28:44 +0000]
Windows: Additional trace %p and %d changes

Use %p when logging pointers.

Use %d for counts.

Change-Id: Ib3a3b1226945eccb15d912d7ff1c83f0257e7acd
Reviewed-on: http://gerrit.openafs.org/8962
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSProcessCreate drop DirOpenRefCount on exit
Jeffrey Altman [Fri, 25 Jan 2013 00:25:37 +0000]
Windows: AFSProcessCreate drop DirOpenRefCount on exit

AFSProcessCreate() must not maintain its DirOpenReferenceCount
when bFileCreated is true because the AFSCcb maintains its own
count and the one obtained by AFSProcessCreate() will only be
leaked.

Change-Id: I6591eb1c10d3dffe7449894b29c9999f5db91d64
Reviewed-on: http://gerrit.openafs.org/8961
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Trace DirectoryCB allocations
Jeffrey Altman [Fri, 25 Jan 2013 00:14:42 +0000]
Windows: Trace DirectoryCB allocations

Add a trace subsystem for tracking Directory Entry allocations
and deallocations to assist with debugging.

Change-Id: Ic5f0361bf10752f50d433d3e9f4792b32bec8de1
Reviewed-on: http://gerrit.openafs.org/8960
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Introduce NameArray Reference Counts
Jeffrey Altman [Thu, 24 Jan 2013 23:55:24 +0000]
Windows: Introduce NameArray Reference Counts

Split the DirOpenReferenceCounts into those related to DirectoryCB
reference counting unrelated to the NameArrays and those that are
related to the NameArrays.  This helps track down the source of
overcounts and undercounts.

Change-Id: Ie3c6f15394fe116761e32ed4d7756a4bf6a5549f
Reviewed-on: http://gerrit.openafs.org/8959
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSSetRenameInfo Notify correct object of change
Jeffrey Altman [Thu, 24 Jan 2013 23:52:51 +0000]
Windows: AFSSetRenameInfo Notify correct object of change

When AFSSetRenameInfo makes a change, it is the parent object
that must be notified not the parent of the parent.

Change-Id: I56b3f1c076cb4abb4b5e41aed261e867a2d2ebb7
Reviewed-on: http://gerrit.openafs.org/8958
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.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>

11 years agoWindows: Allocated VolumeCB from PagedPool
Jeffrey Altman [Thu, 24 Jan 2013 23:51:01 +0000]
Windows: Allocated VolumeCB from PagedPool

Only the non-paged portion of the VolumeCB should be allocated
from the non-paged pool.  Allocate the VolumeCB itself from the
paged pool.

Change-Id: If248faf78546bb34fd1ba1ddcc1acb5a6da20c6f
Reviewed-on: http://gerrit.openafs.org/8957
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.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>

11 years agoWindows: Move VolumeWorkerContext to NonPaged pool
Jeffrey Altman [Sun, 27 Jan 2013 04:19:05 +0000]
Windows: Move VolumeWorkerContext to NonPaged pool

The VolumeWorkerContext contains a KEVENT which must be allocated
from the NonPaged pool.  Move it to the AFSNonPagedVolumeCB struct.

Change-Id: If24ea5f22e6cc7e71328d0d2d8e0c8b9209ce5b2
Reviewed-on: http://gerrit.openafs.org/8992
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Categorize ObjectInformationCB RefCnts
Jeffrey Altman [Thu, 24 Jan 2013 23:44:33 +0000]
Windows: Categorize ObjectInformationCB RefCnts

To assist in tracking down the source of ObjectInformationCB
overcounts and undercounts, add an advisory array which tracks
the reference counts by category.  In the procress ensure that
all reference count changes are logged by tracing.

Change-Id: I813cd0af5e12e36ba9863577dbd35abef6339414
Reviewed-on: http://gerrit.openafs.org/8956
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFS_SUBSYSTEM_OBJECT_REF_COUNTING fixes
Jeffrey Altman [Thu, 24 Jan 2013 23:24:55 +0000]
Windows: AFS_SUBSYSTEM_OBJECT_REF_COUNTING fixes

A large number of trace messages monitoring ObjectInformationCB
reference counting were categorized under AFS_SUBSYSTEM_FCB_REF_COUNTING
instead of AFS_SUBSYSTEM_OBJECT_REF_COUNTING.  This patchset applies
the correct subsystem category.

Change-Id: I6c309b42b3d679f961d82c1a975d84122c9275f9
Reviewed-on: http://gerrit.openafs.org/8955
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Reduce RDR Object Lifetime
Jeffrey Altman [Thu, 24 Jan 2013 21:29:52 +0000]
Windows: Reduce RDR Object Lifetime

Adjust the redirector object lifetime from 10 minutes (600 seconds)
to 20 seconds.  The object lifetime is how long an object can remain
idle before garbage collection is permitted.

Change-Id: I8db89bfb0ccd40e9295dcbb30fbc2c96813d9fc9
Reviewed-on: http://gerrit.openafs.org/8954
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agowindows: Update raw fetch/store operations
Jeffrey Altman [Sun, 13 Jan 2013 15:15:02 +0000]
windows: Update raw fetch/store operations

rawops.c is a hold over from Eric Williams' original attempt
to implement an AFS redirector.  When the rest of the his code
was purged from the tree and replaced with a more complete
implementation based upon the Kernel Drivers's File System
framework rawops.c was left behind.

Although the source file has been compiled as part of the build,
its functions ReadData and WriteData have never been called.  This
patchset:

 1. renames the functions to raw_ReadData and raw_WriteData

 2. modifies the function signatures and provides a header
    with prototypes

 3. requires that cm_scache.rw be write-locked upon entry

 4. renames variables

 5. removes the #define CM_BUF_BUFSIZE and relies upon
    cm_data.blockSize instead

 6. Always write back the current range as an async store
    instead of the previous chunk as random write patterns
    will fail to store all of the dirty buffers.

Change-Id: I1594b2950ab14da0c0de2a382fd1ba8248a9d1c6
Reviewed-on: http://gerrit.openafs.org/8953
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agovlclient: add -probe option
Michael Meffie [Wed, 16 Jan 2013 17:10:02 +0000]
vlclient: add -probe option

Add a new option to the vlclient test program to call the
probe server RPC to ping the vlservers in a cell. Uses a multi
rx call to do the probes in parallel.

The existing -host option can be used to ping a single
vlserver.

Change-Id: I25666b7ff139ae43364ac04869b14997f3ed0d53
Reviewed-on: http://gerrit.openafs.org/8911
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>