Commit Graph

10177 Commits

Author SHA1 Message Date
Mark Vitale
e1c6ad7d58 vos: convertROtoRW misc error reporting problems
Fixes a few inconsistencies and bugs in some error messages.

Change-Id: Ic4971c4cc3a3aa3623ee0f13161fd7793d3acb19
Reviewed-on: http://gerrit.openafs.org/7387
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-12 06:33:15 -07:00
Simon Wilkinson
0f30c95a03 cmd: Add support for pulling options from files
With this change, we gain the ability to set our command line options
from krb5.conf configuration files. This is only available for tools
which are implemented using the new cmd_OptionAs accessor methods.

Callers should load their configuration file using
    cmd_OpenConfigFile("/path/to/config/file.conf");

(an addition to libauth to return a path to a system wide
 configuration file will be forthcoming)

and then set their command name (for example, "fileserver", "afsd",
"vos" and so on) using
    cmd_SetCommandName("mycommand");

The accessor functions will then populate their return values with
either:
  a) The command line options, if specified
  b) The contents of the tag matching the option name, in the
     [command_subcommand] section of the configuration file, if it
     exists
  c) The contents of the same tag, in the [command] section of the
     configuration file, if it that exists.
  d) The contents of the same tag in the [defaults] section of the
     configuration file.

Callers can also gain access to the entire configuration file by
calling cmd_RawFile, or to just the section corresponding to their
command line by calling cmd_RawSection. Note that when using the file
directly, it is up to callers to preserve consistency by implementing
similar inheritance rules as the above.

Change-Id: Ic501ab296af3638f961486869af79c9ce47b77b8
Reviewed-on: http://gerrit.openafs.org/7135
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-11 18:49:07 -07:00
Simon Wilkinson
ad347dea32 tests: Add additional cmd tests
Add additional tests to the libcmd test suite to verify the
behaviour of cmd_OptionPresent and cmd_OptionAsList

Change-Id: I81a235fb5ee87682c72ca942f1341f77be6fda39
Reviewed-on: http://gerrit.openafs.org/7392
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-11 18:49:00 -07:00
Derrick Brashear
0524e0d191 macos: update AFS prefs pane
modify afshelper to just run what it's told instead
of offering fixed operations. this avoids having a setuid
tool around. in spite of apple's suggestion this is correct,
it's actually more dangerous. instead, elevate privilege only
to run a small set of commands, then drop. allow
unlocking of the prefs pane, but make the menu extra prompt
for authentication when needed.
deactivate controls in the prefs pane when locked.

Change-Id: I0e2510efc98605f464e04d26cc8f2ce2bfe116f4
Reviewed-on: http://gerrit.openafs.org/7196
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:21:19 -07:00
Andrew Deason
0debf2d227 Call rx_SetNoJumbo earlier
For ubik server processes, rx_SetNoJumbo needs to be called before
ubik initialization for it to effect the communication between
dbservers; otherwise, full database transfers may result in Rx
jumbograms on the wire regardless of the jumbo/nojumbo setting. Move
the call to rx_SetNoJumbo to before ubik initialization to avoid this.

Also move the call to rx_SetNoJumbo to immediately after rx_Init* for
all server processes, for consistency. Move similar calls to
rx_SetMaxMTU for the same reason.

Change-Id: Ic79415829601fcfb4e74e72fbf5711d0c32aaa0c
Reviewed-on: http://gerrit.openafs.org/7350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:20:05 -07:00
Mark Vitale
a2f523b505 DOC: vos convertROtoRW security requirements
They were copied from another command; corrected them.

Change-Id: Ic77f1a91520ec4147e42864438d98942f6a7effc
Reviewed-on: http://gerrit.openafs.org/7305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:19:11 -07:00
Ken Dreyer
186158c9eb doc: add Windows section to fs newcell
fs newcell works slightly differently on Windows. Document the
differences in the man page.

FIXES 125094

Change-Id: I3fb71ebb28290222069d795762f50a82f3fb6495
Reviewed-on: http://gerrit.openafs.org/6919
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: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:18:44 -07:00
Andrew Deason
ecfd9549fc vol: Free vol header on attach_volume_header error
In attach_volume_header, make sure we free the volume's header if
we're returning an error. We take care of the locks and i/o handles in
the immediately preceding block, but for an actual error we don't get
rid of the header. Do so.

Noticed by Tom Keiser.

