openafs.git
11 years agorx nat event connection reference
Derrick Brashear [Mon, 15 Mar 2010 18:31:49 +0000]
rx nat event connection reference

hold a conn ref for the nat ping event. don't renew if the connection
is being garbage-collected.

Change-Id: I45ebf7b8d0362e409094666f186e6b4d58cc906a
Reviewed-on: http://gerrit.openafs.org/1573
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agogrowlagent: remove generated Makefile with make distclean
Marc Dionne [Tue, 16 Mar 2010 01:34:28 +0000]
growlagent: remove generated Makefile with make distclean

Add the growlagent Makefile to the list that gets cleaned with
the distclean target.

Change-Id: I6c3385f3b839c436efb50d0fc7239c181e027be6
Reviewed-on: http://gerrit.openafs.org/1575
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoRemove return of value for afs_MarinerLogFetch()
Antoine Verheijen [Mon, 15 Mar 2010 19:49:31 +0000]
Remove return of value for afs_MarinerLogFetch()

afs_MarinerLogFetch(), a void routine, attempts to return a value.
While gcc (amongst others) merely issues a warning about this, the
Sun Studio C compiler gets cranky (at least on x86) and treats it as
a hard error, thereby aborting the build. Since there actually is no
value to return, this update simply removes the attempt.

Change-Id: Ic89fb05380a25a433f9c3b9fa57962f215348d95
Reviewed-on: http://gerrit.openafs.org/1574
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agofreebsd per-event mutexes
Derrick Brashear [Wed, 10 Mar 2010 07:03:25 +0000]
freebsd per-event mutexes

use the same system for event mutexes macos does. this time for sure.

Change-Id: I18be653607490ba42f40a0b069460ece2f6ab416
Change-Id: I7e0a2f6042ef7f31612072c6625579de42b17f9b
Reviewed-on: http://gerrit.openafs.org/1554
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agovlserver: make rxinfo threadsafe
Andrew Deason [Tue, 9 Feb 2010 19:03:06 +0000]
vlserver: make rxinfo threadsafe

The vlserver has a function 'rxinfo' used for printing out information
about an RX call for logging purposes, which used a static string.
Change it to use a caller-passed buffer, so it is safe to use in
multiple threads.

Change-Id: I186010792e743bc9676ddd5b4c99f011b64988e6
Reviewed-on: http://gerrit.openafs.org/1545
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoafsdb lookup shouldn't leak memory on realname lookup
Derrick Brashear [Mon, 8 Mar 2010 20:58:42 +0000]
afsdb lookup shouldn't leak memory on realname lookup

when looking up the "real" cell name, avoid leaking memory. the strdup
is inside a loop and would leak memory for each host returned above one.

Change-Id: I36cc9bd27ddc831121f47046daaab11f752012fe
Reviewed-on: http://gerrit.openafs.org/1538
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agosquash warning in db_verify
Michael Meffie [Sun, 28 Feb 2010 18:02:40 +0000]
squash warning in db_verify

Fix warning from the prdb_verify -rebuild with
supergroups fix, fa2536c02cf26f7db30bf623e95f42be88138d14

Change-Id: I584cba07287660c9e560a2ba931545cbc5b4843f
Reviewed-on: http://gerrit.openafs.org/1570
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoWindows: warnings removal for afskfw.c
Jeffrey Altman [Sat, 13 Mar 2010 16:47:51 +0000]
Windows: warnings removal for afskfw.c

Use StrSafe string manipulation functions in place of most
instances of strcpy, strcat, sprintf, etc.  With the use
of StringCbCopy, StringCbCat, StringCbPrintf, etc. there
is no longer a need to manually assign a NUL to the end
of a C string buffer as was required with strncpy or
strncat.

There is one strcpy instance remaining due to the inability
to know what the length of the destination buffer.  The API
needs to be altered to make the destlen available and that is
not an appropriate change for this patchset.  A deprecated
warning is a reminder to revisit this in the future.

Several int to unsigned int type changes to avoid signed
vs unsigned warnings.

Shuffle the order of header files to avoid macro
redefinition warnings.

LICENSE MIT

Change-Id: I4b5d15b60918cc8dc6ab205f1a7d45e17d14de43
Reviewed-on: http://gerrit.openafs.org/1567
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: afskfw - conditionalize use of krb5_get_error_message for KFW 3.1 and earlier
Jeffrey Altman [Sat, 6 Mar 2010 22:30:17 +0000]
Windows: afskfw - conditionalize use of krb5_get_error_message for KFW 3.1 and earlier

KFW 3.1 is supported by OpenAFS but does not contain krb5_get_error_message
or krb5_free_error_message.  As a result it must be loaded at run-time
and conditionally used.

LICENSE MIT

Change-Id: I803b4af726605dc49baf2c2d45fae3ecafe2ccf9
Reviewed-on: http://gerrit.openafs.org/1529
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: netidmgr - conditionalize use of krb5_get_error_message for KFW 3.1 and...
Jeffrey Altman [Sat, 6 Mar 2010 22:32:22 +0000]
Windows: netidmgr - conditionalize use of krb5_get_error_message for KFW 3.1 and earlier

KFW 3.1 is supported by OpenAFS but does not contain krb5_get_error_message
or krb5_free_error_message.  As a result it must be loaded at run-time
and conditionally used.

LICENSE MIT

Change-Id: Ic2ad16bb5c2d905e30ec814951b5253e2ef888da
Reviewed-on: http://gerrit.openafs.org/1530
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agomacos dropbox fix for finder
Derrick Brashear [Thu, 11 Mar 2010 17:10:38 +0000]
macos dropbox fix for finder

sadly this can mean we lie and say delete will work when it will fail, but
finder looks for KAUTH_VNODE_DELETE_CHILD along with
KAUTH_VNODE_ADD_SUBDIRECTORY and KAUTH_VNODE_ADD_FILE, not as one-offs.

Change-Id: I4079b89e188992ee33594cad5bd15f7bf6106203
Reviewed-on: http://gerrit.openafs.org/1561
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agodkms configure correctly
Derrick Brashear [Tue, 9 Mar 2010 21:51:56 +0000]
dkms configure correctly

push the correct configure options for dkms

Change-Id: I18e33c693fa4c32e39cee08844312e67cb280443
Reviewed-on: http://gerrit.openafs.org/1551
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoSquash pthreaded vos warnings
Andrew Deason [Wed, 10 Mar 2010 16:16:04 +0000]
Squash pthreaded vos warnings

