openafs.git
11 years agoWindows: cm_BkgFetch do not impose arbitrary timeout
Jeffrey Altman [Wed, 2 May 2012 22:20:45 +0000]
Windows: cm_BkgFetch do not impose arbitrary timeout

The afs redirector will queue extent requests for the entire file
if it is being copied to local disk as long as there is enough
page cache space to store it.  If the file is 8GB and the bandwidth
from the file server is 100K/second it may take a while to get to
the end of the request queue.  Do not arbitrarily time out the
requests.

Change-Id: I12d9358ee5de37fc78d68c8e07dd14ca5dda1832
Reviewed-on: http://gerrit.openafs.org/7320
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: Treat all cached writes as write-through
Jeffrey Altman [Wed, 2 May 2012 22:05:26 +0000]
Windows: Treat all cached writes as write-through

Treat all writes that are cached in the windows page cache as
write-through requests so that they are delivered immediately to
the AFS cache.

The upside is that the afsd service can begin to store data to the
file server immediately which can be of significant importance whe
the AFSCache is larger than the file size and the file size is large
and the bandwidth to the file server is slow.  In that situation
the entire file can be written into the windows page cache and
will only be flushed to disk at the last handle close on the file.

The downside is that all data will be written to the file server
including that for files that will later have the delete pending
flag applied.

Change-Id: Icff536f9ec768068692c1e024a943448409e7e40
Reviewed-on: http://gerrit.openafs.org/7319
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: AFSQueueFlushExtents permit NULL AuthGroup
Jeffrey Altman [Wed, 2 May 2012 22:04:23 +0000]
Windows: AFSQueueFlushExtents permit NULL AuthGroup

If the AuthGroup is NULL, search for an AuthGroup to use when
queuing the flush extents request.

Change-Id: Ie77f292dd992c4f8621434cecc70c7633de60320
Reviewed-on: http://gerrit.openafs.org/7318
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: refactor AFSCleanupFcb
Jeffrey Altman [Wed, 2 May 2012 22:02:28 +0000]
Windows: refactor AFSCleanupFcb

move the checks for deleted and invalid files earlier in the
function to simplify other conditional tests.

Change-Id: I973f411b65c0327227f07718ae764572d6f37c85
Reviewed-on: http://gerrit.openafs.org/7317
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: correct typos or mistaken comments
Jeffrey Altman [Wed, 2 May 2012 22:01:31 +0000]
Windows: correct typos or mistaken comments

Change-Id: Iae278c0121c1b4d3cc9aaab276fab798c1a8065b
Reviewed-on: http://gerrit.openafs.org/7316
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: RDR_RequestFileExtentsAsync set current DV
Jeffrey Altman [Wed, 2 May 2012 21:58:39 +0000]
Windows: RDR_RequestFileExtentsAsync set current DV

if the buffer returned from cm_GetBuffer() has an offset that is
beyond the serverLength and it has a "bad" data version, set the
data version to the current value.  This is for debugging clarity.

Change-Id: Icb3ee4accd0219a41813c44428070248245f2549
Reviewed-on: http://gerrit.openafs.org/7315
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: refactor cm_GetBuffer avoid BIOD construction
Jeffrey Altman [Wed, 2 May 2012 21:52:44 +0000]
Windows: refactor cm_GetBuffer avoid BIOD construction

Constructing a BIOD is a very expensive operation as it requires
obtaining exclusive locks on each and every buffer that in the
collection.  The prior code would construct a BIOD for a chunk
worth of buffers and then check to see if the current buffer is
beyond the serverLength or the truncation position.  If so, the
buffer is cleared and the buffer is returned as current after
releasing the BIOD.  This is very wasteful.  Instead, check every
buffer in the BIOD to see if it should be made current or not.
If yes, do so before releasing the BIOD.  This permits the construction
of the BIOD to be avoided for the rest of the buffers in the chunk.

Change-Id: I0a413f8be9686cd0e326a3ea3608ca954cdf4370
Reviewed-on: http://gerrit.openafs.org/7314
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: cm_InitDaemon initialize cm_bkgQueueCountp[]
Jeffrey Altman [Wed, 2 May 2012 21:47:46 +0000]
Windows: cm_InitDaemon initialize cm_bkgQueueCountp[]

Change-Id: Ie4abd1c26d54208921a78e421b447a8f4fc5684a
Reviewed-on: http://gerrit.openafs.org/7313
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: cm_QueueBKGRequest improvements
Jeffrey Altman [Wed, 2 May 2012 21:42:59 +0000]
Windows: cm_QueueBKGRequest improvements

Do not add duplicate requests into the queue.  Outstanding extent requests
will be re-issued by the afs redirector on a periodic basis while
waiting for them to be satisfied.  If they are pending there is no
need to remember them a second time.

Use separate queues for Fetch and Store operations.  Store operations
might be blocked on the file server but a Fetch operation might be served
from the cache.

Change-Id: I8e15c71275921c9a062944d52bf97a0ba68fe430
Reviewed-on: http://gerrit.openafs.org/7312
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: buf_GetNewLocked skip redirector owned buffers
Jeffrey Altman [Wed, 2 May 2012 21:39:12 +0000]
Windows: buf_GetNewLocked skip redirector owned buffers

If a buffer is owned by the afs redirector, regardless of whether
or not it is dirty, do not use it.

Change-Id: Icc92f3cb8606ac67bcf561d409c76bd5a4a7bc06
Reviewed-on: http://gerrit.openafs.org/7311
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: buf_RemoveFromRedirQueue in buf_Init
Jeffrey Altman [Wed, 2 May 2012 20:57:11 +0000]
Windows: buf_RemoveFromRedirQueue in buf_Init

use buf_RemoveFromRedirQueue in buf_Init instead of the roughly
duplicated code.

Change-Id: Ibf070d3e44f7a0749d1046c9d1168bdfb9aa6f2b
Reviewed-on: http://gerrit.openafs.org/7310
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: AFSInitializeProcessCB failure stack exhaustion
Jeffrey Altman [Wed, 2 May 2012 18:32:01 +0000]
Windows: AFSInitializeProcessCB failure stack exhaustion

If AFSInitializeProcessCB() fails in AFSProcessCreate() it can
lead to a recursive loop of AFSValidateProcessEntry() ->
AFSProcessCreate() calls.  Only call AFSValidateProcessEntry()
if AFSInitializeProcessCB() succeeds.  On failure, log an error
to the trace log.