Change-Id: I97e61700f644066ac1a0e6b45a67dd62c5397034
Reviewed-on: http://gerrit.openafs.org/7325
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 17:14:56 -07:00
Simon Wilkinson
f45ed29d5f Make the cmd config file parser build on Windows
Change-Id: Id6c3515869529b6fb5c48a06661b63bed974e436
Reviewed-on: http://gerrit.openafs.org/7141
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-11 16:40:55 -07:00
Simon Wilkinson
1a823e9326 cmd: Don't expose krb5 error codes
Don't use krb5 error codes in our configuration parser, instead use an
error allocated from the existing cmd error table

Change-Id: I777d9638c676d198d13a3bd33a90acdc53dc26cc
Reviewed-on: http://gerrit.openafs.org/7134
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-11 16:39:52 -07:00
Russ Allbery
0f5dc583a9 Import of code from rra-c-util
This commit updates the code imported from rra-c-util to
3900f94b9b8c46a3cb2d83d73c6cf4b73be1cc10 (release/4.4)

New files are:
	m4/krb5-config.m4

Change-Id: I6ef966e4a30cd23feac4a159be2ffeb7357765b7
Reviewed-on: http://gerrit.openafs.org/7401
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 16:37:50 -07:00
Simon Wilkinson
99108f9544 rra-c-util: Add additional file
Add the m4/krb5-config.m4 file, which is required for version 4.4,
to the list of imports.

Change-Id: Ib5d3d0d7be67eaa75f6edc6d030cdb3c47838d3c
Reviewed-on: http://gerrit.openafs.org/7400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 16:37:25 -07:00
Simon Wilkinson
c877c0b419 tests: Start using the upstream C TAP harness
Instead of bundling our own copies of Russ's C TAP Harness, start using
source pulled from his git repository using the src/external import
mechanism. Note that we are not currently building the floating
point (is_double) portion of the harness.

In the process of doing so, we also upgrade our test harness to the latest
upstream version, 1.11. This is somewhat problematic, as there have been
some significant code changes since the version bundled with OpenAFS.
Work around these by
   *) Referencing the basic.h header as <tests/tap/basic.h>, rather than
      just <tap/basic.h>, to match the new upstream layout
   *) Changing the include path so that the tests/ directory can be
      found within it.

Change-Id: I63efbb30248165e5729005b0a791e7eb7afb051d
Reviewed-on: http://gerrit.openafs.org/7374
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 16:36:44 -07:00
Russ Allbery
319ec27236 Import of code from c-tap-harness
This commit updates the code imported from c-tap-harness to
d3fc03606efc8e76ff34f04470e6133db25a3982 (release/1.12)

New files are:
	LICENSE
	NEWS
	README
	tests/runtests.c
	tests/tap/basic.c
	tests/tap/basic.h
	tests/tap/float.c
	tests/tap/float.h
	tests/tap/libtap.sh
	tests/tap/macros.h

Change-Id: I4435bbb240f9db3cf2883cb0711f592f9d865f92
Reviewed-on: http://gerrit.openafs.org/7399
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 16:36:06 -07:00
Simon Wilkinson
a18848fcae c-tap-harness: Fix import paths
Somehow or another, the file list committed as
098e6f141f is missing the tests/
prefix for a number of object files. Reinstate this prefix.

Change-Id: I2b807bf6fb8e5f136aef571e576c036714280b0c
Reviewed-on: http://gerrit.openafs.org/7398
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-11 16:35:42 -07:00
Jeffrey Altman
c6782b86d7 Windows: Avoid deadlock during "fs memdump"
When the afs redirector is in use, it is possible that "fs memdump"
could be executed while all of the pages in the Windows page cache
are dirty with data that must be purged and flushed to \\afs. In
such a situation it is not safe for afsd_service.exe to hold
global locks such as buf_globalLock, cm_scacheLock, etc. while
performing WriteFile() calls against %TEMP%\afsd_alloc.log if
afsd_alloc.log was opened without the FILE_FLAG_NO_BUFFERING flag.
Doing so can result in a deadlock as it can become impossible for
the Windows page cache to purge data to complete the WriteFile()
as all extent operations block waiting for the global lock to
be cleared.

The correct long term approach would be to use the FILE_FLAG_NO_BUFFERING
flag when opening %TEMP%\afsd_alloc.log.  However, this requires that
all writes to the file be performed using buffers that are consistent
with the drive geometry.  Such an approach would be incompatible with
the _CrtMemDumpAllObjectsSince() operation and would require a redesign
of the current interfaces.  See