Trying to build vos in src/tvolser can produce a warning, at least on
amd64_linux26, since we cast to an int of the wrong size in SendFile and
ReceiveFile. Use intptr_t like we do everywhere else instead.

Change-Id: Ic624bf90ab7338b63f8177b762e1deddbe7fb73d
Reviewed-on: http://gerrit.openafs.org/1556
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoDon't always use the local cell for db clients
Simon Wilkinson [Wed, 10 Mar 2010 15:40:50 +0000]
Don't always use the local cell for db clients

Commit d008089a79ef268bbca91d660a840f32cb416865 broke things so that
we were always trying to use the local cell, rather than the one specified
by the user. Fix this so that the command line cell is used, unles -localauth
is specified, which restores the existing behaviour.

FIXES 126716

Change-Id: I2ce34e764780d5a22c67474d5ae1076d52b04113
Reviewed-on: http://gerrit.openafs.org/1555
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoUpdate RPM CellServDB
Simon Wilkinson [Tue, 9 Mar 2010 22:17:05 +0000]
Update RPM CellServDB

Update the CellServDB in the RPM packaging to 2010-02-28

Change-Id: I03d062a6c9b53edd6865932df5a93b42cd46e708
Reviewed-on: http://gerrit.openafs.org/1552
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoudebug: Fix byte ordering of last yes host
Andrew Deason [Fri, 5 Mar 2010 23:07:47 +0000]
udebug: Fix byte ordering of last yes host

Udebug gets the last 'yes' host in HBO, but afs_inet_ntoa wants it in
NBO. So convert it to NBO.

Change-Id: I5524d8086d5ac08875306fee923cb297c971cda8
Reviewed-on: http://gerrit.openafs.org/1549
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agovldb_check: do not ntohl u_chars
Andrew Deason [Tue, 9 Mar 2010 17:43:42 +0000]
vldb_check: do not ntohl u_chars

vldb_check was ntohl'ing fields like serverNumber when reading in a VL
entry. Since this is a u_char, ntohl'ing will just always result in 0,
not the actual value. Remove the ntohls so we read in VL data correctly.

FIXES 126661

Change-Id: If5117e1750d6dacd9bbe18bc936e0a1ba3d44340
Reviewed-on: http://gerrit.openafs.org/1548
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd FSYNC_VerifyCheckout
Andrew Deason [Fri, 19 Feb 2010 23:04:29 +0000]
Add FSYNC_VerifyCheckout

Add the function FSYNC_VerifyCheckout, which can be used to verify that
a previous checkout of a volume is still known by the fileserver, and
hasn't been forgotten about (by e.g. the fileserver restarting).

Change-Id: Ie3ec63d155fe16ca4929b370bbe55850075cec83
Reviewed-on: http://gerrit.openafs.org/1404
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd DAFS documentation overview for developers
Andrew Deason [Tue, 23 Feb 2010 21:43:11 +0000]
Add DAFS documentation overview for developers

Add some developer documentation for DAFS. This isn't comprehensive or
extremely detailed, but is intended to provide a larger-picture overview
of some of the pieces of DAFS. More detailed docs are intended to exist
in source comments (doxygen and such), and should already be there for
the most part.

Change-Id: I167b52c3bfb9e6b4b7111b3548ca8b1dafe305ea
Reviewed-on: http://gerrit.openafs.org/1376
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd VLockFileReinit
Andrew Deason [Fri, 19 Feb 2010 22:48:30 +0000]
Add VLockFileReinit

Add a VLockFile function, VLockFileReinit, to close all locks on that
particular lock file.

Change-Id: Ie1e4af21a486fb0451b6d613117027a522c9bb5a
Reviewed-on: http://gerrit.openafs.org/1358
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoVLockFile: add a couple of asserts
Andrew Deason [Fri, 19 Feb 2010 22:48:06 +0000]
VLockFile: add a couple of asserts

Add a couple of asserts to make some mistakes very obvious, such as
passing in an invalid 'locktype' or unlocking more times than locking.

Change-Id: Ie6e707ea515d5a6527dedc8875f0a4694b7b93c9
Reviewed-on: http://gerrit.openafs.org/1357
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoSchedule all salvages via VScheduleSalvage_r
Andrew Deason [Fri, 19 Feb 2010 21:17:56 +0000]
Schedule all salvages via VScheduleSalvage_r

Change I03ecf6302436c35fec705cd6c84a40b7cdbf6f97 allowed non-fileserver
programs to schedule salvages via FSSYNC, making the FSSYNC call
directly in VRequestSalvage_r. This isn't as safe as making the call in
VScheduleSalvage_r (as is done when the fileserver schedules a salvage
via SALVSYNC), since we may not have relinquished all of our handles and
such for the volume by the time the salvager starts.

So instead, make this path a bit more like the fileserver, and make
non-fileserver programs actually make the FSSYNC call in
VScheduleSalvage_r. Consequently, make VScheduleSalvage_r conditionally
hit FSSYNC or SALVSYNC. Add a VCheckSalvage to attach2 failures, so
non-fileserver salvage requests actually get scheduled.

Also, reorganize the attach2 error handling a bit to make this a bit
easier.

Change-Id: I786a7953e860a132575caad8fe12168f6841442b
Reviewed-on: http://gerrit.openafs.org/1356
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd FSSYNC debug logging
Andrew Deason [Thu, 18 Feb 2010 20:22:39 +0000]
Add FSSYNC debug logging

Add logging for what FSSYNC commands are being received by the
fileserver, so it is possible to see what's going on with FSSYNC. Log at
level 125, since this isn't interesting unless you knows some FSSYNC
details, and it can get quite verbose.

Change-Id: Ia067d3ba5084a919332989aac437ae4d4082e2e4
Reviewed-on: http://gerrit.openafs.org/1349
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoMove *SYNC string translation out of fssync-debug
Andrew Deason [Wed, 24 Feb 2010 15:47:03 +0000]
Move *SYNC string translation out of fssync-debug

Move the routines for translating ProgramType codes, and SYNC command
codes, response codes, etc out of fssync-debug, and into header files
anyone can use. These routines are useful especially for SYNC-related
debug or error logs.

Change-Id: Idc5ffe0dd798a9f18ca733e94d0bb4d740ad0836
Reviewed-on: http://gerrit.openafs.org/1390
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoDo not rely on vol header for V*VolumeHandles_r
Andrew Deason [Thu, 18 Feb 2010 18:21:45 +0000]
Do not rely on vol header for V*VolumeHandles_r

