Prevent rxgen from generating code that produces warnings at compile
time.
* Add print_ifarg_with_cast(). Used within print_ifstat() to generate
a member in an argument list complete with a type cast. The type
cast may be a pointer to the type or the type depending on the value
of the 'ptr_to' parameter.
* When print_ifstat() generates the output for an opaque vector, cast
the object to 'caddr_t' as xdr_opaque() accepts an argument of type
'caddr_t'.
* When print_ifstat() generates the output for an opaque array, cast
the object to 'char **' because xdr_bytes() accepts an argument of
type 'char **'.
* When print_ifstat() generates the output for any array that is not
opaque or string, cast the object to 'caddr_t' because all of the
xdr_XXX() functions other than xdr_opaque and xdr_bytes accept an
argument of type 'caddr_t'.
* When print_ifstat() generates the output for an alias, cast the
output to a pointer to the specified type because xdr_<type> accepts
an argument of type '<type> *'.
This addresses warnings generated when compiling fsint/Kvice.xdr.c and
fsint/afsint.xdr.c.
Reviewed-on: http://gerrit.openafs.org/664
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
start cleanup of calls to exit scatter into library code. ugen_ callers handle
error returns correctly; rmtsys already deals with errors; and rx_pthread can
already deal with errors in the case that's fixed
Reviewed-on: http://gerrit.openafs.org/667
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
make all errors from warnings when compiling on snowleopard die
as a note, the ukernel pid, and pthread self as id changes, probably
should be revisited, but for now i have changed nothing. it should
be a separate change.
Reviewed-on: http://gerrit.openafs.org/666
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Commit db949b7fad was incorrect and
generated warnings on many platforms; we cannot determine the correct
format string for a size_t at compile-time. Instead use the %z length
modifier when we can detect that it is safe to use. Otherwise, fall back
to just %lu on Unix, since it is reasonable to assume
sizeof(size_t) == sizeof(unsigned long) on Unix.
Reviewed-on: http://gerrit.openafs.org/647
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Initialize cellentry. It does not appear to be possible to actually hit
code that references an uninitialized cellentry, but the compiler can
still complain.
Reviewed-on: http://gerrit.openafs.org/665
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Implement readonly volume versioning based upon the .readonly
volume creation date as reported in the AFSVolSync output
parameter of every RXAFS RPC.
Whenever a new callback is obtained for an object stored within
a .readonly volume, the volume creation date is recorded in the
cm_volume object along with the callback expiration time and
a reference to the server that issued it. These values are
used to determine if a callback is present when the cm_scache
object's volume creation date matches the cm_volume object's
volume creation date. If there is no match, the cm_scache
object's individual callback information is used to determine
whether a callback has been registered.
This mechansism ensures that the whole-volume callback issued
in response to a RXAFS_FetchStatus request against a .readonly
volume can be applied to all objects that are cached from the
same version of the .readonly volume instance.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/654
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Recent change sets removed the 'ignore-all-warnings' mode from a
number of files, in favour of using the implicit-function-declaration
pragma. Sadly, that pragma isn't available in gcc 4.2. Revert the
Makefile changes such that ignore all warnings is turned back on
for the affected files, and note this in README.WARNINGS
Reviewed-on: http://gerrit.openafs.org/639
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
create new api call afsconf_LookupServer
make afsconf_GetAfsdbInfo call it
include T_SRV support
Reviewed-on: http://gerrit.openafs.org/594
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
The 'audit' target requires that fsint is built first. Express this as a make
dependency.
Reviewed-on: http://gerrit.openafs.org/660
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
When the file server fetchdata invalid length bug is detected the
cache manager must fake the AFS Status info for the file as well
as the AFSVolSync info. Otherwise, the merge status is incorrect.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/651
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
filp is unused after the recent rework of osi_file.c
Reviewed-on: http://gerrit.openafs.org/656
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
tbutc:
- Ignore warnings for dump.c
butc/dump.c:
- butm_WriteFileData takes a char*, no need to cast buffer
- volumeHeader_hton takes a struct volumeHeader*, though, need to cast
buffer there
- Ignore strict prototypes
butc/recoverDb.c:
- scanVolData takes a uint*, not an int*
- Initialize nbytes to 0
- Remove warning inhibition
butc/tcmain.c:
- atocl takes an int*, not a uint*
- Ignore implicit function declaration warnings
butc/tcudbprocs.c:
- Ignore implicit function declaration warnings (ubik stuff)
butm/file_tm.c:
- Include sys/wait.h for the waitpid() prototype
Reviewed-on: http://gerrit.openafs.org/635
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
If the SecurityLevel registry value indicates that crypt should be
the default, then always set -encrypt for vos.exe and pts.exe.
Reviewed-on: http://gerrit.openafs.org/648
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
On ZFS, the disk space files can use up can be rounded up to the next
recordsize boundary if they've been truncated. This can cause the Unix CM
to mis-estimate cache usage, since it truncates files fairly often, and
assumes the disk space used is the file length rounded up to the next
f_frsize.
Since the ZFS recordsize is available via the statvfs f_bsize, just
round up to that instead. There is still some additional file metadata
that takes up some additional space on disk, but according to ZFS people
I've spoken to about this, it cannot be known in advance. In practice,
the additional metadata storage doesn't appear to exceed about 10% of
the data storage, which should be acceptable.
FIXES 125365
Reviewed-on: http://gerrit.openafs.org/650
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Add a new public header file volser_prototypes.h, which contains
prototypes for those volser functions that are used by the rest of the
tree, and link it into the Unix and Windows build systems.
Rename the current volser_prototypes.h volser_internal.h, and update
references to it.
Make those places that should use the new public header use it, and
re-enable warnings-as-errors as appropriate.
Remove the warning free files from the list in README.WARNINGS
Add butm_prototypes.h to butc/lwps.c, so we can enable warnings for that,
too.
Reviewed-on: http://gerrit.openafs.org/636
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add the new afsio binary to the appropriate .gitignore file
Reviewed-on: http://gerrit.openafs.org/637
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
When the HKLM\SYSTEM\CurrentControlSet\Services\TransarcAFSDaemon\Parameters
"ReadOnlyVolumeVersioning" DWORD registry value is non-zero, the volserver
will be queried for each .readonly volume to obtain the lastUpdateTime.
The lastUpdateTime will be used as a volume version identifier for each
cm_scache_t object stored in the volume. With a known volume version,
whenever a current status is obtained for any object within the .readonly volume,
all the cached objects within that volume that have the same volume version
can share the resulting callback registration.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/579
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Remove all OutputDebugString calls from the explorer shell extension.
OutputDebugString() requires acquiring system global locks.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/643
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
The error codes that should be returned when a lock request
fails are:
STATUS_LOCK_NOT_GRANTED for an explicit lock request
STATUS_SHARING_VIOLATION when a CreateFile fails due to a previous lock
Correct the service to ensure that these values are in fact returned.
Also, add 'fsLockCount' field to cm_scache_t and dump its value
as part of the "fs memdump" output. This permits some ability to
identify what the file server thinks the lock count is.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/646
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Rx RTT calculations are based on Van Jacobson's work using
constants that make computations fast but are not necessarily
the best for modeling Rx protocol exchanges. This patch does
not alter the constants but does improve the comments to show
that the math is correct.
Phil Karn in 1987 demonstrated that Van Jacobson's algorithms
produced inaccurate results when the RTT computed from an
acknowledgement of a retransmitted packet were included. The
resulting RTT would either be too small causing the system to
retransmit too many packets or too long resulting in too few
being sent.
This patch follows Phil Karn's advice which was also adopted
as mandatory for TCP in RFC2988. Retransmitted packets and
delayed acks are skipped and the retransmit time is backed off
(up to a maximum of 3 seconds) until a successful acknowlegement
is received for an initially transmitted packet.
LICENSE BSD
Reviewed-on: http://gerrit.openafs.org/580
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Make consistent use of AFS_PROC in portable and mixed files, adding the define
for platforms which lacked it. This completes a change that has been ongoing
for several years.
LICENSE BSD
Reviewed-on: http://gerrit.openafs.org/642
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This reverts commit 6133d25397.
This patch breaks builds on RHEL5.3 - revert it until we can come up
with a fix.
Reviewed-on: http://gerrit.openafs.org/640
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Modify cm_FindServerByIP to search by port as well.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/607
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
When the file server fetchdata offset bug is triggered and detected,
not only do we have to behave as if 'length_found' is zero, but we
also must ignore the RXGEN_CC_UNMARSHAL error that will be returned
from rx_EndCall() due to the parsing error that occurred during the
rx_Read32() call.
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/634
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Fix the kmem_cache constructor function to match the current
expected prototype, and cleanup related code. This has been wrong
for a while, but since we were just passing extra parameters the
only effect was to generate a warning.
- Add a new configure test to detect the new constructor function
signature
- Define the older versions of the constructor in osi_compat.h,
making them call the current version
- Move a few compatibility #defines to osi_compat.h
- Clean up the call to kmem_cache_create by introducing an inline
afs_kmem_cache_create in osi_compat.h
Reviewed-on: http://gerrit.openafs.org/621
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Commit 906403c6d7 introduced a warning by
making 'error' unused anywhere. Remove the declaration, as well.
Reviewed-on: http://gerrit.openafs.org/620
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
A typo in c717fcd32c removed the = before
the first head1 in vos_remsite.pod. Put it back.
Reviewed-on: http://gerrit.openafs.org/612
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Larger collection of all vos suite commands, including but
not limited to:
-- documented all commands / options, verified against both 1.4 and 1.5 tree
(including the common -encrypt/-noresolve options)
-- correct order, POD formatting and synopsis for all commands' options
-- shorthand synopsis provided for all commands that missed it, with proper
non-ambiguous command abbreviations of all options
-- POD synopsis formatted to 80-columns in commands where it was running over
-- for newer options, documented which OpenAFS version they became available
-- proper manpage links using L<> in vos.pod
Reviewed-on: http://gerrit.openafs.org/609
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Squash a few miscellaneous that appear when building vos.c:
-- CreateVolume should use util_GetUInt32 to parse vol ids, since they
are now unsigned
-- The m_uuid argument of print_addrs is altered, so do not declare it
const
-- Declare the confDir argument of ugen/vsu_ClientInit to be const,
since it does not change, and vos.c passes a const confDir in
MyBeforeProc
-- Ignore implicit function declaration warnings and remove
CFLAGS_NOERROR from the vos.c build, since the only remaining
warning is an implicit function declaration
Reviewed-on: http://gerrit.openafs.org/602
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Some miscellaneous warnings throughout rxkad:
rxkad/ticket5.c:
- Explicitly cast ticket blob to unsigned char*, as some functions take
a ticket as a char*, and some take it as an unsigned char*
- in tkt_DecodeTicket5, make 'start' and 'end' be unsigned, since that
is what their callers think they are
- Ignore implicit function declaration warnings (for CRC functons)
- Remove general warning inhibition
rxkad/ticket.c:
- in tkt_DecodeTicket, make 'start' and 'end' be unsigned, since that
is what their callers think they are
- Remove general warning inhibition
rxkad/v5der.c:
- In decode_enumerated, use der_get_unsigned instead of der_get_int,
since we're decoding an unsigned integer.
rxkad/rxkad_server.c:
- The last two arguments to rxkad_DeriveXORInfo are char*s, so
explicitly cast them to be so
- Remove general warning inhibition
rxkad/rxkad_common.c:
- rxkad_stats_t has had a couple of spares transform into
clientObjects/serverObjects; account for them and don't overrun the
spares array
Reviewed-on: http://gerrit.openafs.org/600
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
cmd/cmd.c:
- Just make dummy be a struct cmd_item instead of casting
rxdebug/rxdebug.c:
- Access the stats packet through a union instead of casting and
dereferencing
util/uuid.c:
- Access the seed through a union and an array instead of that
incrementing-pointer approach
Reviewed-on: http://gerrit.openafs.org/599
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
xdr_alloc must be used instead of malloc in SRXAFSCB_GetLocalCell
and SRXAFSCB_GetCacheConfig
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/606
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Commit 36be36e034 introduced some casts
from an integer type to void *. This generates warnings on a 64-bit
platform.
Use uintptr_t casts to make the compiler happy.
Reviewed-on: http://gerrit.openafs.org/605
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Permit DNS SRV record lookups to be used by the Windows afsconf_GetAfsdbInfo
As per the published DNS SRV internet draft for the AFS3 protocol,
DNS SRV records are to replace AFSDB records as the primary method
of looking up AFS3 service location information.
In order to make that happen for Windows:
1. afsconf_GetAfsdbInfo must be able to translate from internal service
names to IANA assigned service names.
2. The Windows getAFSServer() API must accept IANA service and protocol
parameters as well as the port number to use if AFSDB record fallback is
required.
3. The Windows cache manager must pay attention to the port number
stored within the sockaddr_in structure instead of using hard coded
values based upon the server type.
For afsconf_GetAfsdbInfo, in addition to searching for the requested
IANA service, if that service is prserver or kaserver fallback to
the vlserver record (if any).
LICENSE MIT
Reviewed-on: http://gerrit.openafs.org/593
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Callers of xdrproc_t functions give the function a foo* as the second
argument, not a foo**, and the xdrproc_t functions themselves expect
this. Make the xdrproc_t typedef accurately reflect that, thereby
ridding us of some warnings.
Reviewed-on: http://gerrit.openafs.org/603
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Some warnings were ignored in libafsrpc, but not in shlibafsrpc. Ignore
them in both places.
Reviewed-on: http://gerrit.openafs.org/601
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
-- The EP/ep function does not return anything; declare the function pointer
accordingly
-- Explicitly cast &stackvar to char* to avoid a warning
Reviewed-on: http://gerrit.openafs.org/598
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
-- In ka_Authenticate, explicitly cast 'start' and 'end' to void*,
since kawrap_ubik_Call takes all arguments as void*s
-- Fix kawrap_ubik_Call to not be an old-style declaration
-- Only ignore strict prototypes and implicit function declaration
warnings
Reviewed-on: http://gerrit.openafs.org/597
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>