Change-Id: I67a65bed9a3193a5ce44eb01d30aed15fe9e469d
Reviewed-on: http://gerrit.openafs.org/7309
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: More useful AFSDumpFile exception info
Jeffrey Altman [Mon, 30 Apr 2012 10:22:41 +0000]
Windows: More useful AFSDumpFile exception info

Modify AFSExceptionFilter to accept the __FUNCTION__ name
where the exception occurred.

Generate the trace dump file after the exception has been
handled so that it is possible to see where it happened
in the trace output.

Change-Id: Icddafc1066dd85b63d8d97c40c0f76c54d181ebe
Reviewed-on: http://gerrit.openafs.org/7308
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: VNOSERVICE error translation
Jeffrey Altman [Mon, 30 Apr 2012 10:18:58 +0000]
Windows: VNOSERVICE error translation

Translate VNOSERVICE as CM_ERROR_RETRY and not CM_ERROR_OFFLINE.

Change-Id: I6daf9b9fb607192cedc057c518137772a7eb1bab
Reviewed-on: http://gerrit.openafs.org/7307
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: VNOSERVICE message text
Jeffrey Altman [Mon, 30 Apr 2012 10:18:06 +0000]
Windows: VNOSERVICE message text

correct message text to indicate that an rpc has not been serviced.

Change-Id: Id2d82756253136ae6221aa2227be64bf654ee36e
Reviewed-on: http://gerrit.openafs.org/7306
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: reorg RDR_CleanupFile to prevent lock leak
Jeffrey Altman [Sun, 29 Apr 2012 14:31:07 +0000]
Windows: reorg RDR_CleanupFile to prevent lock leak

RDR_CleanupFile could fail to drop a file lock if the user does
not have write permission on last handle close even if the file
is readonly or there were no dirty extents to be stored.  The
error handling would return the error immediately and skip the
file lock release.   This patchset changes the logic so that the
user permissions are not tested if the file is located on a readonly
volume or if there are no dirty extents or metadata changes to store.

In addition, if there is an error, skip to unlock processing and
not to function exit processing.

Change-Id: I03f8cbbae5ead2a66ce261631e7e34dd533de930
Reviewed-on: http://gerrit.openafs.org/7292
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agovos: Default to server confdir for -localauth
Andrew Deason [Thu, 3 May 2012 19:57:08 +0000]
vos: Default to server confdir for -localauth

For -localauth, we traditionally default to using the server
configuration directory, since that's usually the dir that has the
KeyFile in it. Keep doing that with the new ubik client interface.

Change-Id: I0f7e1ed180874f52c2b91b1ea3f74e763c26cd0c
Reviewed-on: http://gerrit.openafs.org/7324
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agovos: Correct comment
Andrew Deason [Thu, 3 May 2012 19:55:39 +0000]
vos: Correct comment

This is -localauth, not -serverauth

Change-Id: I8337c231905a5424b5a91b0ed981adade64ca144
Reviewed-on: http://gerrit.openafs.org/7323
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agovos setaddrs: notice unexpected errors
Andrew Deason [Thu, 3 May 2012 17:40:40 +0000]
vos setaddrs: notice unexpected errors

Currently 'vos setaddrs' only prints a message and errors out if the
VL_RegisterAddrs call fails with certain error codes (VL_MULTIPADDR
and RXGEN_OPCODE). But if we get something else like an access error,
we should of course print that out, instead of reporting success.

Change-Id: Id90c65604289651d9f20fb1ab2c706446162f324
Reviewed-on: http://gerrit.openafs.org/7322
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agovolinfo: show header filenames even if error
Michael Meffie [Wed, 11 Apr 2012 19:34:29 +0000]
volinfo: show header filenames even if error

When invoked with -header option, print the header inode
number, and namei filename, even if the header file cannot
be opened.

Change-Id: Id2a2e63f07e12cd817718a9da63d24250718ae06
Reviewed-on: http://gerrit.openafs.org/7190
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agobozo: increase salvage instance poll rate
Michael Meffie [Tue, 17 Apr 2012 02:29:24 +0000]
bozo: increase salvage instance poll rate

Increase the bos client poll rate of the salvager temporary bnode
instance status, from every 5 seconds to 1 second.  This reduces the
minimum time bos salvage takes, from 5 seconds to 1 second, which
can add up when doing a large number of volume salvages.

Change-Id: Ia0f48bfabae9442ab0f1b4a6f43df34699892f66
Reviewed-on: http://gerrit.openafs.org/7231
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoRevert "viced: avoid crash if missing volume header"
Jeffrey Altman [Thu, 3 May 2012 02:32:22 +0000]
Revert "viced: avoid crash if missing volume header"

This reverts commit 2b40e6d2abbf842e6823661b94cfa9aa833b9990

Change-Id: I9df0fd4fa6232286babdf64da54d491d2ec1e91a
Reviewed-on: http://gerrit.openafs.org/7321
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoviced: avoid crash if missing volume header
Michael Meffie [Tue, 1 May 2012 14:09:44 +0000]
viced: avoid crash if missing volume header

Avoid a fileserver crash if the volume header is
missing in SetVolumeSync.

Change-Id: I509081306402fc7147d0624aa1181330b9fa9fc5
Reviewed-on: http://gerrit.openafs.org/7301
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agolibafs: log server errors on hard mount retry
Michael Meffie [Mon, 23 Apr 2012 18:42:24 +0000]
libafs: log server errors on hard mount retry

Save the last errors seen during a request and log those
errors if a hard-mount retry is done.

Change-Id: I65e41207c5f667c41c7f9cf459243118e5baa074
Reviewed-on: http://gerrit.openafs.org/7275
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoWindows: Cc FileObject Settings
Jeffrey Altman [Sun, 29 Apr 2012 14:40:31 +0000]
Windows: Cc FileObject Settings

Modify the assigned CcSetReadAheadGranularity() from 64K to
the afsd_service configured chunk size.

Assign a CcSetDirtyPageThreshold() to be twice the configured chunk size.

Change-Id: I1cfa67612058cf5e08906e369236d0d8a48c54f0
Reviewed-on: http://gerrit.openafs.org/7294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: correct cm_Analyze log message
Jeffrey Altman [Sun, 29 Apr 2012 14:37:35 +0000]
Windows: correct cm_Analyze log message