VCloseVolumeHandles_r and VReleaseVolumeHandles_r were using V_id to get
the id of the volume; just use vp->hashid so we can call these even if
we lack a header.

Change-Id: I0f0bc0ae82a7b86135aebe194c79a223a6f25094
Reviewed-on: http://gerrit.openafs.org/1348
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agodarwin report kext load address
Derrick Brashear [Tue, 9 Mar 2010 16:02:13 +0000]
darwin report kext load address

also report unload. in event of panic after module is unloaded (which
*shouldn't* happen but i have evidence it might) you can retcon where the
module was

Change-Id: I07f89d2393605c4b7cac853cbe09b5a4a52ea4cd
Reviewed-on: http://gerrit.openafs.org/1544
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoExport prototypes for osi_fbsd_{alloc,free} for use in rx
Ben Kaduk [Tue, 9 Mar 2010 04:38:15 +0000]
Export prototypes for osi_fbsd_{alloc,free} for use in rx

Include prototypes for osi_fbsd_alloc() and osi_fbsd_free() in
osi_machdep.h, since afs_prototypes.h is not included when compiling
the rx code.  afs_osi_Alloc_NoSleep is #defined to be osi_fbsd_free,
and is used in the rx code; if the prototype for the latter is not
included, then int is assumed for all parameters and return values,
which breaks the calling convention for 64-bit pointers.

Change-Id: I3d7575525f159097d1f8ca9ecb22af9f27b63111
Reviewed-on: http://gerrit.openafs.org/1541
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoUse correct types for UFS devices
Ben Kaduk [Sat, 6 Mar 2010 20:37:50 +0000]
Use correct types for UFS devices

For the FreeBSD 5.3 release, UFS (and everything else) took a
"dreaded s/dev_t/struct cdev */" change; we need to keep up
with this when comparing mountpoints' devices.

Change-Id: I47d3f874be05b16fc2da89dac2bb1b64c573ab8e
Reviewed-on: http://gerrit.openafs.org/1540
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoUse the correct API for msleep() in FBSD's afs_osi_TimedSleep()
Ben Kaduk [Sat, 6 Mar 2010 20:20:18 +0000]
Use the correct API for msleep() in FBSD's afs_osi_TimedSleep()

msleep() does not take a struct timespec*, it takes its timeout
value as a multiple of the kernel's HZ parameter (tuneable at
startup).  Since the afs_osi_TimedSleep interface is documented
to take a timeout in milliseconds, we must correct for the (sometimes)
different units (currently HZ defaults to 1000).  We prefer
to multiply the timeout by HZ before dividing by 1000 so as to
not lose precision; overflow is assumed to be unlikely.

Change-Id: Ic101f3bf54213eebe249cb6c40a6d8cbd3d722f0
Reviewed-on: http://gerrit.openafs.org/1539
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoFBSD build finishes for me
Ben Kaduk [Sun, 28 Feb 2010 22:07:15 +0000]
FBSD build finishes for me

Declare the fd variable.  Also a preprocessor tweak, as e2b65732
seems to have gotten the sense of the AFS_FBSD50_ENV check wrong.

Change-Id: I7e498a8276586af5afe0483380d00ef83266c316
Reviewed-on: http://gerrit.openafs.org/1526
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoafsconf srv lookup fill cellname
Derrick Brashear [Mon, 8 Mar 2010 19:06:50 +0000]
afsconf srv lookup fill cellname

pull out the cellname from the reply

Change-Id: I8e0dbb5b82e353ecd29a9cce25eaee1255062cd9
Reviewed-on: http://gerrit.openafs.org/1537
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoBegin support for OpenBSD 4.7
Antoine Verheijen [Wed, 3 Mar 2010 18:57:29 +0000]
Begin support for OpenBSD 4.7

Add config param header and sysname number for OpenBSD 4.7 (currently
in beta).

Change-Id: I6537bd352becd9a8c3937e95f79911c8bc08bcfb
Reviewed-on: http://gerrit.openafs.org/1533
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoOpenBSD: eliminate use of VREF() macro
Antoine Verheijen [Sun, 7 Mar 2010 19:50:06 +0000]
OpenBSD: eliminate use of VREF() macro

OpenBSD 4.7 (currently in beta) removes the (dummy) VREF() macro from the
system header files. For at least as far back as OpenBSD 3.6, all this
macro does is expand to a call to a system routine by the same name in
lower case. This patch therefore replaces the single OpenBSD use of
VREF() with a direct call to the routine to which it expanded.

Change-Id: I44888ed1ba7ba8e7150202798def10bed2ab3158
Reviewed-on: http://gerrit.openafs.org/1532
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoBe type correct in osi_ThreadUnique() for FBSD
Ben Kaduk [Sat, 6 Mar 2010 19:51:17 +0000]
Be type correct in osi_ThreadUnique() for FBSD

