Commit Graph

6607 Commits

Author SHA1 Message Date
Andrew Deason
dbe3b7b8ee 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.

Change-Id: Ifefa2cb69c5b2960b81dbee9d54e5ea8401b240e
Reviewed-on: http://gerrit.openafs.org/735
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-26 13:00:58 -07:00
matt@linuxbox.com
c95ace2c59 viced (non atomic) refcount/more-threads
Replace host-hold bitmap with reference counting, phase 1, not atomic.
Increase viced MAX_THREADS.

NOTE: This code has been tested on Centos 5.3 x86_64, on VMWare, 2 physical,
2 logical CPUs.

LICENSE BSD

Change-Id: Id62dcc786619dfd99e1a7b69a196bbaa0b45158c
Change-Id: I8ee2ec645402f02fdba0920815409b56172d393b
Reviewed-on: http://gerrit.openafs.org/268
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-26 12:08:15 -07:00
Jeffrey Altman
bf8355bd9a 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.

Change-Id: I4b12cf2d4c65f115fdef76f0a4306960b5cd0413
Reviewed-on: http://gerrit.openafs.org/733
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-26 11:55:10 -07:00
Andrew Deason
b90f424128 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.

Change-Id: I30f43ef1696f1e7e8873b9e1cc3867b4e06d1980
Reviewed-on: http://gerrit.openafs.org/734
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-26 11:54:04 -07:00
Jeffrey Altman
8edafd92c0 Updates to Jake's RTT based server ranking (Gerrit 317)
Remove check on powerStateSuspend in cm_Daemon()

Update the server Reference lists if the ranking changes.

Change-Id: Id290e0f98c616a12f4f8b1746dca58ad7a0f06ce
Reviewed-on: http://gerrit.openafs.org/729
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jacob Thebault-Spieker <summatusmentis@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-26 07:31:40 -07:00
Jacob Thebault-Spieker
d22c05e679 Adds cm_RankUpServers() and cm_RankServer()
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.

Change-Id: I118b885e179e4f84901dd9a3180ce821f194feb8
Reviewed-on: http://gerrit.openafs.org/317
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-26 07:31:21 -07:00
Simon Wilkinson
4a006f167b Clean up console message
Clean up the 'all buffers locked' console message so that it's
clear that it comes from AFS, and so it has a trailing newline.

From a bug report by Rainer Toebbicke to openafs-info

Change-Id: I3f69e57e37a91ae3e6e8822ccfe72dddc06b4359
Reviewed-on: http://gerrit.openafs.org/732
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-26 06:07:58 -07:00
Simon Wilkinson
b8e4c573a5 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>
2009-10-24 17:19:38 -07:00
Simon Wilkinson
70c8deab16 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.

FIXES 125471
Change-Id: I2900f711150fd81b2b4839bbc2bf77623bde3b64
Reviewed-on: http://gerrit.openafs.org/724
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>
2009-10-24 17:18:55 -07:00
Derrick Brashear
207882ec4f windows 1.5.66
make 1.5.66 for windows

Change-Id: I04902106c35eea2dccf6db594c496302cde3f15b
Reviewed-on: http://gerrit.openafs.org/723
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-23 14:50:49 -07:00
Derrick Brashear
944580c195 make 1.5.66 for unix
push version changes for 1.5.66

Change-Id: I5302e9aa83b4aba0081130934f0d6df0786ce43c
Reviewed-on: http://gerrit.openafs.org/722
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-23 14:45:10 -07:00
Michael Meffie
11cdb70155 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>
2009-10-23 13:48:26 -07:00
Andrew Deason
bbcfbe1a04 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.

Change-Id: I6fd5cbb924053446689c576026f9044f78ba71be
Reviewed-on: http://gerrit.openafs.org/717
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-23 13:02:57 -07:00
Simon Wilkinson
ed8d83e0f6 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>
2009-10-23 11:50:35 -07:00
Jeffrey Altman
5f720faab9 Remove warning from all calls to afsconf_GetExtendedCellInfo
Fix 'afsconf_GetExtendedCellInfo' : different types for formal
and actual parameter 5

Change-Id: I922d653a88a9d0c04ed6dbd1c9c0b3fc90719337
Reviewed-on: http://gerrit.openafs.org/715
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-23 11:19:01 -07:00
Jeffrey Altman
ecfeb5365f Windows: Notes for 1.5.66
ChangeLog description for 1.5.66 on Windows.

Reviewed-on: http://gerrit.openafs.org/720
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-23 00:17:01 -07:00
Jeffrey Altman
d0080431fa Windows: Updates to Release Notes
Add support for Windows 7 and Server 2008 R2.

Improve text in a variety of areas.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/719
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-23 00:06:38 -07:00
Simon Wilkinson
e16ce66634 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.

Reviewed-on: http://gerrit.openafs.org/712
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-22 11:17:17 -07:00
Jeffrey Altman
234acbbb84 Windows: no longer use WinExec in afscreds
WinExec is a compatibility interface for 16-bit applications.
It is not compatible with Windows 7.  Replace it with ShellExecuteEx.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/714
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-22 07:30:23 -07:00
Derrick Brashear
95cddea6da pthread pid casting
in rx, we use pthread_self (which can return a pointer) as a pid;
in order to not cause problems, cast it as we do elsewhere