A VNOSERVICE log message takes three parameters and not one.
Use the correct log macro.

Change-Id: Iedb5e568b7ac39c061c0b70738a5c7ac670d9687
Reviewed-on: http://gerrit.openafs.org/7293
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: remove unnecessary libs from aklog/asetkey
Jeffrey Altman [Fri, 27 Apr 2012 12:54:56 +0000]
Windows: remove unnecessary libs from aklog/asetkey

Unnecessary lwp libs were linked into the aklog/asetkey binaries
on Windows.  lwp and pthread should not be mixed.

Change-Id: I53deed9ab210b8ccb394e754c66e15f35dfe89c2
Reviewed-on: http://gerrit.openafs.org/7289
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: Remove High Security Integrated Logon
Jeffrey Altman [Thu, 26 Apr 2012 00:16:22 +0000]
Windows:  Remove High Security Integrated Logon

High security mode for integrated logon never was high security.
It use was deprecated in the 1.5 series and it has no use at all
in the afs redirector world.  Remove it.

FIXES: 21702

Change-Id: I019b4fecc430517d29195e79e39529a782c88073
Reviewed-on: http://gerrit.openafs.org/7285
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: fs getcacheparms
Jeffrey Altman [Wed, 25 Apr 2012 22:05:01 +0000]
Windows: fs getcacheparms

The get cache params output is supposed to include two values:

 . the size of the cache

 . the size of the cache in use

Windows no longer has a concept of an unused cache buffer.  All
buffers are inserted onto the freelist and are available for
recycling when the AFSCache file is created.  Instead of reporting
the used cache space as 0K, report it as the full cache in use.
It is likely to disturb users less.

Change-Id: I6c1475f26e561d245bfa2b658c77ba683f735bb5
Reviewed-on: http://gerrit.openafs.org/7284
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agodoxygenize afs_analyze
Michael Meffie [Sun, 29 Apr 2012 03:46:26 +0000]
doxygenize afs_analyze

Change-Id: Idb5d873a0c2727928f80364aa5e99e48c05649ad
Reviewed-on: http://gerrit.openafs.org/7291
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agovol: A GOING_OFFLINE volume should yield VOFFLINE
Andrew Deason [Fri, 27 Apr 2012 17:59:25 +0000]
vol: A GOING_OFFLINE volume should yield VOFFLINE

Currently, GetVolume treats a volume in the VOL_STATE_GOING_OFFLINE
state the same as VOL_STATE_SHUTTING_DOWN, and so returns VNOVOL for a
GOING_OFFLINE volume, but these states are very different.

GOING_OFFLINE indicates that a volume should soon be in the UNATTACHED
state, so we should treat GOING_OFFLINE the same as UNATTACHED for
returning errors to the user. For UNATTACHED, we return specialStatus
if it's set, or VOFFLINE otherwise; so, just do the same for
GOING_OFFLINE.

Change-Id: Ia9500d2cfd90b8c15782a06025f39298810d0a99
Reviewed-on: http://gerrit.openafs.org/7290
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agolibafs: don't crash on no addresses in afs_Conn
Derrick Brashear [Thu, 26 Apr 2012 13:24:25 +0000]
libafs: don't crash on no addresses in afs_Conn

we try to avoid a crash on a missing serverHost; do the same
on missing addrs in that host

FIXES 130714

Change-Id: Ic6bab8654cf7bf85351a9482b9ba5d51e5a768d5
Reviewed-on: http://gerrit.openafs.org/7287
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoWindows: AFSValidateEntry CcPurge on DV change
Jeffrey Altman [Tue, 24 Apr 2012 19:41:39 +0000]
Windows: AFSValidateEntry CcPurge on DV change

The variable bPurgeExtents was not being set when a DV change
was detected in AFSValidateEntry().  This resulted in the purge
being skipped and old data being left in the cache.

Change-Id: I6f5a35e5c7a51d28267e0ff25318782a766771ac
Reviewed-on: http://gerrit.openafs.org/7280
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: Directory validation should purge data changes immediately
Jeffrey Altman [Tue, 24 Apr 2012 00:18:20 +0000]
Windows: Directory validation should purge data changes immediately

During AFSEnumerateDirectory() and AFSVerifyDirectoryContent() calls
use AFSPerformObjectInvalidate() instead of AFSInvalidateObject()
to trigger the data purge.  This is necessary to avoid a race as
AFSInvalidateObject() will queue a work request that will be performed
after the metadata is updated.

Change-Id: Iaf09c6448927a037175cb4a83502fd4a1d210ef2
Reviewed-on: http://gerrit.openafs.org/7279
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: Flag purge on close if CcPurgeCacheSection fails
Jeffrey Altman [Tue, 24 Apr 2012 00:08:47 +0000]
Windows: Flag purge on close if CcPurgeCacheSection fails

CcPurgeCacheSection can fail.  If it does, remember that the
purge still needs to be performed by setting the
AFS_FCB_FLAG_PURGE_ON_CLOSE flag on the File Control Block.

Change-Id: I83fab09ed5c506879e219606f8b10fdd7c021204
Reviewed-on: http://gerrit.openafs.org/7278
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agomacos: remove mistyped vnode warning
Derrick Brashear [Mon, 23 Apr 2012 02:45:09 +0000]
macos: remove mistyped vnode warning

newborn vnodes are corrected if needed; don't worry about it.

Change-Id: I3bc4d6e9a467a8e09a3a77e027254f0da1448f80
Reviewed-on: http://gerrit.openafs.org/7270
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

11 years agotests: More fixes for the vos test
Simon Wilkinson [Sun, 22 Apr 2012 17:19:07 +0000]
tests: More fixes for the vos test

The vos test wasn't running correctly from runtests, as it contained
a relative path which assumed that the CWD was tests/volser, rather
than tests/

Modify this to use the BUILD environment variable when invoked from
runtests, and also add an exit after the exec(), so that if we do
fail to launch the binary we don't have two processes both running
the same code.

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

11 years agolibafs: stop bkg first
Derrick Brashear [Wed, 18 Apr 2012 15:58:52 +0000]
libafs: stop bkg first

because background daemons can have dependence on other subsystems, but
are not needed for other operations, stop them first.

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

