Sadly, similar changes were never made to afs/afs_buffer.c, so the
same problems remain in the cache manager.
The issue here is with two processes racing in afs_newslot. Calls to
afs_newslot protect buffers with a zero reference count using
afs_bufferLock. If we release afs_bufferLock, before we increase the
reference count of the vcache, then we can end up with newslot
picking the same buffer for two different purposes.
The GLOCK actually protects us from the worst of this, but this fix
is necessary both for correctness, and for symmetry with the file
server buffer code.
Simon Wilkinson [Mon, 26 Oct 2009 19:46:09 +0000 (19:46 +0000)]
Remove pininodes
The pininodes option has been commented out of afsd since the
original OpenAFS commit. Enabling it now would cause chaos, due to
the way that cmd orders its arguments. Just remove the sections
of code to avoid this danger.
Andrew Deason [Mon, 26 Oct 2009 19:04:48 +0000 (14:04 -0500)]
Dec old special inodes in inode convertROtoRW
The convertROtoRW code for the inode fileserver makes copies of the
volume's special inodes, but leaves the old (RO) inodes around. If the
RO is created again, this will result in duplicate special inodes for
the same volume, which freaks out the salvager (and possibly other
things).
So IH_DEC the old RO special inodes after converting, so they go away.
Jeffrey Altman [Mon, 26 Oct 2009 14:13:00 +0000 (07:13 -0700)]
ubik_VL_GetAddrsU does not accept a VLCallBack parameter
ubik_VL_GetAddrU accepts a pointer to a uniqifier and not
a pointer to a VLCallBack structure. Remove an incorrect
cast and provide the correct parameter in src/volser/vos.c.
Andrew Deason [Fri, 23 Oct 2009 20:02:12 +0000 (15:02 -0500)]
Avoid 'salvageserver -client -showlog' segfault
Running salvageserver with the -client and -showlog options will
currently segfault, since -client does not open logFile, and -showlog
will attempt to rewind logFile on exit.
Fix this by not allowing -client and -showlog together (since it won't
work anyway, as -showlog tries to read SalvageLog), and by making
showlog() check logFile for NULL-ness.
This adds the functions cm_RankUpServers() and cm_RankServer() to
the Windows cache manager. cm_RankUpServers() steps through the
list of servers, and calls cm_RankServer(), which in turn re-ranks
the servers that are currently up based on rx peer statistics as
exposed by rx_GetLocalPeers().
cm_RankUpServers() is called every 10 minutes by the cache manager
daemon, so as to allow re-ranking of the servers.
Also added is the struct server->adminRank data structure, to
allow for the modification of the rank that the admin has set,
without but basing this modification on the admin-set rank.
Simon Wilkinson [Fri, 23 Oct 2009 15:34:33 +0000 (16:34 +0100)]
Don't return AOP_WRITEPAGE_ACTIVATE to write()
When we're called from write(), we don't have the option
of deferring the writing of a page by returning AOP_WRITEPAGE_ACTIVATE.
Instead, write() simply sees this as the output of 0x8000 bytes of data.
So, whilst we can mark a vcache as being output, we can't defer the
processing of one which is already being written (by, for example, an
earlier writepage()).
This problem only affects files which are have mmap() and write()
called in quick succession, but it does break the fsx utility.
Change-Id: I750a186de38da9873665a862f5b584a78e6979ad
Reviewed-on: http://gerrit.openafs.org/725 Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Sat, 24 Oct 2009 09:54:32 +0000 (10:54 +0100)]
Use user credentials for Linux writepage()
We have no control over the context in which the kernel calls our
writepage routine. It may be from the process which original wrote the
page, from any other process on the system which is writing and goes
over the dirty page threshold, or from the flush thread (pdflush /
flush-afs). Therefore, we cannot use the credentials of the current
process to perform the writeback. This is an issue both for afs_write
(which, in our current MM model, may need to contact the fileserver
to read missing chunks), and for DoPartialWrite (which needs to be
able to store chunks when the local cache is getting full)
This patch stores the credentials of the first process to open a file in
the vcache structure. Whenever writepage() is used to writeback pages
for this file, the cached credentials are used rather than those of the
current context.
Thanks to Marc Dionne for his work in testing and refining this patch.
Michael Meffie [Thu, 22 Oct 2009 19:51:33 +0000 (15:51 -0400)]
volser transaction object race conditions
Fix the transaction object races between VolMonitor and the
volume operation procedures which can cause the volume
server to crash.
Add a per transaction object mutex to safely set the
transaction call pointer and name. Fix VolMonitor to safely
traverse the transaction list and to access the call pointer
and last proc name while copying info to send to the vos
client. Fix the sleep thread to safely access the last proc
name.
FIXES 125479
Change-Id: I59595b93522d111b6a771d3d93c246bfc2ce65de
Reviewed-on: http://gerrit.openafs.org/718 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Thu, 22 Oct 2009 16:12:30 +0000 (11:12 -0500)]
Avoid prematurely destroying callback_rxcon
Currently, h_GetHost_r and removeAddress_r can destroy the
callback_rxcon of a host. Having a NULL callback_rxcon can cause
segfaults in code that does not properly check if a host has been
HOSTDELETED before trying to use it.
Although such code is incorrect and should be fixed, we can still avoid
a segfault in those situations by not destroying callback_rxcon until we
destroy the host itself. This just prevents destroying callback_rxcon in
h_GetHost_r and removeAddress_r, leaving it to h_TossStuff_r to destroy
when it destroys the host.
Simon Wilkinson [Fri, 23 Oct 2009 11:42:19 +0000 (12:42 +0100)]
Resolve error return issues in writepage
The writepage_sync changes get error returns wrong in a couple of places. In
particular, they return a 0 code from dopartialwrite in preference to the
length return from page_writeback
Change-Id: I34a848fed5f799aa6844e9ef0339321f91c7e59b
Reviewed-on: http://gerrit.openafs.org/721 Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Tue, 20 Oct 2009 11:38:53 +0000 (12:38 +0100)]
Refactor writepage_sync
This change refactors writepage_sync into 4 functions -
*) prepare_writeback() readies a vnode for writeback, and performs
the anti-recursion check.
*) dopartialwrite() intialises a request and performs the call to
DoPartialWrite
*) page_writeback() does the actual work of writing an AFS page into
the disk cache page
*) complete_writeback clears the writeback flag from a vnode
There should be no change to the current behaviour of writepage_sync,
these modifications are the first part of a fix to our writepage()
behaviour.
Jeffrey Altman [Thu, 22 Oct 2009 12:57:04 +0000 (08:57 -0400)]
Windows: Update Control Panel to use ShellExecuteEx instead of WinExec
WinExec is for 16-bit application compatibility. Starting with
Windows 7 it cannot be used to execute a process that requires
elevated privileges. ShellExecute[Ex] must be used instead.
Simon Wilkinson [Wed, 21 Oct 2009 23:34:50 +0000 (00:34 +0100)]
Add -Wpointer-arith to warning and checking builds
GCC doesn't catch issues with performing pointer arithmetic on
(void *)s, unless the -Wpointer-arith warning flags is supplied.
Enable it for warning and checking builds.
Reviewed-on: http://gerrit.openafs.org/708 Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Derrick Brashear [Wed, 21 Oct 2009 18:43:26 +0000 (14:43 -0400)]
rx don't exit
exiting in library code is antisocial. if rx encounters an error
which cannot be returned and would otherwise indicate a service thread
has gone away, assert.
Reviewed-on: http://gerrit.openafs.org/668 Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Simon Wilkinson [Wed, 21 Oct 2009 23:31:10 +0000 (00:31 +0100)]
Fix fall out from removal of memset casts
In places where we're doing pointer arithmetic, we must cast to (char
*), because pointer arithmetic on a void * isn't permitted by the C
standard. Sadly gcc lets us get away with it 'for convenience'.
Asanka Herath [Wed, 21 Oct 2009 19:56:12 +0000 (15:56 -0400)]
Windows: Set the ARPINSTALLLOCATION property when installing
The WiX based Windows Installer package for OpenAFS should set
the ARPINSTALLLOCATION property when installing. This property
contains the main installation directory for the product and is
necessary for Windows Logo compliance.
Make typedefs of AFS_UCRED and AFS_PROC with renaming
Make typedefs of AFS_UCRED and AFS_PROC, with a corresponding name change.
The names afs_ucred_t and afs_proc_t are chosen since these appear to be
the best available choices. The names cannot actually collide with anything
which POSIX might later introduce. For UKERNEL, the preprocessor is used
to redirect references. This seems not easily avoidable at present.
Andrew Deason [Tue, 20 Oct 2009 17:43:42 +0000 (12:43 -0500)]
HPUX: Do not sigwait on critical signals
On HPUX, it is possible for 'critical' signals such as SEGV, ABRT, etc
to be delivered to the softsig thread when we sigwait(). The current
code marks these as 'fatal' and just exit(0)s when they are received,
preventing us from getting cores in the case of a SEGV, ABRT, etc.
To work around this and keep behavior on other platforms the same, just
do not wait on 'critical' signals on HPUX in the softsig thread.
Reviewed-on: http://gerrit.openafs.org/693 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Tue, 20 Oct 2009 14:30:33 +0000 (15:30 +0100)]
Use real names for page lock operations
Call a spade a spade. Don't use macros to rename lock_page as LockPage,
and unlock_page as UnlockPage. Instead use the same names as the kernel,
which makes it a lot easier for people familiar with kernel code to read
ours.
Jeffrey Altman [Thu, 15 Oct 2009 03:43:46 +0000 (23:43 -0400)]
Windows: Modify afscreds.exe and afs_config.exe to be UAC compatible
afscreds.exe:
1. disable the drive mapping and advanced tabs.
2. on exit, remove the option to stop the service.
afs_config.exe:
1. disable the drive mapping tab
Removing this functionality by default will address some of the
problems while permitting users that wish to continue using these tools
to do so. The drive mapping tab can be re-enabled setting the registry
value to be non-zero:
Jeffrey Altman [Wed, 21 Oct 2009 13:02:04 +0000 (09:02 -0400)]
Windows: Do not permit infinite attempts to obtain a pioctl file handle
The recent change to detect sharing violations and initiate retries
permits infinite attempts. Change this to a limit of 100 attempts
and increase the sleep period between attempts from 1ms to 100ms.
window size was previously pushed to 64; push to 128. as this increases memory
use, anything further should be arguably tied to rx-using-program's
resource allocation preferences, e.g. fileserver -LL should be willing to
up this
Jeffrey Altman [Tue, 20 Oct 2009 20:16:47 +0000 (16:16 -0400)]
prevent rx peer timeout from reaching 0.0 seconds
The rx peer timeout is computed from the round trip time
calculation. It traditionally has had a lowerbound of 350ms.
The computation in rxi_ComputeRoundTripTime() was incorrect
and instead used 350ms as an upperbound.
rxi_ComputeRoundTripTime() had a second problem wherein if
the actually RTT is shorter than the resolution of the clock
then the RTT would quickly approach 0.0 seconds. Enforce
a lowerbound of 1ms if the RTT for a given packet appears
to be 0.0 seconds.
Jeffrey Altman [Tue, 20 Oct 2009 19:08:51 +0000 (15:08 -0400)]
Rx warning removal
This patch set removes many but not all of the warnings
in the rx library.
- use AFS_PTR_FMT in dpf debugging output
- fix many signed vs unsigned warnings
- on Windows, the first parameter to select() is ignored.
Passing an osi_socket produces an unnecessary warning.
- In rx_SlowReadPacket and rx_SlowWritePacket, use 'r' the
unsigned value for internal computation and 'resid' for
holding the original value. This avoids many signed vs
unsigned warnings.
Andrew Deason [Mon, 19 Oct 2009 03:48:56 +0000 (22:48 -0500)]
Avoid 'static __inline' on HPUX
'static __inline' functions on HPUX can segfault the /opt/ansic compiler
(unless we lose debugging symbols). So, just use 'static' for those
functions on HPUX. Also revert a9368a6c3dfe4435ec2ae63fff4a3325104ed9f7,
so we get a static inline function on other platforms.
Reviewed-on: http://gerrit.openafs.org/691 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Jeffrey Altman [Mon, 19 Oct 2009 22:43:44 +0000 (18:43 -0400)]
Add server prefix to bumon.xg; avoid rx_call * vs rx_connection * warning
When compiling src/bubasics/bumon.ss.c a warning would be produced
due to an rx_call* being passed into BC_Print which in its client
form requires an rx_connection*. The server implementation and client
stub each were called BC_Print because there was no server prefix
specified in bumon.xg. Add prefix 'S' and update bucoord/server.c
to match.
Simon Wilkinson [Mon, 19 Oct 2009 22:56:12 +0000 (23:56 +0100)]
Return both error codes for rxfs_fetchInit
The FetchStore refactoring was causing the result from rx_EndCall to
be discarded. This change will cause that to be returned to the caller
if rx_Error() returns 0
Simon Wilkinson [Fri, 16 Oct 2009 15:39:24 +0000 (16:39 +0100)]
Always unlock pages when returning from writepage
Writepage has a return path which returns an error with a locked
page. However, all returns that are not AOP_WRITEPAGE_ACTIVATE must
unlock their pages - using this codepath would leave a stray page lock,
which would eventually hang the machine.
The logic behind the -EIO return was also incorrect. In the Linux page
cache model, truncates simply reduce the size recorded in the inode. If
there are pages pending writeback then they may still have writepage() called
upon them - it's up to the writepage routine to discard the write
request (rather than returning an error)
Andrew Deason [Thu, 15 Oct 2009 18:15:44 +0000 (13:15 -0500)]
Fix a couple more unlink()s in vol-salvage.c
There are a couple more unlink() calls in vol-salvage.c that were using
relative paths. Fix them to use absolute paths and to log a warning if
the unlink() fails.
Reviewed-on: http://gerrit.openafs.org/684 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Asanka Herath [Mon, 19 Oct 2009 21:12:32 +0000 (17:12 -0400)]
Windows: Add a token status icon to the NIM plug-in
The Network Identity Manager plug-in for OpenAFS replaces
afscreds.exe for token management. However, unlike afscreds.exe,
the plug-in did not indicate the status of AFS tokens using an
icon in the notification area.
This patch adds a token status icon to the plug-in so that while
the plug-in is used, a familiar padlock icon in the notification
area will indicate the status of tokens as well as the OpenAFS
service.
There are four possible states indicated by the icons:
- No tokens: indicated by a padlock with a bright red 'X' beside
it.
- At least one valid token: indicated by a normal padlock.
- Service is not running: indicated by a grayed out padlock with
a black square beside it.
- Service error: indicated by a padlock broken in half.
The 'Service error' state means that the OpenAFS client service
is technically running (as reported by Windows), but is not
responding to requests.
In addition to the icon, hovering the mouse cursor over the icon
will show details about the current state (such as the list of
cells for which valid tokens exist) and the version of OpenAFS
running on the machine.
Claudio Bisegni [Sun, 18 Oct 2009 18:39:21 +0000 (20:39 +0200)]
OpenAFS Preference Pane 64bit and Symbolic Link features implemented.
Now the OpenAFS preference pane is compiled with 32 and 64 bit snowleopard support, so the preference
windows is no more restarted in 32 bit mode.
The tab for symbolic link creation has been implemented. Now the user can create and delete link.
For create a link both name and destination path must be set. AFSBackgrounder has been updated to
manager in a separate thread the link creation and destroy operation, according to the vaule of
checkbox "Enable Symbolic Link" in "Mounts" tab.
Andrew Deason [Mon, 19 Oct 2009 03:20:59 +0000 (22:20 -0500)]
Fix format warnings in tviced/state_analyzer.c
state_analyzer.c assumes subtracting two char*s will result in an
unsigned int, which can cause warnings. Lacking a portable format
specifier, just use %ld and cast to long.
Andrew Deason [Fri, 16 Oct 2009 19:30:34 +0000 (14:30 -0500)]
Log error messages in volser i/o errors
Currently, in various places in src/volser/, we log/print an error
message when some disk i/o error occurs, but we don't log what error was
returned. Log that little bit more info to make debugging easier in some
cases.
Simon Wilkinson [Fri, 16 Oct 2009 22:15:52 +0000 (23:15 +0100)]
More warning fixes for kauth
Resolve more minor warnings from the kauth directory.
*) kaux_read takes an unsigned for the number of failures
*) The COUNT_REQ macro generates an unused variable (this_op)
*) kas is missing some headers
*) Add some more prototypes to kauth_internal.h
*) Add the standard boilerplate to kauth_internal.h
*) recvfrom takes a socklen_t * as its 6th argument
This make kaprocs.c, kaauxdb.c, kas.c, klog.c, and ka-forwarder.c
warning clean. Mark them as such.
Simon Wilkinson [Fri, 16 Oct 2009 21:45:50 +0000 (22:45 +0100)]
Update warning management
This change tidies up after the recent slew of warning reduction. It
updates README.WARNINGS to reflect the current state of the tree,
disables warnings for a couple of files that are now warning clean,
and ensures that the libuafs and libafsrpc Makefiles match the state
of the rest of the tree in terms of which warnings are enabled.
Jeffrey Altman [Fri, 16 Oct 2009 19:28:04 +0000 (15:28 -0400)]
Windows: Always compute time remaining in cm_Analyze
In cm_Analyze, the time remaining for processing the request
is used to determine if a retry should requested upon return.
If the request's CM_REQ_NORETRY flag is set, cm_Analyze can
still permit a retry if a new rx connection is to be forced.
This cannot happen if the time remaining is not calculated
when the CM_REQ_NORETRY flag is set.
Jeffrey Altman [Fri, 16 Oct 2009 19:31:02 +0000 (15:31 -0400)]
Windows: mark volume status online during cm_MergeStatus
During cm_MergeStatus, if the volume status is not vl_online
mark it vl_online. The volume must be online because an
AFSFetchStatus was just processed. This change reduces the
amount of work that must be performed by the daemon thread's
volume status check.
Marc Dionne [Fri, 9 Oct 2009 01:53:03 +0000 (21:53 -0400)]
Linux: kmem_cache_create fix and cleanup
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
Andrew Deason [Thu, 15 Oct 2009 17:48:08 +0000 (13:48 -0400)]
Fix rxgen-generated warnings
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.
Derrick Brashear [Fri, 16 Oct 2009 14:44:58 +0000 (10:44 -0400)]
exit less
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
Derrick Brashear [Thu, 15 Oct 2009 23:21:54 +0000 (19:21 -0400)]
snowleopard 64 bit warning death
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.
Andrew Deason [Mon, 12 Oct 2009 02:55:05 +0000 (21:55 -0500)]
Detect and use %zu for size_t when available
Commit db949b7fade69d7eb1e38ad85d5b822c443306cb 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.
Andrew Deason [Thu, 15 Oct 2009 03:43:27 +0000 (22:43 -0500)]
Fix unitialized variable warning in cfghost.c
Initialize cellentry. It does not appear to be possible to actually hit
code that references an uninitialized cellentry, but the compiler can
still complain.
Jeffrey Altman [Wed, 14 Oct 2009 03:36:26 +0000 (23:36 -0400)]
Windows: AFSVolSync creationDate based readonly volume versioning
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.
Simon Wilkinson [Fri, 9 Oct 2009 23:30:01 +0000 (00:30 +0100)]
Fix checked builds with gcc4.2
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
Jeffrey Altman [Tue, 13 Oct 2009 01:57:52 +0000 (21:57 -0400)]
Windows: refactor afs status cloning and clone when fs fetchdata bug detected
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.
Andrew Deason [Thu, 24 Sep 2009 17:02:55 +0000 (12:02 -0500)]
Use f_bsize for ZFS afs_fsfragsize
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>
Simon Wilkinson [Fri, 9 Oct 2009 20:17:16 +0000 (21:17 +0100)]
Add public protoypes for volser
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.
Jeffrey Altman [Mon, 5 Oct 2009 18:00:50 +0000 (14:00 -0400)]
Windows: Readonly Volume Versioning for Windows Cache Manager
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.
Jeffrey Altman [Mon, 12 Oct 2009 12:28:54 +0000 (08:28 -0400)]
Windows: Correct lock error codes and log file server lockCount
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.
Jeffrey Altman [Mon, 5 Oct 2009 18:34:59 +0000 (14:34 -0400)]
Improve accuracy of Rx RTT calculation by skipping retransmitted packets
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.
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>
Jeffrey Altman [Fri, 9 Oct 2009 10:23:10 +0000 (06:23 -0400)]
Windows: Prevent fs fetchdata offset bug error from propagating to caller
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.
Marc Dionne [Fri, 9 Oct 2009 01:53:03 +0000 (21:53 -0400)]
Linux: kmem_cache_create fix and cleanup
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