Reviewed-on: http://gerrit.openafs.org/703
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-22 07:20:09 -07:00
Jeffrey Altman
cd2d4ceadc rx lwp include assert.h where AFS_NT40_ENV builds can see it
Reviewed-on: http://gerrit.openafs.org/713
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-22 07:11:35 -07:00
Jeffrey Altman
196b2a2cb3 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.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/711
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-22 06:18:40 -07:00
Derrick Brashear
a3bad94d17 remove spurious log in icl
fstrace should not log sets to the kernel message log

Reviewed-on: http://gerrit.openafs.org/710
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-22 06:13:50 -07:00
Simon Wilkinson
e83d382d20 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>
2009-10-21 19:54:32 -07:00
Derrick Brashear
5f688ff4bd 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>
2009-10-21 16:49:41 -07:00
Simon Wilkinson
304f21cb70 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'.

Reinstate the necessary casts.

Reviewed-on: http://gerrit.openafs.org/707
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-21 16:35:02 -07:00
Jeffrey Altman
a8a9c3c0f2 Windows: Update MSI installer properties
Reference useful web pages such as docs.openafs.org for help,
www.openafs.org/windows.html for upgrade info, etc.

Reviewed-on: http://gerrit.openafs.org/706
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-21 15:53:14 -07:00
Jeffrey Altman
32b2f18628 Windows: ports in the cache manager are stored in network byte order
When assigning ports from SRV/AFSDB lookups, convert to network
byte order when assigning them to cm_server objects.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/705
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-21 15:44:31 -07:00
Asanka Herath
2a9263a451 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.

Reviewed-on: http://gerrit.openafs.org/704
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-21 15:19:41 -07:00
Simon Wilkinson
b9eaf43bbe Don't cast the pointer past to memset
memset() takes a void * as it's first argument. Don't explicitly cast
what we're passing in to (char *), as this may mask other errors.

Reviewed-on: http://gerrit.openafs.org/701
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-21 11:34:12 -07:00
matt@linuxbox.com
5d5d180716 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.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/645
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-21 11:08:15 -07:00
Andrew Deason
bf9c51a4e1 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>
2009-10-21 11:05:22 -07:00
Jeffrey Altman
4141bf4084 Windows: Add registry entries for rx_SetMinPeerTimeout, rx_SetMaxRecvWindow, rx_SetMaxSendWindow
Permit the new rx settings to be configured via the registry and
set at startup.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/700
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-21 11:03:43 -07:00
Jeffrey Altman
c4263054a0 Add rx_SetMinPeerTimeout and rx_GetMinPeerTimeout
Permit the minimum peer timeout value to be adjusted at runtime.
The default remains 350ms.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/699
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-21 10:58:45 -07:00
Simon Wilkinson
54d9c6cb34 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.

Reviewed-on: http://gerrit.openafs.org/692
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-21 10:52:15 -07:00
Jeffrey Altman
040712a744 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:

  {HKCU,HKLM}\Software\OpenAFS\Client DWORD "ShowMountTab"

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/663
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-21 10:50:58 -07:00
Jeffrey Altman
ee7399fa37 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.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/697
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-21 07:36:31 -07:00
Jeffrey Altman
2e9dc9ee20 Windows: digital signatures are required for resource dlls
Windows 7 logo requirements state that all dlls including
resource only dlls be digitally signed.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/698
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-21 06:24:22 -07:00
Jeffrey Altman
7673b2450c Windows: Adjust error return values
Do not return STATUS_TIMEOUT to the smb redirector, doing so
results in an undesireable disconnect.

Map RXKADNOAUTH to STATUS_CLOCK_SKEW as that is the most
frequent cause of rx level authorization failures.

Map CM_ERROR_UNKNOWN to access denied since there is no
better error choice.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/661
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-20 21:14:24 -07:00
Derrick Brashear
310cec9933 rx window size increase
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

Reviewed-on: http://gerrit.openafs.org/549
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-20 15:05:37 -07:00
Derrick Brashear
b8e3de897a afscp warnings cleanup
make the copy of afscp in src/tests compile with fewer warnings
(and provide needed prototype for RXAFSCB_ExecuteRequest)

Reviewed-on: http://gerrit.openafs.org/694
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-20 15:02:35 -07:00
Jeffrey Altman
cc112e7a59 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.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/696
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-20 13:54:19 -07:00
Jeffrey Altman
e7e057346f 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.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/695
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-20 13:53:20 -07:00
Jeffrey Altman
c188acf396 Windows: AFS_PTR_FMT is just 'p'
The printf format specification for a pointer of any size is
just 'p'.  The 'I' is only to be used for [duox].

Reviewed-on: http://gerrit.openafs.org/690
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-10-20 12:18:46 -07:00
Andrew Deason
840e4d2123 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 a9368a6c3d,
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>
2009-10-20 10:27:57 -07:00
Simon Wilkinson
a26f10a01a Remove pageoff macro
The pageoff macro is now unused. Remove it.

Reviewed-on: http://gerrit.openafs.org/689
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-20 05:58:38 -07:00
Jeffrey Altman
bd011aeee7 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.

Reviewed-on: http://gerrit.openafs.org/686
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-10-19 16:42:58 -07:00
Simon Wilkinson
3eec9fa770 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

Reviewed-on: http://gerrit.openafs.org/687
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-19 16:40:25 -07:00
Simon Wilkinson
6f2ce4cdc2 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)

Reviewed-on: http://gerrit.openafs.org/685
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-10-19 16:39:57 -07:00
Andrew Deason
ebf6516db2 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>
2009-10-19 14:48:20 -07:00