11 years agomacos: lock module against unload during shutdown
Derrick Brashear [Wed, 18 Apr 2012 15:58:03 +0000]
macos: lock module against unload during shutdown

during shutdown, once umount finished, it was possible to
unload the module before shutdown completed. fix that.

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

11 years agoWindows: Add global root to name array if share name
Jeffrey Altman [Thu, 19 Apr 2012 11:14:16 +0000]
Windows: Add global root to name array if share name

If the share name was resolved by querying the service instead
of finding the entry in the root.afs root directory, construct
a name array in AFSParseName() that includes the AFSGlobalRoot
above the resolved share root directory.

In AFSBackupEntry, check for the case where two volume root entries
appear in sequence without an intervening mount point.

Change-Id: Ied0e0dc8226b0460d85a1f3a8b389294cfdef34b
Reviewed-on: http://gerrit.openafs.org/7252
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: cm_ResetACLCache handle NULL cellp
Jeffrey Altman [Thu, 19 Apr 2012 09:14:51 +0000]
Windows: cm_ResetACLCache handle NULL cellp

It is valid for the cellp parameter to be NULL.  When invalidating
all ACLs for a user pass 0 to cm_EAccesClearUserEntries().

FIXES 130704

Change-Id: Ic6b6e5f1c2e10aa633390ee3d7c709dc202bbd29
Reviewed-on: http://gerrit.openafs.org/7251
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoWindows: reverse order of EACCESS and USER locks
Jeffrey Altman [Wed, 18 Apr 2012 21:26:00 +0000]
Windows: reverse order of EACCESS and USER locks

The user lock is obtain while holding the eaccess lock.
Reflect it in the hierarchy.

Change-Id: I3aac945287415cd3babbe52f9fdeb93ab4d729bd
Reviewed-on: http://gerrit.openafs.org/7247
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoptserver: Complete pr_realmName removal
Simon Wilkinson [Sat, 21 Apr 2012 20:08:13 +0000]
ptserver: Complete pr_realmName removal

Commit 9ddf9eca56e02be978ff7d065ee16c85de2cfb06 changed the mechanism
by which the local realm is determined such that pr_realmName is
no longer required.

Tidy things up by removing the unecessary variable.

Change-Id: I9b21340a8ecd38fbb8326dbed276882c9f0e9a62
Reviewed-on: http://gerrit.openafs.org/7266
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agoconfigure: solariscc check update
Michael Meffie [Thu, 19 Apr 2012 19:15:04 +0000]
configure: solariscc check update

Add checks for recent versions of sunstudio for solaris.  The
installation paths are documented in the release notes of versions
12.1, 12.2, and 12.3.

Change-Id: Ic28f40a061f288a1c39acb6a5d11e81876631d7f
Reviewed-on: http://gerrit.openafs.org/7253
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agorx_identity: Add a super user value
Simon Wilkinson [Sat, 21 Apr 2012 10:25:25 +0000]
rx_identity: Add a super user value

Add an RX identity type that can be used to represent the super user
who is granted access using printed tickets.

Change-Id: I3d6e657a04136746b502efa7698901225410f3c0
Reviewed-on: http://gerrit.openafs.org/7261
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agorx: Make identity and opaque usable with NULL vals
Simon Wilkinson [Sat, 21 Apr 2012 10:24:25 +0000]
rx: Make identity and opaque usable with NULL vals

Make it possible to have NULL values for elements of the rx_identity
and rx_opaque structures.

Change-Id: I3624d490d92da3cf75da5edb91c7d4e5ce1fa937
Reviewed-on: http://gerrit.openafs.org/7260
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agotests: Move token faking code to its own file
Simon Wilkinson [Fri, 20 Apr 2012 17:13:30 +0000]
tests: Move token faking code to its own file

Move the token faking code out of superuser-t.c into its own file in
tests/common, so it can be used by other tests.

Change-Id: I7b420250ef974b4b80a8dde692d2666657bb82ca
Reviewed-on: http://gerrit.openafs.org/7259
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agotests: Make afstest_StopVLServer generic
Simon Wilkinson [Fri, 20 Apr 2012 14:36:29 +0000]
tests: Make afstest_StopVLServer generic

The StopVLServer function can be used to stop any server for which
we know the pid. So, rename it as afstest_StopServer to make this
apparent.

Change-Id: Ia5973342e81dc15a698e84e69b314cd6157831f7
Reviewed-on: http://gerrit.openafs.org/7258
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agotests: Abstract out code to produce a Ubik client
Simon Wilkinson [Fri, 20 Apr 2012 14:34:26 +0000]
tests: Abstract out code to produce a Ubik client

Abstract out the code which the volser test uses to produce a
ubik client so that it can be used to test other ubik services

Change-Id: I800fda9e53ad45c91f3de8eceea387cc011dda3c
Reviewed-on: http://gerrit.openafs.org/7257
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoptserver: Refactor per-call ubik initialisation
Simon Wilkinson [Sat, 21 Apr 2012 06:43:59 +0000]
ptserver: Refactor per-call ubik initialisation

The way in which the ubik database is initialised is identical for
all read transactions, and for all write transactions. Rather than
duplicating this code in each call handler, pull it out into two
helper functions - ReadPreamble and WritePreamble.

Change-Id: I40f2d8d609bc4e6e8e3e0fc8851da86978c77818
Reviewed-on: http://gerrit.openafs.org/7256
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agotests: Add missing vos test
Simon Wilkinson [Sat, 21 Apr 2012 18:24:10 +0000]
tests: Add missing vos test

Add the missing volser/vos test, and fix it so that the plan is correct

Change-Id: I017679176f5df8fb18002175a75ac0dcd108aded
Reviewed-on: http://gerrit.openafs.org/7255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoptserver: Remove PR_REMEMBER_TIMES
Simon Wilkinson [Sun, 22 Apr 2012 09:58:17 +0000]
ptserver: Remove PR_REMEMBER_TIMES

The #define PR_REMEMBER_TIMES is always true, so remove the #define,
and all of the #ifdefs that it triggers

Change-Id: I445a2cd8f5e5b2570e6ef1311cc6bb3d66592fdc
Reviewed-on: http://gerrit.openafs.org/7264
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

11 years agoutil: Completely remove get_krbrlm
Simon Wilkinson [Sat, 21 Apr 2012 19:55:23 +0000]
util: Completely remove get_krbrlm