http://msdn.microsoft.com/en-us/library/windows/desktop/cc644950(v=vs.85).aspx

for requirements when using non-buffered writes.

The short term fix is to dump the contents without holding the
global locks.  This can result in an inconsistent view of the world
but will ensure that deadlocks are avoided.  This patchset makes
such a change when the afs redirector is in use.

Change-Id: I6ffc0ff7c80707f16bf132f2dcab7dab5727894d
Reviewed-on: http://gerrit.openafs.org/7391
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-10 15:45:27 -07:00
Jeffrey Altman
90ecc0ff72 Windows: cm_GetBuffer do not retry if biod empty
Change-Id: I583a69199b0e3163c3bc5b620543028f2950bfeb
Reviewed-on: http://gerrit.openafs.org/7390
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>
2012-05-10 15:44:51 -07:00
Hartmut Reuter
4b58432de4 Make it build outside source tree
some missing ${srcdir}/ inserted

Change-Id: I323d4475dcf10bb5753741d611e3869779ff22d9
Reviewed-on: http://gerrit.openafs.org/7383
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-08 10:26:55 -07:00
Andrew Deason
1e13ae53b3 vol: Remove redundant vop check in GetVolume
VAttachVolumeByVp_r (specifically attach_check_vop in attach2) already
handles checking for conflicting vol ops, and gives us VOFFLINE
appropriately. We don't need to check again in GetVolume.

Change-Id: Ibb93d423d3c856dd957a2569412a85698180ff8e
Reviewed-on: http://gerrit.openafs.org/7304
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-08 10:26:43 -07:00
Derrick Brashear
80cb7bdebe c-tap-harness: add float.h
add float.h to the list of files we import for c-tap-harness from
upstream

Change-Id: I133dd6172bab17ae183cc6fc983f92f19005ba85
Reviewed-on: http://gerrit.openafs.org/7381
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-08 04:17:02 -07:00
Simon Wilkinson
a9595ab047 tests: Use enum rather than #defines for tests
Change the command test so that it uses an enum, rather than #defines
for offsets into the parms array. This is mainly a cosmetic change, but
brings the test suite into line with the way that we're doing stuff in
the "real" code.

Change-Id: Ia9d72e13230edd4fe13af52ba6816cf775693c36
Reviewed-on: http://gerrit.openafs.org/7133
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>
2012-05-07 20:24:50 -07:00
Andrew Deason
a81f9237bf vol: Pay attention to specialStatus after VAVByVp
attach2/VAttachVolumeByVp_r do not alter the yielded error code
according to specialStatus. So, pay attention to specialStatus after
receiving an error from VAttachVolumeByVp_r, to ensure we respond with
the correct error code.

Change-Id: I59e977dd1f0949f8fe5670c7a52429acbfb7d7e9
Reviewed-on: http://gerrit.openafs.org/7303
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-07 20:22:23 -07:00
Andrew Deason
21ed79aeae vol: Avoid VBUSY/VRESTARTING trick for offline vop
Currently, if GetVolume() finds that the volume we're trying to attach
has a vol op that leaves the volume offline, we do the
VBUSY/VRESTARTING trick as described in CheckVnode(). This doesn't
make any sense for a couple of reasons.

For one, VBUSY/VRESTARTING is not the correct error code to return to
the client when an offline vol op is in progress and vp->specialStatus
is not set everywhere else we yield VOFFLINE.

Additionally, this block of code is only hit once for a particular vol
op. Once we reach this section, the volume is in UNATTACHED state, and
so on the next iteration of GetVolume we will immediately return
VOFFLINE (or specialStatus). So the CheckVnode-like situation is not
applicable, since we are not returning VBUSY to the same client for 15
minutes; we would return VBUSY once and then return VOFFLINE.

Change-Id: I0e8376df7937fd6bd01f9998371b9289c4ad2618
Reviewed-on: http://gerrit.openafs.org/7302
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-07 20:21:38 -07:00
Simon Wilkinson
098e6f141f Configure src/external for c-tap-harness
Setup the src/external system so that we can pull in releases of
the C Tap Harness using that mechanism.