Formerly, in AFS_FBSD50_ENV, we used curproc for the ThreadUnique
value; however, curproc (#defined as curthread->td_proc) is a
struct proc *, not an actual pid.  (As such, it suffers from
a 32/64-bit mismatch on 64-bit systems.)  Use the correct value,
curproc->p_pid, instead.

Change-Id: If07ef3b0814c0fee63b62d2f36fa94d6e45573b9
Reviewed-on: http://gerrit.openafs.org/1528
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoFBSD module loads now
Ben Kaduk [Mon, 1 Mar 2010 01:08:52 +0000]
FBSD module loads now

Actually declare the global afs_global_owner, in afs_osi.c.
This allows all symbols to resolve, so that the loader will
accept the module.  There are still significant issues, though.

Change-Id: I705178cfa152f4ceaf59f008f53c1f62fb92826f
Reviewed-on: http://gerrit.openafs.org/1527
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoWindows: use krb5_get_error_message instead of error_message
Jeffrey Altman [Fri, 5 Mar 2010 14:49:12 +0000]
Windows: use krb5_get_error_message instead of error_message

krb5_get_error_message() can return more descriptive errors
based upon the context in which the error occurred by extracting
the cached error message from the krb5_context.  Since aklog
has a krb5_context, use that instead of error_message().

Use GetProcAddress to load krb5_get_error_message and
krb5_free_error_message function pointers because versions
of KFW prior to 3.2 do not export them.

LICENSE MIT

Change-Id: I12043ec1890bcf0f4d9566f35bb1228e579c49fe
Reviewed-on: http://gerrit.openafs.org/1520
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoLinux: Make keyring destructor remove all tokens
Simon Wilkinson [Sat, 6 Mar 2010 00:13:06 +0000]
Linux: Make keyring destructor remove all tokens

The keyring destructor on Linux was only destroying the first
unixuser structure found for the PAG being destroyed. In environments
where each PAG contains tokens for multiple cells, this led to us
leaking unixuser structures, and eventually grinding to a hault due
to the length of the resulting hash chains (and some horrific
O(n-squared) performance in the PAG statistics code).

Add a utility function for the keyring destruction function to call
which will mark as deleted all unixuser structures for a particular
PAG, and use it.

Change-Id: I355465c43cc2cf9d70f613d6f97cd65552260157
Cc: Eric.Hagberg@morganstanley.com
Reviewed-on: http://gerrit.openafs.org/1524
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Fix builds on RHEL4
Simon Wilkinson [Sat, 6 Mar 2010 11:21:06 +0000]
Linux: Fix builds on RHEL4

RHEL4 has a very old 2.6 kernel (2.6.9), which predates the start of
the Linux git tree. When I started using page_offset, I mistakenly assumed
that everything in the initial commit to that tree was available in all
2.6 versions we care about. That isn't the case, sadly.

Secondly, the new readpage code uses zero_user_segments, which has only
been available in the mainline kernel since 2.6.25 (RHEL5 appears to have
a backport)

Implement local wrappers for both of these functions when configure can't
find them in the kernel we're building for.

These functions have been created independently of the Linux tree.
page_offset is a copy of the code we used before we replaced it.
zero_user_segments() is a first-principles implementation
of the function (which zeros a pair of memory ranges within a single page)

FIXES 126678

Change-Id: I622aec4d653567d5234e7a127b981e97468bbe7c
Reviewed-on: http://gerrit.openafs.org/1525
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: replace invalidate_inode_pages
Marc Dionne [Fri, 5 Mar 2010 22:54:42 +0000]
Linux: replace invalidate_inode_pages

This helper has been deprecated for a while, and gets removed
with 2.6.34.
Replace it with invalidate_remote_inode, which has been around for
all of 2.6's life, according to Chaskiel in RT #124377.

Change-Id: I8658b454e1c997c041f654ba55d06f713ea25459
Reviewed-on: http://gerrit.openafs.org/1523
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoWindows: use krb5_get_error_message to translate krb5 errors in afskfw library
Jeffrey Altman [Fri, 5 Mar 2010 14:47:43 +0000]
Windows: use krb5_get_error_message to translate krb5 errors in afskfw library

Use krb5_get_error_message to translate krb5 errors to strings
in the afskfw library.  This provides error translations to afscreds
and afslogon.dll.

LICENSE MIT

Change-Id: Idd4c15b3719be517a79947f6af52a4bdf50b1155
Reviewed-on: http://gerrit.openafs.org/1519
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: use krb5_get_error_message in netidmgr_plugin
Jeffrey Altman [Fri, 5 Mar 2010 14:46:08 +0000]
Windows: use krb5_get_error_message in netidmgr_plugin

Use krb5_get_error_message to translate krb5 error messages
to strings.

LICENSE MIT

Change-Id: Ia2fd5d655e4b0fa894ce724d4c123d2df433bb32
Reviewed-on: http://gerrit.openafs.org/1518
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: Add krb5 error message functions to loadfuncs header
Jeffrey Altman [Fri, 5 Mar 2010 14:43:13 +0000]
Windows: Add krb5 error message functions to loadfuncs header

Add krb5_get_error_message and krb5_free_error_message
to loadfuncs-krb5.h so that they can be used in conjunction
with LoadFuncs to obtain function pointers when available.

LICENSE MIT

Change-Id: Ice7c2f6384c480570fcec4810bd86f4d0c525227
Reviewed-on: http://gerrit.openafs.org/1517
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: reset local mount point count during freelance re-initialization
Jeffrey Altman [Thu, 4 Mar 2010 21:23:36 +0000]
Windows: reset local mount point count during freelance re-initialization

When a re-initialization is taking place, be sure to reset
cm_noLocalMountPoints to 0 in case someone deletes the "Freelance"
registry key out from underneath the service.

LICENSE MIT

Change-Id: I2c3edd0d617d8fb7d670036510ca2a22eece0e6d
Reviewed-on: http://gerrit.openafs.org/1514
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoLinux : Don't leak GLOCK when writing CellServDB
Simon Wilkinson [Fri, 5 Mar 2010 15:40:55 +0000]
Linux : Don't leak GLOCK when writing CellServDB

Don't leak the GLOCK when we're iterating over the CellServDB in
response to a read of /proc/fs/openafs/CellServDB

Change-Id: I2ed08b9d7f93c7513b49708d009e8acaa478b5f8
Reviewed-on: http://gerrit.openafs.org/1522
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoadd growl agent for macos
Derrick Brashear [Thu, 4 Mar 2010 21:07:14 +0000]
add growl agent for macos

a userspace monitoring helper for mac users

Change-Id: If81c0b9d2c7606e81f271465491f0a0eb5db62b3
Reviewed-on: http://gerrit.openafs.org/1513
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agodarwin afshelper fix startup check
Derrick Brashear [Thu, 4 Mar 2010 19:16:04 +0000]
darwin afshelper fix startup check

make the launchd check run as root without whining about passwords
repeatedly

Change-Id: Ib4bac7c9ddf1837a8e86bf17a8a66b6ba1247272
Reviewed-on: http://gerrit.openafs.org/1511
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoevalmount copy out volid for sure
Derrick Brashear [Thu, 4 Mar 2010 17:23:14 +0000]
evalmount copy out volid for sure

make sure we really have a volid and avoid dereferencing tvp
if there's none

Change-Id: Iec6e7cba4d43e2d9c9af296bd6a1574e290bd118
Reviewed-on: http://gerrit.openafs.org/1512
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agomacos shutdown consistent behavior
Derrick Brashear [Wed, 3 Mar 2010 04:14:47 +0000]
macos shutdown consistent behavior

on every other platform, we check for afs unmounted before allowing shutdown.
do the same here.

Change-Id: Ic8c287be3ae39ad2d2ecb633748813f7f07b16e3
Reviewed-on: http://gerrit.openafs.org/1507
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoadd user warning facility via mariner for macos
Derrick Brashear [Tue, 2 Mar 2010 11:53:53 +0000]
add user warning facility via mariner for macos

existing mariner clients treat fetch$ and store$ special and otherwise
just blat out a string. use this to our advantage

Change-Id: Ib218918abe6038a08af58ea58405b2856ba1da9f
Reviewed-on: http://gerrit.openafs.org/1505
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agosupport mariner messages sans vcache
Derrick Brashear [Tue, 2 Mar 2010 11:42:41 +0000]
support mariner messages sans vcache

if a mariner message is passed in without a vcache, print it as-is

Change-Id: I1791102826db3cde484e0809ba79d54f22220be1
Reviewed-on: http://gerrit.openafs.org/1504
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agorewrite marinerlogfetching
Derrick Brashear [Tue, 2 Mar 2010 11:36:02 +0000]
rewrite marinerlogfetching

marinerlogfetching and marinerlog have a lot of code duplication.
fix that.

Change-Id: I52624ab8d1a6310c92a580990c45cc9313ea7a1c
Reviewed-on: http://gerrit.openafs.org/1503
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agorestore mariner storing message
Derrick Brashear [Tue, 2 Mar 2010 11:28:52 +0000]
restore mariner storing message

sometime after afs 3.3, the mariner log "storing" message was
lost in code restructuring. restore it.

Change-Id: I7832718973bf6378e643aea5391a0fd4940b5d3f
Reviewed-on: http://gerrit.openafs.org/1502
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agode-printf the cache manager
Derrick Brashear [Tue, 2 Mar 2010 11:14:19 +0000]
de-printf the cache manager

put most printfs into either afs_warn or comment out entirely

move a couple uprintfs to afs_warnuser (and allow them to trigger on macos)

Change-Id: If67a09287fcfbe44cc76961dd59d2aad3299e887
Reviewed-on: http://gerrit.openafs.org/1501
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd a section on how to tune the AFS cache using xstat_cm_test
Jason Edgecombe [Sat, 13 Feb 2010 16:31:09 +0000]
Add a section on how to tune the AFS cache using xstat_cm_test

The cache tuning section covers how to use xstat_cm_test to measure
the cache miss percentage.

LICENSE BSD

Change-Id: I895dbbecd7e16d44e18fa65e5e1aa1da5c567a06
Reviewed-on: http://gerrit.openafs.org/1308
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

11 years agoRemove duplicate make targets in tubik, cleanup dependencies
Marc Dionne [Fri, 26 Feb 2010 22:00:58 +0000]
Remove duplicate make targets in tubik, cleanup dependencies

Eliminate a few duplicate targets in the tubik Makefile, and
clean up some dependencies that could cause the same source file
to be compiled by different threads simultaneously when building
in parallel.  At least on my current gcc this would consistently
result in a gcc internal error.
The duplicate targets generate make warnings.

Change-Id: I807debae67c04b00a88ec798b966628e10c5f316
Reviewed-on: http://gerrit.openafs.org/1506
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agodarwin vfsops ansification
Derrick Brashear [Tue, 2 Mar 2010 10:59:30 +0000]
darwin vfsops ansification

kill off the old k&r prototypes in osi_vfsops.c

Change-Id: Ifd9bb9bd7f303f0f05f0776bb94222c3b138e808
Reviewed-on: http://gerrit.openafs.org/1500
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoafs_util don't use printf
Derrick Brashear [Tue, 2 Mar 2010 10:54:12 +0000]
afs_util don't use printf

afs_warn and printf are ideally not interchangeable. fix it.

Change-Id: Ib1b064549ef723fcac61e5ad89abe53a8ad76a51
Reviewed-on: http://gerrit.openafs.org/1499
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoBOP_MOVE and userspace move EXDEV helper
Derrick Brashear [Sat, 27 Feb 2010 20:30:06 +0000]
BOP_MOVE and userspace move EXDEV helper

turns background daemons into afsdb helper-like processes, which can
exit and do work. for macos, add BOP_MOVE and implement mv in afsd:
(macos EXDEV move is cp+rm, literally)

run cp + rm and pass the return back in. if it fails, just give
the client the error it had already

Change-Id: Ia0d5d49725f6aa28b5c58d0b7c61cc22329a3bc1
Reviewed-on: http://gerrit.openafs.org/1371
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoOSXPreferencePane
Claudio Bisegni [Mon, 1 Mar 2010 19:41:48 +0000]
OSXPreferencePane
checkAfsStatusForStartup method modification for search /afs volume for determinate if afs is on has been transfered into checkAfsStatus. checkAfsStatusForStartup method is used to check when afs start axitn system startup. Anyway these are only workaround we must use osx api or afs api to make this job.

Change-Id: If9be5a91418eccc0c58a69b566af140d619d3057
Reviewed-on: http://gerrit.openafs.org/1492
Reviewed-by: Claudio Bisegni <Claudio.Bisegni@lnf.infn.it>
Tested-by: Claudio Bisegni <Claudio.Bisegni@lnf.infn.it>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agomacos prefs pane more reliable running indicator
Derrick Brashear [Sun, 28 Feb 2010 01:09:42 +0000]
macos prefs pane more reliable running indicator

instead of grepping ps output, look for AFS in df output. not
happy with this either but it's way more reliable.

Change-Id: I73ff53bc1cc24c9484011a870546b6334ff66b49
Reviewed-on: http://gerrit.openafs.org/1410
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoMore help for the FBSD build
Ben Kaduk [Sun, 28 Feb 2010 21:42:22 +0000]
More help for the FBSD build

Remove extra #endif that was introduced in 6c628445.

Change-Id: I8c42bfb15aadacc2b7d5a1d07e70b1181fc2f65c
Reviewed-on: http://gerrit.openafs.org/1491
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoMake build progress farther
Ben Kaduk [Sun, 28 Feb 2010 21:15:05 +0000]
Make build progress farther

Add a prototype for afs_global_owner in the AFS_FBSD50_ENV case.

Change-Id: Ie9104af3e02e08cc46c479ff56f9e09aa3603e74
Reviewed-on: http://gerrit.openafs.org/1490
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoDon't pass NULL to strcmp
Marc Dionne [Sun, 28 Feb 2010 16:08:11 +0000]
Don't pass NULL to strcmp

A recent gcc update gives me a series of warnings from the NULL
argument to strcmp.  We should be passing an empty string instead
of a NULL pointer.

I suspect this was unintentional from a search/replace operation
in commit 8229e668.

Change-Id: I9677d80d32e5bd54ca1b560788a430c8cf40dae9
Reviewed-on: http://gerrit.openafs.org/1489
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoWindows: rx lowlevel nat ping
Jeffrey Altman [Sun, 28 Feb 2010 02:54:47 +0000]
Windows: rx lowlevel nat ping

sha1 d24078658d183ea2e72e61c1888e9900bac0ec32 added support
for a low-level nat ping using rx version replies.

Export rx_SetConnSecondsUntilNatPing from afsrpc.dll.

Add NatPingInterval registry value to
  HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters
to permit Nat Ping to be enabled.  The default value is 0 seconds.

Change-Id: I5122ea81e1a61934eba3c836632039c76f6c45e3
Reviewed-on: http://gerrit.openafs.org/1487
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agomagic mount parser fix
Derrick Brashear [Sun, 28 Feb 2010 04:00:31 +0000]
magic mount parser fix

parse vnodes from magic mount objects correctly

Change-Id: Id46afa7e6b1fa260d56ce54c8bffe2662b7c447d
Reviewed-on: http://gerrit.openafs.org/1488
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agomacos prefs pane krb5 auth setup
Derrick Brashear [Sat, 27 Feb 2010 22:48:19 +0000]
macos prefs pane krb5 auth setup

when we configure krb5-at-login, don't inadvertantly reorder the list.
replace inline.

FIXES 126628

Change-Id: I23de38dadeae6a01d6f97d84e7bb6d9e75e99510
Reviewed-on: http://gerrit.openafs.org/1408
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoirix syscall arg fix for rx
Derrick Brashear [Wed, 24 Feb 2010 00:45:21 +0000]
irix syscall arg fix for rx

rx uses the afs syscall to get network info in userspace. fix things to
pass a useful set of args in

Change-Id: I541f90d43ff79ba7a026832403d485b7738a53b8
Reviewed-on: http://gerrit.openafs.org/1379
Reviewed-by: Chaz Chandler
Tested-by: Chaz Chandler
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoinstitute afsdb dns lookup timeout if we can
Derrick Brashear [Sat, 27 Feb 2010 16:52:03 +0000]
institute afsdb dns lookup timeout if we can

don't be willing to wait more than about an rx timeout period for afsdb
retries.

Change-Id: Idca642ff7abe6b9233c7501b0f06fd353567bb04
Reviewed-on: http://gerrit.openafs.org/1407
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agorx lowlevel nat ping
Derrick Brashear [Thu, 25 Feb 2010 03:34:28 +0000]
rx lowlevel nat ping

for rfc 4787, do a minimal impact nat ping. this uses an rx
"version request" reply debug packet, which will simply be discarded by the
receiver, to keep the port mapping open.

Change-Id: Ic2180bfa5c467e33c72e3f19d62488bd6a2dc61a
Reviewed-on: http://gerrit.openafs.org/1393
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoConvert ObtainSalvageLock to the VLockFile API
Andrew Deason [Thu, 18 Feb 2010 17:36:10 +0000]
Convert ObtainSalvageLock to the VLockFile API

Make ObtainSalvageLock use the VLockFile API, to consolidate
platform-specific locking code, and to make it possible to acquire a
shared lock on the salvage lock file. Create the ObtainSharedSalvageLock
function to acquire such a lock.

Change-Id: Ieadd77ac8d4030b31c48fff1c98712a6c95f93ad
Reviewed-on: http://gerrit.openafs.org/1347
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoEnable parallel build for tubik
Marc Dionne [Fri, 26 Feb 2010 21:15:37 +0000]
Enable parallel build for tubik

Allow tubik to benefit from parallel make.

Change-Id: If4e7e1a603ef88f03bcc271ec6d742ba3387c61a
Reviewed-on: http://gerrit.openafs.org/1402
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agobackground daemon genericization
Derrick Brashear [Wed, 24 Feb 2010 05:57:23 +0000]
background daemon genericization

previously only "just enough" of the background daemon request object was
exposed. expose the rest of the generic pointers

Change-Id: Ifcadf53675598bc102208700ff34a768474174ec
Reviewed-on: http://gerrit.openafs.org/1384
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agohush another afsd warning
Derrick Brashear [Wed, 24 Feb 2010 05:59:16 +0000]
hush another afsd warning

we can't prototype call_syscall fully yet, but at least hush some warnings

Change-Id: I4e5f77037700f82ebfa87bd4fee4f52a59e3479a
Reviewed-on: http://gerrit.openafs.org/1385
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agodarwin vnops code cleanup
Derrick Brashear [Thu, 25 Feb 2010 21:58:31 +0000]
darwin vnops code cleanup

simplify ifdef structure by moving code around. remove dead code
and nonsensical code (darwin80 inside !darwin80)

no actual code changes here

Change-Id: Ifa7a5afa3bff731d73e7b4a5ee861c2cb48b71a3
Reviewed-on: http://gerrit.openafs.org/1382
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agodarwin afscall syscall should set retval
Derrick Brashear [Wed, 24 Feb 2010 05:30:28 +0000]
darwin afscall syscall should set retval

because of how the ioctl based syscall works, passing back a real
return value should be done this way, as it is for the other other
afs syscall subcalls. matters for userspace handlers.

Change-Id: I894b4bd633ce4823b1ce906861251fcbb3949af2
Reviewed-on: http://gerrit.openafs.org/1381
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agomacos bulkstat cleanup after racing stats
Derrick Brashear [Thu, 25 Feb 2010 21:52:02 +0000]
macos bulkstat cleanup after racing stats

if someone else stats it before we finish, make sure we clean up after
ourselves properly

Change-Id: I4a7257a403cccb02a114c60f5bb340dba6bb16cb
Reviewed-on: http://gerrit.openafs.org/1399
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoDo not leak information on partial success in RXAFS_InlineBulkStatus
Rainer Toebbicke [Wed, 24 Feb 2010 11:02:08 +0000]
Do not leak information on partial success in RXAFS_InlineBulkStatus

Initialize all RXAFS_InlineBulkStatus return parameters in case portions
remain unset on FetchStatus failures. Also ensure VolSync info is set even if
the first FetchStatus fails.

Change-Id: I8c502d25ef1362675fed2871dbd8c3c4e76af55b
Reviewed-on: http://gerrit.openafs.org/1396
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agocorrect magic vnode volumename parsing
Derrick Brashear [Wed, 24 Feb 2010 05:41:48 +0000]
correct magic vnode volumename parsing

if /afs/.:mount/cell:volume:vnode is passed in, don't pass the :vnode
into the volume id lookup

Change-Id: If877b467cd37f06dcb090c34560bf76f8e4b0d10
Reviewed-on: http://gerrit.openafs.org/1383
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoirix kill efs and start pruning pre-65
Derrick Brashear [Wed, 24 Feb 2010 05:19:20 +0000]
irix kill efs and start pruning pre-65

we haven't built on irix 6.4 in a while. likewise, no efs anymore.

just remove the extra code

Change-Id: I559f4bca5bf52f9a0344472ccf60b93751282a2b
Reviewed-on: http://gerrit.openafs.org/1380
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoirix cachemgr inode abstraction correction
Derrick Brashear [Wed, 24 Feb 2010 04:57:14 +0000]
irix cachemgr inode abstraction correction

if the XFS function takes a dcache_id_t, pass that and not its child

Change-Id: Ic68ae440be0df05320fe0a0b24e2ffa8e4de45b9
Reviewed-on: http://gerrit.openafs.org/1378
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agofreebsd initglock endif fix
Derrick Brashear [Wed, 24 Feb 2010 21:02:26 +0000]
freebsd initglock endif fix

when initglock hit freebsd it was broken. fix it. make it obvious that such is
being done

Change-Id: Iac716302061be91a43f168c9a1fe56cdbbb4227d
Reviewed-on: http://gerrit.openafs.org/1391
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoremove dropbox attribute leak fix
Derrick Brashear [Wed, 24 Feb 2010 16:13:23 +0000]
remove dropbox attribute leak fix

change 6ec18461649d3e4f44b2476f886bcc480c456500, avoid leaking stat info,
appears to have side effects on at least macos, crashing the system
coreservicesd. revoke the change until the exact behavior we want is
better understood.

Change-Id: I2a270750f9cef5ac6ecf1144d86988f030f78efe
Reviewed-on: http://gerrit.openafs.org/1388
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoMake VLockFile not DAFS-specific
Andrew Deason [Thu, 18 Feb 2010 17:52:33 +0000]
Make VLockFile not DAFS-specific

The VLockFile API does not require DAFS functionality, so make it
available to non-DAFS code, as well.

Change-Id: I3d9bebb5d4034f0af739ccee37f64e2254be38cb
Reviewed-on: http://gerrit.openafs.org/1346
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoVLockFile: init fd to INVALID_FD, not zero
Andrew Deason [Thu, 18 Feb 2010 20:41:24 +0000]
VLockFile: init fd to INVALID_FD, not zero

Zero is a valid file descriptor; initialize lockfile fd to INVALID_FD
instead, so we know it's invalid.

Change-Id: Iacb549ec4ed821763d20cb0e4f25882b4151bf3a
Reviewed-on: http://gerrit.openafs.org/1345
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoVLockFile: Do not close fd on lock failure
Andrew Deason [Thu, 18 Feb 2010 17:42:27 +0000]
VLockFile: Do not close fd on lock failure

When we fail to acquire a lock in _VLockFd, do not close the fd if we
fail to acquire the lock for any reason, since VLockFile does that for
us already. There also may be other locks on that file, and we clearly
do not want to release them when just one lock fails. VLockFile takes
care of the necessary refcounting and fd closing, so don't do it in
_VLockFd too.

Change-Id: I65f27837dad033e0e84faf4aa0fb71ff26feda83
Reviewed-on: http://gerrit.openafs.org/1344
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoviced avoid global pruclient during acl ops
Derrick Brashear [Mon, 15 Feb 2010 21:12:44 +0000]
viced avoid global pruclient during acl ops

acl_Internalize and acl_Externalize used the global pruclient

use the ones we use elsewhere in viced FetchAcl/StoreAcl also

Change-Id: Ia2b8d29035ed48a6aab8c9df243c9082bfacd201
Reviewed-on: http://gerrit.openafs.org/1314
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoadd limits.h to sysincludes.h on IRIX
Chaz Chandler [Tue, 23 Feb 2010 22:20:39 +0000]
add limits.h to sysincludes.h on IRIX

xdr_mem.c wasn't including limits.h on IRIX when KERNEL was declared, so i
INT_MAX was undefined.  this adds limits.h to sysincludes.h so it's included
for all other places where it might be needed.

Change-Id: I718f5bf4dc5d82e2ce74ecc30ab3bf5492b82e29
Reviewed-on: http://gerrit.openafs.org/1377
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: autoconf.h is moving in 2.6.33
Anders Kaseorg [Sat, 20 Feb 2010 18:36:22 +0000]
Linux: autoconf.h is moving in 2.6.33

In 2.6.33, <linux/autoconf.h> is moving to <generated/autoconf.h>.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Change-Id: Ib97031728b89cf8e17581f3c425216ae4b5538ec
Reviewed-on: http://gerrit.openafs.org/1351
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Use kbuild to check for UML
Anders Kaseorg [Sat, 20 Feb 2010 18:28:59 +0000]
Linux: Use kbuild to check for UML

<linux/autoconf.h> is automatically included by kbuild; you aren’t
supposed to include it directly.  That breaks in 2.6.33 because
<linux/autoconf.h> is moving to <generated/autoconf.h>.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Change-Id: I56c90dfe90ef72408620793fcd4e927ea3d8f468
Reviewed-on: http://gerrit.openafs.org/1350
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdjust afs_lockctl to compensate for byte-range lock fixes
Anders Kaseorg [Sun, 21 Feb 2010 01:52:06 +0000]
Adjust afs_lockctl to compensate for byte-range lock fixes

As of commit 49b7bbdd3b45df694fadbef48f9ed99d9bfe07b9, l_len is no
longer 1 less than it should be.  Update afs_lockctl to expect this.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Change-Id: I3fb7665457d489e56564b14933795084a0958d6f
Reviewed-on: http://gerrit.openafs.org/1353
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Fix conversion of whole-file locks
Anders Kaseorg [Sun, 21 Feb 2010 01:28:42 +0000]
Linux: Fix conversion of whole-file locks

An overflow bug in commit 49b7bbdd3b45df694fadbef48f9ed99d9bfe07b9
caused whole-file locks to be treated as byte-range locks, which fail
to be propagated to other machines.

Fix this by setting l_len = 0 for locks that range to the end of the
file.

FIXES 126561

Change-Id: Ie2dc9d04f33559c73b3b86b64152c549b785f8ad
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/1352
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAbstract /vicepX header traversal
Andrew Deason [Wed, 27 Jan 2010 21:08:34 +0000]
Abstract /vicepX header traversal

The code for examining all of the headers on a vice partition now exists
in two places: the VGC scanner, and the salvager. Create the
VWalkVolumeHeaders function that contains the common logic so it's in
one place, and take a couple of function callbacks for the differences.

Change-Id: I12c71b3344ffbd0b22ddf5418f9ff0509734f42b
Reviewed-on: http://gerrit.openafs.org/1264
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoAllow GetSomeSpace_r to select an optimal host
Andrew Deason [Mon, 15 Feb 2010 22:22:56 +0000]
Allow GetSomeSpace_r to select an optimal host

Previously GetSomeSpace_r would never find an 'ideal' host for which to
clear callbacks, since lih0_r and lih1_r required a non-NULL rock to do
anything. Remove the requirement for the passed-in host rock to be
non-NULL, and make lih*_r more threadsafe, by passing in a parameter
struct for the rock.

Also attempt to make the GSS_r code a bit more clear with some
descriptive variable names and such.

FIXES 126451

Change-Id: Id754f4fa4b830896c5b03fc7ba0906950991a3b7
Reviewed-on: http://gerrit.openafs.org/1317
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoh_TossStuff_r: make sure host does not go away
Andrew Deason [Tue, 16 Feb 2010 17:08:38 +0000]
h_TossStuff_r: make sure host does not go away

When h_TossStuff_r h_NBLock_r's a host, it is not only possible for
someone else to grab a hold on the host, but in theory it's also
possible for someone to hold a host, release it, and for the host to be
deleted again (assuming some callers hold HOSTDELETED hosts, which they
should not be doing).

To make this safety check a bit more robust, hold the host in
h_TossStuff_r before h_NBLock_r'ing, to ensure that it does not go away
while we're waiting for H_LOCK.

Change-Id: I018a611143d6dccba79cc627803cce74aa830c77
Reviewed-on: http://gerrit.openafs.org/1330
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoanalyze warning fix
Derrick Brashear [Mon, 22 Feb 2010 18:58:58 +0000]
analyze warning fix

initialize variable. warnings caught this in the other compiler

Change-Id: Iae2ae5c1aefe29603bbf5d9952f65b0119f4db9b
Reviewed-on: http://gerrit.openafs.org/1363
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoPrevent deadlock if fs_stateSave panics
Andrew Deason [Mon, 22 Feb 2010 17:56:07 +0000]
Prevent deadlock if fs_stateSave panics

fs_stateSave can call ShutDownAndCore(PANIC) if it detects host list
corruption. Right now this will deadlock the shutdown thread, since
we're still holding a read lock on the FS state when we do so, and
ShutDownAndCore will attempt to acquire a write lock. Do two things to
make this a bit better:

 -- Unlock the FS state before calling fs_stateSave, sine we're no
 longer looking at the FS state (the 'state' in fs_stateSave refers to
 the host list and callback lists, not the state locked by
 FS_STATE_*LOCK)

 -- If ShutDownAndCore detects that it was called inside of
 ShutDownAndCore, skip shutting down the volume and host packages, since
 they have already been shut down

Change-Id: I24a994ff85a6d866a5800b777c0cf5ab2ba466e4
Reviewed-on: http://gerrit.openafs.org/1362
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoCheck for HOSTDELETED before h_Hold_r
Andrew Deason [Fri, 12 Feb 2010 23:44:31 +0000]
Check for HOSTDELETED before h_Hold_r

A few places h_Hold_r a host and later drop and reacquire H_LOCK without
checking if the hostFlags contains HOSTDELETED. This can cause a race
with h_TossStuff_r where we later reference a host that is about to be
freed or already has been freed.

Add checks for HOSTDELETED in these places, and skip over the deleted
hosts.

FIXES 126454

Change-Id: I5a61831f5afdbc908b82e4cf63cf14a34a36e275
Reviewed-on: http://gerrit.openafs.org/1305
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoCorrect the h_Enumerate_r hostList safety check
Andrew Deason [Fri, 12 Feb 2010 22:30:44 +0000]
Correct the h_Enumerate_r hostList safety check

Ide1e5aca7c2c4a4af3f62bc07821db694f2f9999 added safety checks for a few
traversals through hostList, including the traversal in h_Enumerate_r.
Unfortunately, h_Enumerate_r may not hold H_LOCK over its entire
traversal (h_Release_r can drop and reacquire it), so the value of
hostCount is not guaranteed to stay the same.

A host may be deleted during the loop, or right near the end, decreasing
hostCount to below our current running 'count' of hosts, triggering the
panic unnecessarily.

Also, we break out of the loop if the H_ENUMERATE_ISSET_BAIL test
succeeds, making the panic also incorrectly trigger then.

So instead, remember the value of hostCount, and ensure that we've
actually exceeded that count in the post-loop check.

Change-Id: I7c13bbf111b592df6860e5852807fa463c3ebd7e
Reviewed-on: http://gerrit.openafs.org/1304
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoh_TossStuff_r: check held-ness after lock
Andrew Deason [Mon, 15 Feb 2010 16:55:33 +0000]
h_TossStuff_r: check held-ness after lock

h_TossStuff_r checks if a host is held or locked by another thread
before trying to delete the host. Unfortunately, it checks if it is
locked before checking if it is held, and the lock check drops H_LOCK.
Thus, another thread could hold the host while we don't have H_LOCK, and
we could delete a host that is being held.

Although it is a bug if any thread holds a host that is being deleted,
some instances of this still exist, so make the check more robust.
Reverse the order of the tests, so we detect if someone held the host
while the lock check dropped H_LOCK.

Also log when this happens, as it indicates a bug occurring.

FIXES 126454

Change-Id: I8fa972c430e63fc46ca4fadcc3429173ac91a947
Reviewed-on: http://gerrit.openafs.org/1312
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoanalyze paranoia
Derrick Brashear [Mon, 22 Feb 2010 17:15:15 +0000]
analyze paranoia

don't pass a null pointer to FindVolume in case one shows up

Change-Id: I76258d8f8ca18c536e3faa776df3e06005fe2bc2
Reviewed-on: http://gerrit.openafs.org/1360
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>