Commit d85ece0977e043154b7d8f5aef5f4cd972771e8e added a new
mechanism for determining whether a realm is local or not, and
susequent commits removed all in-tree calls to the now-legacy
functions in get_krbrlm.c

To avoid confusion, just remove all of these legacy functions, as
we don't want to end up supporting two ways of doing this
operation.

This change is not suitable for pullup to a stable release.

Change-Id: Ie2f5c447f751d12a0d85a4a438efd7e210133e97
Reviewed-on: http://gerrit.openafs.org/7263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

11 years agodumpscan: Add missing .gitignore
Simon Wilkinson [Sat, 21 Apr 2012 19:32:38 +0000]
dumpscan: Add missing .gitignore

Add the missing gitignore file from the new src/tools/dumpscan
directory

Change-Id: I8fc7a3de4e717ef657c331a5ce82afb8f05ff726
Reviewed-on: http://gerrit.openafs.org/7262
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agotests: Add a RX functionality test
Simon Wilkinson [Wed, 18 Apr 2012 11:46:31 +0000]
tests: Add a RX functionality test

Use the rxperf performance testing tools to add a couple of simple
RX tests. The first moves 1Mbyte of data backwards and forwards 30
times. The second starts 30 threads, which each move 1MByte of data
once.

This is by no means an exhaustive test of RX, but the single and
multi-threaded invocations should provide a useful smoke test if
things get very broken.

Change-Id: I11267be067cf6c05a20aeb90a18ed4031502a1b1
Reviewed-on: http://gerrit.openafs.org/7244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agorxperf: Move into the tools directory
Simon Wilkinson [Tue, 17 Apr 2012 22:19:17 +0000]
rxperf: Move into the tools directory

Move the 'rxperf' RX performance testing utility out of the
src/rx/test directory, and into the slightly more visible top level
src/tools/ directory

As this is the first time that rxperf has been built as part of the
default build, make a number of changes so that it will build on all
of our supported platforms.

Change-Id: Ice37e7db694dbfed34009bf76d24f1e0bf272e47
Reviewed-on: http://gerrit.openafs.org/7240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoroken: Add setprogname
Simon Wilkinson [Wed, 18 Apr 2012 22:25:33 +0000]
roken: Add setprogname

Add setprogname to the list of functions that we test for, and replace
with a libroken alternative if it is missing.

Remove setprogname and getprogname from the AC_CHECK_FUNCS list, as
AC_REPLACE_FUNCS is a superset of this test.