Change-Id: I312db7991b037e7bb885c8f93a5c94c793dada30
Reviewed-on: http://gerrit.openafs.org/7372
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2012-05-07 20:17:38 -07:00
Andrew Deason
427f53eea7 fs: Report default storebehind when errors exist
After 904c9fbe, we no longer print out the default store asynchrony
when any of the supplied paths results in a pioctl error. However, if
just one (or a few) of the paths supplied results in an error (such
as, the path does not exist), this does not prevent us from reporting
the default value.

Instead, keep track of whether or not we have a valid value, and try
to determine the default if we haven't already by the end of
StoreBehindCmd, and print it out.

Change-Id: I16a5faed15141d0bb00ea9b6f991c0a8e404d4d5
Reviewed-on: http://gerrit.openafs.org/7376
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-07 20:15:34 -07:00
Jeffrey Altman
e9e14b5519 Windows: cleanup redirector pipes
If pipe creation fails, cleanup the mess.

At shutdown, if there are pipes that have not been closed by
Windows, clean them up.

This is just to ensure that at shutdown the reference counts of
cm_scache_t objects in the cache are reset to zero.

Change-Id: I1d738c31faafce445f05adc4884c7711123589e2
Reviewed-on: http://gerrit.openafs.org/7366
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-07 10:04:00 -07:00
Jeffrey Altman
542dad7573 Windows: Correct refcount leak
The new duplicate avoidance code in cm_QueueBKGRequest() leaked
a cm_scache_t and a cm_user_t reference count.

Change-Id: Iceaf32a8d20cf350024fe40e3185c723f6203676
Reviewed-on: http://gerrit.openafs.org/7365
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-07 10:03:16 -07:00
Jeffrey Altman
6da91dfcb8 Windows: fix build with DEBUG_REFCOUNT
cm_GetSCache added a new parameter.  The same parameter is required
for the cm_GetSCache macro when DEBUG_REFCOUNT is defined at build
time.

Change-Id: Id198cdf845b8339259716d4a61c0347c33ffd83d
Reviewed-on: http://gerrit.openafs.org/7364
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-07 10:02:54 -07:00
Jeffrey Altman
4fce72b0e6 Windows: Checksum server lists on Volume Errors
For VMOVED, VNOVOL and VOFFLINE checksum the server lists for
the current volume.  If the server list changes as a result of
the forced volume location update, do not set the updated flag
which prevents subsequent volume location updates for the current
cm_req object.

This combined with the previous patchset to filter volume locations
based upon the VLSF_NEWREPSITE flag will avoid outages during
vos release operations.

Change-Id: I39e6981b9fac5ed0dfd900e09474df43cb72feec
Reviewed-on: http://gerrit.openafs.org/7361
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-06 17:51:06 -07:00
Jeffrey Altman
345d643729 Windows: cm_SetServerBusyState use cm_ServerEqual
When the busy state of a server is set it must apply to all
server references if the server is multi-homed.  Use cm_ServerEqual()
to do so.

Change-Id: I76c07746eb396af988a5270804e221e7a641db66
Reviewed-on: http://gerrit.openafs.org/7355
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-06 08:52:42 -07:00
Jeffrey Altman
193a56aa66 Windows: Track Mixed RO Volume Release State
If the volume location information indicates that a replica site
is VLSF_NEWREPSITE then it implies that some of the replicas are
out of date.  Ignore the out of date replicas when constructing
the list and force a volume location list reset every five minutes
while the replica site info is mixed.

Change-Id: I136e66b1d2da66578970932553d14f59a666721b
Reviewed-on: http://gerrit.openafs.org/7354
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-06 08:42:37 -07:00
Jeffrey Altman
1af906799b Windows: Make CM resilient to transient VNOVOL
The 1.6.0 and 1.6.1 file servers send transient VNOVOL errors which
are no indicative of the volume not being present.  For example,
VNOVOL can be sent during a transition to a VBUSY state prior to
salvaging or when cloning a .backup volume instance.  As a result
the cache manager must attempt at least one retry when a VNOVOL is
receive but there are no changes to the volume location information.

This patchset records the VNOVOL error in the cm_req_t structure
If the volume is replicated, the volume's server reference into a busy state.
If the volume is not replicated, the thread is paused for two seconds.
In both cases, the request is retried.  If the VNOVOL error is received
a second time from the same server, the volume server reference is
deleted as before.  This is done to prevent repeated requests to the
VLDB server and the file server that are expected to fail.  The server
reference will be restored to the volume on the next volume location
update.