Change-Id: If81dc8ba6d9245329f3abae6a6f062e3827dcfab
Reviewed-on: http://gerrit.openafs.org/7250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoImport of code from heimdal
Heimdal Developers [Wed, 18 Apr 2012 22:16:39 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
ee7340860a22f81fb869cc431efc1fd4e5c77d34 (switch-from-svn-to-git-2542-gee73408)

New files are:
roken/setprogname.c

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

12 years agoroken: Add setprogname to list of imports
Simon Wilkinson [Wed, 18 Apr 2012 22:15:15 +0000]
roken: Add setprogname to list of imports

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

12 years agoUpdate .gitignore files
Simon Wilkinson [Wed, 18 Apr 2012 08:10:36 +0000]
Update .gitignore files

Update (and create) .gitignore files across the tree

Change-Id: I7534e4f1eac44e6024f86591a171b63a64c6f320
Reviewed-on: http://gerrit.openafs.org/7241
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agotests: Explicitly include DES in superuser test
Simon Wilkinson [Wed, 18 Apr 2012 11:44:43 +0000]
tests: Explicitly include DES in superuser test

When the hcrypto/des header was removed from our installed headers, it
wasn't added back in to the superuser test. Add it now, so that the test
can build.

Change-Id: I38023ee94abe801f6f2313b492e4f80855001c41
Reviewed-on: http://gerrit.openafs.org/7243
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoMac OS: Fixed shared library symbol issues
Simon Wilkinson [Wed, 18 Apr 2012 11:35:10 +0000]
Mac OS: Fixed shared library symbol issues

Some of our shared libraries (in particular, roken) build with different
symbols in them depending on the exact configuration options for a
particular platform. This means that not all of the symbols in the map
file may be present within the library. On Mac OS X we have been working
around this by using the "-flat_namespace,-undefined,suppress" linker
options.

However, with Lion this no longer works, as the linker still expects to
find the symbol in the library whose mapfile indicated that it was
present. So, for example, we end up with errors like:

dyld: Symbol not found: _errx
  Referenced from: openafs.git/tests/rx/../../src/tools/rxperf/rxperf
  Expected in: openafs.git/lib/librokenafs.dylib.1.1

... despite errx actually being provided by the system libraries.

The fix to this is to use the default two level namespace, and change
our behaviour for undefined symbols to 'dynamic_lookup', rather than
'suppress'

Change-Id: Ide37856198a8db3d42ee0a5261d097176bcc9301
Reviewed-on: http://gerrit.openafs.org/7242
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agotools: Move dumpscan into its own directory
Simon Wilkinson [Tue, 17 Apr 2012 21:28:14 +0000]
tools: Move dumpscan into its own directory

Move dumpscan into its own directory, so that it's Makefile rules can
be better contained, and not pollute the whole 'tools/' namespace

Change-Id: Ic58d007824ab802eae469dd2996300f80671a3b8
Reviewed-on: http://gerrit.openafs.org/7239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoaudit: remove static local realms
Michael Meffie [Mon, 5 Mar 2012 15:47:45 +0000]
audit: remove static local realms

Remove the static list of local realms and use the
auth interace to do the local realm check. A callback
function is registered by the servers to avoid a circular
dependency between audit and auth.

Change-Id: Ic0f25cd79da7987704de68bade14054490b26c80
Reviewed-on: http://gerrit.openafs.org/6879
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoviced: remove static local realms
Michael Meffie [Mon, 5 Mar 2012 13:27:55 +0000]
viced: remove static local realms

Use the new auth function to do the local realm match
check instead of static local realms lists.

Override the krb.conf file with the -realms command line
option.

Change-Id: Ic364e61b03385fbc9496ac4af3877a1fdee3a3a5
Reviewed-on: http://gerrit.openafs.org/6878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoptserver: remove static local realms
Michael Meffie [Wed, 29 Feb 2012 03:31:45 +0000]
ptserver: remove static local realms

Use the new auth function to do the local realm match
check instead of static local realms lists.

Change-Id: I8b509188103916bdd2e575e5e9a14e3671b81e65
Reviewed-on: http://gerrit.openafs.org/6877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoauth: remove static local realms
Michael Meffie [Tue, 28 Feb 2012 14:19:11 +0000]
auth: remove static local realms

Remove the static list of local realms and use the auth
interface to perform the local realm match check.

Change-Id: I0f56e7974e59035eb9bf9fb343b550ab6b7ef314
Reviewed-on: http://gerrit.openafs.org/6876
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agorx: Use native 64bit data counters
Simon Wilkinson [Fri, 13 Apr 2012 13:49:59 +0000]
rx: Use native 64bit data counters

Modify the peer, call and rpc_stats structures to use native 64 bit
types for the bytesSent and bytesRcvd data counters. All of our
platforms support native 64bit quantities now, so there's absolutely
no value in rolling our own.

Change-Id: I7c51de73be17821c6472eea535c8476fe0d7a23e
Reviewed-on: http://gerrit.openafs.org/7205
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoaklog: heimdal kvno is rapidly changing
Derrick Brashear [Tue, 17 Apr 2012 12:55:45 +0000]
aklog: heimdal kvno is rapidly changing

in 1.6 it's unsigned. in 1.5 it's signed.
it's 32 bits. i don't care. just copy the darn thing.

Change-Id: I51efd2be64eac108e5b1591643f24fd0a51bfdff
Reviewed-on: http://gerrit.openafs.org/7235
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agoWindows: Drop Fcb Resource across SetEOF and SetAllocation
Jeffrey Altman [Mon, 16 Apr 2012 19:22:35 +0000]
Windows: Drop Fcb Resource across SetEOF and SetAllocation

If the file size or allocation is being altered, we must hold
the PagingResource and drop the Fcb Resource.  Dropping the
Fcb resource is necessary to avoid a deadlock with TrendMicro's
filter if the size is set to zero and acquiring the PagingResource
is necessary to prevent races now that the Fcb Resource is no
longer held.

Change-Id: Ie72a018adc52c479a4bb2469b2b1abe317644e8b
Reviewed-on: http://gerrit.openafs.org/7224
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Hold PagingResource across ExtendingWrite
Jeffrey Altman [Mon, 16 Apr 2012 18:47:38 +0000]
Windows: Hold PagingResource across ExtendingWrite

When the file allocation size changes the PagingResource must
be held exclusively to prevent races.

Change-Id: I6ff3a2061563dbb858bb284b463913f6d3b33e7a
Reviewed-on: http://gerrit.openafs.org/7223
Reviewed-by: Peter Scott <pscott@kerneldrivers.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: AFSProcessOverwriteSupersede CcSetFileSizes
Peter Scott [Mon, 16 Apr 2012 16:25:01 +0000]
Windows: AFSProcessOverwriteSupersede CcSetFileSizes

Instead of calling CcPurgeCacheSection() in AFSProcessOverwriteSupersede()
as part of the file length truncation to zero, call CcSetFileSizes().

Wait to call CcSetFileSizes() until after the Fcb->Resource has been
dropped but while the Fcb->Header.PagingIoResource is still held.
Make sure that file sizes are restored in the Fcb->Header if the
afsd_service rejects the file update.

Change-Id: I7574e80781ac1dbbe69814c69644bb3825de9b6a
Reviewed-on: http://gerrit.openafs.org/7220
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoauth: local realms configuration
Michael Meffie [Tue, 28 Feb 2012 13:50:33 +0000]
auth: local realms configuration

Add krb.conf and krb.excl support to the auth cell configuration
library.  Provide a function to determine if the user is local to the
cell.  Provide a function to set the local realms during application
initialization.  These changes are intended to replace the functions
afs_krb_get_lrealm and afs_is_foreign_ticket_name.

Change-Id: Iba57e9ffc2c958f3a4565a9352ce172189276ce9
Reviewed-on: http://gerrit.openafs.org/5744
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agorx: Remove surplus call to FindPeer
Simon Wilkinson [Fri, 13 Apr 2012 18:14:44 +0000]
rx: Remove surplus call to FindPeer

When stats are enabled, rxi_ReadPacket calls FindPeer immediately
the packet is received from the wire. The peer structure that it
gets is used solely to increment a counter, and then thrown away.
Given that FindPeer requires a lock, and a hash lookup, this is
really inefficent.

Instead, delay the compilation of statistics until rxi_ReceivePacket.
Call FindPeer for version and debug packets which have no associated
connection otherwise wait until we have found the packet's connection,
and use the peer which is linked from there.

Change-Id: Ic2eb08e52b97d6b033b9d3de59da9346e012d70d
Reviewed-on: http://gerrit.openafs.org/7206
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agorx: dec rx_nWaiting on clearing RX_CALL_WAIT_PROC
Andrew Deason [Thu, 29 Mar 2012 15:30:47 +0000]
rx: dec rx_nWaiting on clearing RX_CALL_WAIT_PROC

Currently, a couple of callers (rxi_ResetCall, and
rxi_AttachServerProc) will decrement rx_nWaiting only if
RX_CALL_WAIT_PROC is set for a call, and the call is on a queue
(presumably rx_incomingCallQueue). This can cause an imbalance in
rx_nWaiting if these code paths are reached when, in another thread,
rx_GetCall has removed the call from its queue, but it has not yet
cleared RX_CALL_WAIT_PROC (this can happen while it is waiting for
call->lock). In this situation, rx_GetCall will remove the call from
its queue, wait, and e.g. rxi_ResetCall will clear RX_CALL_WAIT_PROC;
neither will decrement rx_nWaiting.

This is possible if a new call is started on a call channel with an
extant call that is waiting for a thread; we will rxi_ResetCall in
rxi_ReceivePacket, but rx_GetCall may be running at the same time.
This race may also be possible via rxi_AttachServerProc via
rxi_UpdatePeerReach -> TryAttach -> rxi_AttachServerProc while
rx_GetCall is running, but I'm not sure.

To avoid this, decrement rx_nWaiting based on RX_CALL_WAIT_PROC alone,
regardless of whether or not the call is on a queue. This mirrors the
incrementing rx_nWaiting behavior, where rx_nWaiting is only
incremented if RX_CALL_WAIT_PROC is unset for a call, so this should
guarantee that rx_nWaiting does not become unbalanced.

Change-Id: I7dba4ba5f7cc33270c2d0f486b850fc0391927d1
Reviewed-on: http://gerrit.openafs.org/6986
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agorx: conn_call_lock leak
Jeffrey Altman [Sun, 15 Apr 2012 21:40:03 +0000]
rx: conn_call_lock leak

In rxi_ReceivePacket, if the packet is for a client connection
and there is no call allocated, the conn->conn_call_lock was
leaked.  Introduced by 95c38dff3740d7e24971ceb5875c06e7abfce102.

Change-Id: Icfc10849c1da08d7c96d139b0a10d9ffe7ee57df
Reviewed-on: http://gerrit.openafs.org/7218
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoauth: get local cell internal function
Michael Meffie [Mon, 20 Feb 2012 20:26:09 +0000]
auth: get local cell internal function

Add an internal function to retrieve the local cell
name when the auth mutex is already held. Implement
afsconf_GetLocalCell in terms of the new internal
function.

Change-Id: I2f021a9966129e8e256b61d5219e7315b904ac0e
Reviewed-on: http://gerrit.openafs.org/6875
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agoTESTS: Add the libwrap script to "make check" to handle library paths
Jason Edgecombe [Fri, 13 Apr 2012 01:30:47 +0000]
TESTS: Add the libwrap script to "make check" to handle library paths

LICENSE MIT

Change-Id: I5f77d8703a163b8b9224f64010b9e008bb386c59
Reviewed-on: http://gerrit.openafs.org/7202
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoWindows: pioctl use GetFileAttributes
Jeffrey Altman [Sat, 14 Apr 2012 13:43:48 +0000]
Windows: pioctl use GetFileAttributes

Instead of attempting to CreateFile(OPEN_EXISTING) the _._AFS_IOCTL_._
file, try using GetFileAttributes() to obtain the attributes of the
file.  The file doesn't exist in the directory listing but the
afs redirector and the afs smb server will respond to the request.
Perhaps the SMB servers in the broken printers will fail it.

Change-Id: I792bcc89c63871043ce6835a971de284fd754d54
Reviewed-on: http://gerrit.openafs.org/7210
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: _._AFS_IOCTL_._ hidden and system
Jeffrey Altman [Sat, 14 Apr 2012 15:06:58 +0000]
Windows: _._AFS_IOCTL_._ hidden and system

Query file attributes returned only the system attribute
and not the hidden attribute.  Must return both.

Change-Id: Id29465adf3e3524b59c63b2e6f8ef482f536a0e1
Reviewed-on: http://gerrit.openafs.org/7209
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Remove PurgeContent param AFSVerifyEntry
Jeffrey Altman [Sat, 14 Apr 2012 03:16:56 +0000]
Windows: Remove PurgeContent param AFSVerifyEntry

When verifying a directory entry we must update the metadata
for a file therefore we must also purge the data if the version
number changed.  This is not optional.

Change-Id: Icb673c7a6c52b3778978248fcb243d110685aa8d
Reviewed-on: http://gerrit.openafs.org/7208
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Flush data and then drop locks
Jeffrey Altman [Sat, 14 Apr 2012 00:17:48 +0000]
Windows: Flush data and then drop locks

The redirector must flush the data to the file server
and then drop the file locks.  Doing it the other way
creates races.

Change-Id: Ic3a48546ee9e0066df9d228fc4e57f52b43587c2
Reviewed-on: http://gerrit.openafs.org/7207
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoBuild: check for gencat
Michael Meffie [Fri, 13 Apr 2012 15:58:02 +0000]
Build: check for gencat

Check for the gencat program and give a missing warning if
not present.

Change-Id: I71cdaa0840215b53071be4481a5f23b2f8667bda
Reviewed-on: http://gerrit.openafs.org/7203
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agoBuild: error if solariscc is not found
Michael Meffie [Fri, 13 Apr 2012 17:01:05 +0000]
Build: error if solariscc is not found

Fail configure if the solariscc is not found and give the builder
a message to cope with non-standard installation paths for
sunstudio.

Change-Id: I64c1e752833f2aa824f4a15cc144e54bb03a1ec8
Reviewed-on: http://gerrit.openafs.org/7204
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agorx: Rework code which pulls packet from recv queue
Simon Wilkinson [Sun, 8 Jan 2012 11:45:57 +0000]
rx: Rework code which pulls packet from recv queue

Both rxi_ReadProc and rxi_FillReadVector contained copies of the
same code to pull a packet out of the receive queue, and turn it
into the call's currentPacket. Abstract this out into a single common
function, so we're not maintaining the same code in two different
places.

Change-Id: I20af6b4ff19f05e21ffde1a80609be12ad6cfeee
Reviewed-on: http://gerrit.openafs.org/7195
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agorx: Tidy up currentPacket handling
Simon Wilkinson [Fri, 6 Jan 2012 10:12:26 +0000]
rx: Tidy up currentPacket handling

Instead of making a copy of the call->currentPacket variable in our
read/write routines, reference it directly. Make it clear that
currentPacket is used solely by the application thread, and remove
a number of mistaken comments that suggest otherwise.

Change-Id: I7ad799acbf110422df7c1e18ab552caf26b7766a
Reviewed-on: http://gerrit.openafs.org/7194
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoaklog: heimdal kvno is unsigned
Derrick Brashear [Thu, 12 Apr 2012 21:35:27 +0000]
aklog: heimdal kvno is unsigned

heimdal's kvno is unsigned. comply.

Change-Id: I5960ec33dccb10ae2bbc121e231b6aa58fa17993
Reviewed-on: http://gerrit.openafs.org/7201
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoRemove redundant header includes
Simon Wilkinson [Thu, 8 Sep 2011 10:26:39 +0000]
Remove redundant header includes

Remove includes of system headers where roken.h already takes care of
including them. This simplifies the source tree, reduces the amount of
work done by the compiler, and ensures that all of our headers are
included with the correct guards

The list of files to edit was generated with the following script:

list=`grep include external/heimdal/roken/roken.h.in                \
         | sed -e's/#include//g' | sort | uniq`;                    \
for A in `find . -name *.c | xargs grep -l roken.h                  \
             | grep -v external/ | grep -v WINNT/`; do              \
     found=0;                                                       \
     for B in $list; do                                             \
         if grep "$B" $A > /dev/null; then                          \
              echo "$A : $B";                                       \
              found=1;                                              \
         fi;                                                        \
     done;                                                          \
     if [ $found == 1 ] ; then mvim -f $A; fi;                      \
done

Change-Id: I2edbda550a129709b1dc6860b17d6a8a7509af58
Reviewed-on: http://gerrit.openafs.org/5815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agovolscan: index offset output column
Michael Meffie [Tue, 27 Mar 2012 04:33:26 +0000]
volscan: index offset output column

Add index offset as a possible volscan output column.

Change-Id: I1bf6e8dc3c506a2ee013536e19141ddb214879a6
Reviewed-on: http://gerrit.openafs.org/6980
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agovolscan: option to ignore dir vnode magic
Michael Meffie [Tue, 27 Mar 2012 00:20:28 +0000]
volscan: option to ignore dir vnode magic

Option to ignore directory vnode magic when looking
up the path names. Print which vnode failed when
doing the checks.

Change-Id: Id4b74ee9f139305025b849a007a4534b8ed04dbf
Reviewed-on: http://gerrit.openafs.org/6979
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

12 years agoWindows: missing brace in RDR_CleanupFileEntry
Jeffrey Altman [Wed, 11 Apr 2012 15:59:17 +0000]
Windows: missing brace in RDR_CleanupFileEntry

Fix 46d76d8821f4c8476499757d509ce1a6bab764b1

Change-Id: I6c6cf5e1dec431544963f6a4c283e2ae0d52a7d9
Reviewed-on: http://gerrit.openafs.org/7189
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agosalvager: Trust inode-based special data over OGM
Andrew Deason [Thu, 22 Mar 2012 22:54:12 +0000]
salvager: Trust inode-based special data over OGM

Currently the salvaging code looks for special inodes, and infers the
volume id and inode type from the OGM data in each special inode file.
However, we can already derive this information from the inode number
itself for the special inode, so if they disagree, use the values
based off of the inode number and correct the OGM data.

The inode number should be more likely to be correct, since that is
how we look up the special inode from the header when attaching the
volume. It is also impossible to get special inode files with the same
name, so this ensures we don't get duplicates. And for people that go
snooping around /vicepX/AFSIDat even though we tell them not to, it
seems more likely that they go around 'chmod'ing or 'chown'ing rather
than 'mv'ing.

This change avoids an abort in the salvaging code when the OGM data is
wrong. If we trust the OGM data when it is incorrect, we assume the
special inode file is for a different volume. So when we go to
recreate one of the special files for the volume we're actually
working with, the IH_CREATE fails (from EEXIST) and so we abort.

Change-Id: Ibfaa1bfb27d190c5fec6fc673d88df366268e302
Reviewed-on: http://gerrit.openafs.org/6946
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agonamei: Abstract out OGM functions a bit more
Andrew Deason [Fri, 23 Mar 2012 18:02:22 +0000]
namei: Abstract out OGM functions a bit more

Add GetWinOGM and SetWinOGM for getting and setting the
Windows-equivalent of the Unix OGM data. Make those and CheckOGM use
GetFileTime/SetFileTime so we can operate just via an FD_t, without
needing the full pathname. Modify the NT namei_icreate to use
SetWinOGM.

Change-Id: I5077911d8473d44ad9ba1d17d3b6deec3a12ba39
Reviewed-on: http://gerrit.openafs.org/6945
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agolibafs: dont handle outstatus on write error
Derrick Brashear [Wed, 15 Feb 2012 02:58:09 +0000]
libafs: dont handle outstatus on write error

if a write errored, we can't trust the OutStatus we got. don't.

Change-Id: I74934c32426c6f25aace06f6ee59c1c1b547af90
Reviewed-on: http://gerrit.openafs.org/6714
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoBuild: link libaudit before util
Michael Meffie [Wed, 29 Feb 2012 14:40:14 +0000]
Build: link libaudit before util

libaudit depends on util symbols, so link it first to avoid
unresolved symbols.  Include libaudit in the list of libs
instead of making it a special case.

Change-Id: Ide6d5f7e3ce8fd76b504088dcae3110872a87092
Reviewed-on: http://gerrit.openafs.org/6847
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoviced: fix log message for MapName_r
Michael Meffie [Sat, 3 Mar 2012 15:05:01 +0000]
viced: fix log message for MapName_r

Do not log a code of zero if the name plus instance length exceeds
the max pr name buffer.

Change-Id: I8b8f970213c0beb35a728bcc2158796f84120a3b
Reviewed-on: http://gerrit.openafs.org/6861
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agodoc: distributed files are under dest
Michael Meffie [Tue, 10 Apr 2012 20:07:37 +0000]
doc: distributed files are under dest

Add the dest path component in the quick start guide instructions for
copying files from a binary OpenAFS distribution file.

Change-Id: I5c39ac0426ef2eab89ae5d3df260628e949dc21e
Reviewed-on: http://gerrit.openafs.org/7187
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoafsd: Move to newer cmd syntax
Simon Wilkinson [Tue, 13 Sep 2011 06:17:27 +0000]
afsd: Move to newer cmd syntax

Move afsd over to using the newer cmd functions, and avoid using
direct array access, and fixed offsets.

Change-Id: I6e09823d764cbe6109c9a72700239d814b91db0c
Reviewed-on: http://gerrit.openafs.org/7137
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agoWindows: Do not delete in CleanupFile if error
Jeffrey Altman [Wed, 11 Apr 2012 04:29:03 +0000]
Windows: Do not delete in CleanupFile if error

If an error was detected when processing RDR_CleanupFileEntry()
do not perform the file deletion.  Just return the error as
attempting the deletion could result in an exception.

Change-Id: I57b17a15d1bdda4d0890dbe59f9e2432d465250f
Reviewed-on: http://gerrit.openafs.org/7186
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agolibafs: log error code when marking server down
Michael Meffie [Mon, 9 Apr 2012 19:49:50 +0000]
libafs: log error code when marking server down

Log the error code when marking the server down due
to server/networks issues.

Change-Id: Ib3d57562642ca564dcfeaa775de66f54d08f23af
Reviewed-on: http://gerrit.openafs.org/7138
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>