Change-Id: Ica51f853683f80cb17c804cdc216f7a113cca60a
Reviewed-on: http://gerrit.openafs.org/7353
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-06 08:42:18 -07:00
Jeffrey Altman
46c1f1391b Windows: cm_GetNewSCache drop lock to permit change
In cm_GetNewSCache the entire LRU queue is searched for a
cm_scache_t object that is safe to recycle.  If none are the LRU
queue was immediately searched again without dropping the
cm_scacheLock or taking a pause.  As a result it is quite possible
that a thread about to release a cm_scache_t was blocked from
doing so.

This patchset factors some of the logic a bit differently to
improve readability and adds new log messages to help diagnose
the cause of a problem if no cm_scache_t ever becomes available.

Change-Id: Ica6ebee0ce0456e879ae7188d9c8cdc935a92e5b
Reviewed-on: http://gerrit.openafs.org/7352
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-06 08:42:00 -07:00
Jeffrey Altman
dbab42ca72 Windows: Remove dead code in AFSRead.cpp
Change-Id: I9ebaf0a43b0b14c11fc7d1b0935a8d436e70e900
Reviewed-on: http://gerrit.openafs.org/7351
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-06 08:41:06 -07:00
Andrew Deason
4cdb94dbc4 ubik: Initialize ubik_callPortal earlier
As of 7caf4143, we call ubeacon_InitServerList* before ubik_callPortal
is set, causing Rx connections to be created to port 0, causing
various problems with communicating with other sites. Initialize
ubik_callPortal to the correct value before calling any such
functions, so we create connections to the right port.

Change-Id: I37dbf575bcdec10463c7b6006738678096a92573
Reviewed-on: http://gerrit.openafs.org/7349
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-05-04 17:30:32 -07:00
Jeffrey Altman
f76cf9a3fb Windows: FCB cleanup must be done before ObjectInfo
When processing the cleanup and destruction of a File Control Block
the related ObjectInfoCB is required for proper cleanup.  Reorganize
the AFSPrimaryVolumeWorkerThread logic to ensure that this is true.
This involves dropping the VolumeCB->ObjectInfoTree.TreeLock around
the AFSCleanupFcb() call. While the lock is released it is possible
for the ObjectInfoCB->OpenReferenceCount to change.  Therefore, new
checks must be added after the lock is re-acquired to ensure that
an in-use object is not destroyed.

Change-Id: I6b26fb2fe1ef4077c6edd643ec40715c8e2928ac
Reviewed-on: http://gerrit.openafs.org/7327
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-04 10:27:53 -07:00
Jeffrey Altman
e691a757d6 Windows: AFSInitFcb STATUS_REPARSE cleanup
If a race is detected when creating a new File Control Block in
AFSInitFcb() the Fcb Header must be torn down and the ExtentsResource
and DirtyExtentsListLock must be deleted prior to freeing the pool
memory.

Change-Id: I3c3f45aed26ea62b4d20e5c5e80d1237d96c912c
Reviewed-on: http://gerrit.openafs.org/7326
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
2012-05-04 10:27:41 -07:00
Jeffrey Altman
f12a20e227 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>
2012-05-04 10:27:22 -07:00
Jeffrey Altman
b12a038b48 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>
2012-05-04 10:27:07 -07:00
Jeffrey Altman
0fb70aab0e 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>
2012-05-04 10:26:50 -07:00
Jeffrey Altman
ba8e60d70a 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>
2012-05-04 10:26:35 -07:00
Jeffrey Altman
23bec3fe9f 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>
2012-05-04 10:26:21 -07:00
Jeffrey Altman
f86b17ab2b 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>
2012-05-04 10:26:04 -07:00
Jeffrey Altman
a7fec07348 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>
2012-05-04 10:25:53 -07:00
Jeffrey Altman
6b602e59af 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>
2012-05-04 10:25:06 -07:00
Jeffrey Altman
b750d82a84 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>
2012-05-04 10:24:54 -07:00
Jeffrey Altman
ce7fe9ccfb 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>
2012-05-04 10:24:42 -07:00
Jeffrey Altman
fcf1079f58 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>
2012-05-04 10:24:29 -07:00
Jeffrey Altman
2246e7887c 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>
2012-05-04 10:24:15 -07:00
Jeffrey Altman
ad5916d19f 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>
2012-05-04 10:24:00 -07:00