Commit Graph

6251 Commits

Author SHA1 Message Date
Claudio Bisegni
d9d3902894 OS Preference pane clean for final version
Has been removed from license file the reference to menucracker for hack NSMenuExtra, that is no more needed.

Reviewed-on: http://gerrit.openafs.org/547
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-29 01:14:40 -07:00
Jeffrey Altman
45e98a4455 Windows: cm_GetBuffer does not need to contact file server when extended a file
If cm_GetBuffer is being called in order to obtain a buffer to store
data beyond the end of the existing file as known to the file server
there is no reason to contact the file server.  Instead use the cached
status info in order to allocate a new buffer zero initialized.

This logic avoids triggering the FetchData bug in all file servers
older than 1.4.12 and 1.5.65 in which the file server returns a
large negative number (filesize - requested_offset) when a FetchData
is received where the requested_offset is larger than the filesize.
It also avoids unnecessary work.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/542
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-09-28 10:30:27 -07:00
Jeffrey Altman
50e98677ca Windows: Directories do not have a default stream
When enumerating streams for objects, do not offer a default stream
for directory objects (including mount points).

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/544
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-09-28 10:30:04 -07:00
Andrew Deason
fee0efedc1 Formatting typo in vos_setfields manpage
The POD formatting code for bold is B, not b.

Reviewed-on: http://gerrit.openafs.org/546
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 08:25:25 -07:00
Simon Wilkinson
1580434163 Don't try to print the thread ID
pthread_t is defined as being opaque - there's no way to portably
print it on a way that makes sense on all platforms. Remove this output.

Reviewed-on: http://gerrit.openafs.org/541
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 08:12:32 -07:00
Simon Wilkinson
4f65bec3fc Fix warnings in new dumptag code
3f2dd80697 contained a number of
new warnings. This patch fixes them.

It also adds the AFS_UNUSED_FUNCTION macro which can be used to
portably mark functions as unused.

Reviewed-on: http://gerrit.openafs.org/543
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 07:52:35 -07:00
Simon Wilkinson
6d628bbb7c Squash more viced warnings
Get rid of more warnings in viced
  - Cast fids that we pass into the Dir package to avoid type warnings
  - Add ()s to a && b || c, to clarify its meaning - (a && b ) || c
  - Don't use %ld to print ints
  - Prototype another function from the host package

Reviewed-on: http://gerrit.openafs.org/539
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 07:10:46 -07:00
Derrick Brashear
e287f72e4e irix UCRED is already a struct
just like everywhere else. move the one last
struct UCRED to UCRED like everywhere else

Reviewed-on: http://gerrit.openafs.org/538
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 06:56:01 -07:00
Simon Wilkinson
0ec76649b6 Minimise crref() and add a fastpath for cache hits
Reduce the number of times we cref() unnecessarily, and add a fastpath
at the beginning of readpage() to handle the cache hit case.

Refactor the Linux implementation of afs_open to provide a directly
callable version that bypasses the OSI layer.

Add a non-blocking variant of ObtainReadLock()

Reviewed-on: http://gerrit.openafs.org/534
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 06:43:37 -07:00
Derrick Brashear
be34175e0f macos 10.6 warning fixes
due to 32/64 and a newer compiler, macos 10.6 finds more warnings.
these are fixes for some of them.

Reviewed-on: http://gerrit.openafs.org/533
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 06:39:20 -07:00
Derrick Brashear
f63a8662a7 kauth should use static_inline for irix et al
"static inline" doesn't work on various still-supported systems.
use the workaround macro

Reviewed-on: http://gerrit.openafs.org/532
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 05:11:50 -07:00
Simon Wilkinson
efe8258a92 Use configured compiler for libuafs on Darwin
There's no need to hardcode 'cc' for libuafs builds on Darwin. Let
the user specify the compiler to use, in the same way as for the
rest of the tree.

Reviewed-on: http://gerrit.openafs.org/531
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 05:00:26 -07:00
Simon Wilkinson
6d51ebd6c8 Add support for warning checked builds
This patch adds a '--enable-checking' configuration option. When this
option is supplied, and gcc is in use, the compiler will treat any
warnings as errors. This will hopefully help stop new warnings from
creeping into the tree.

In order to still be able to build, all of the currently existing
warnings are accepted (these are documented in README.WARNINGS). With
this set of warning inhibitions, the tree is known to build on 32bit
Leopard - other systems may vary. Warning inhibition may be disabled
by supplying --enable-checking=all - in this case the tree will
definitely not build!

If --enabled-checking is not specified, the existing compilation
behaviour is maintained, so there is no user-visible change.

Gcc 4.2, or later, is required to use the pragma sets contained within
this patch. Again, they are not visible unless --enable-checking is
given.

Reviewed-on: http://gerrit.openafs.org/526
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 05:00:04 -07:00
Derrick Brashear
5afd2c3469 conditionalize stdint.h inclusion in lwp
Irix has no stdint.h; wrap in ifdefs so we don't include
when we don't have it.

Reviewed-on: http://gerrit.openafs.org/530
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 04:55:24 -07:00
Derrick Brashear
5d3400f4e1 afsmonitor warnings fix
again, add missing format strings to *printf to
eliminate warnings

Reviewed-on: http://gerrit.openafs.org/529
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 04:55:11 -07:00
Derrick Brashear
9ee76d8a8f kill cnvldb warnings
previously we used fprintf without a format string in some cases. now we don't

Reviewed-on: http://gerrit.openafs.org/528
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 04:36:13 -07:00
Hartmut Reuter
3f2dd80697 Implementation of new dump tag and length standard
The implementation follows the specification from October 2007.

All old tags are accecpted as before.
New tags 0x06-0x60 (capital letters) are followed by a 1 byte length
field which may contain directly the length (up to 127) or the length
of the then following length field (max 8) ored with 0x80.
New tags 0x61-0x77a are directly followed by 4 bytes building a 32bit
integer.
0x7b-0xf are single-byte tags, 0x7e meaning next tag is critical.

On this basis unknown tags can be skipped unless they were marked
critical. In this case the restore is aborted.

in dump.h tags following the new standard are marked by an asterisk

Last update: added parameter types for HandleUnknownTag.

Reviewed-on: http://gerrit.openafs.org/191
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 02:59:14 -07:00
Simon Wilkinson
9a82cdae42 Avoid redefinition errors for AFS_NONFSTRANS
Some parts of the build provide -DAFS_NONFSTRANS on the command line.
This causes an error when the 'param' file redefines it. Fix this
by #undef ing the token before defining it.

Reviewed-on: http://gerrit.openafs.org/510
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 02:57:44 -07:00
Marc Dionne
d7b00d5f19 Use intptr_t and uintptr_t for integer/pointer conversions
Use intptr_t and uintptr_t casts to appease the compiler when
values are converted between 32-bit integers and pointers.
This generates many warnings (currently ~170 on linux amd64)
when pointers are 64-bit.

These types are normally defined in stdint.h, and get defined
by autoconf if that's not the case.

In a few places, NULL is simply replaced with 0 where compared
with an integer.

Reviewed-on: http://gerrit.openafs.org/474
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 02:40:48 -07:00
Simon Wilkinson
01aa705514 Make butc logging use va_args
Change the logging functions in butc so that they use va_args. This
means that we can prototype the logging functions, and kill a bunch
more compiler warnings.

Reviewed-on: http://gerrit.openafs.org/509
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:59:25 -07:00
Simon Wilkinson
a53732ef5f Miscellaneous warning cleanup
Assorted warning cleanup, that it didn't seem to make sense having one
patch per file for.

This patch
    - Adds some casting for syscall pointers
    - ANSIfies SRXAFSCB_GetDE in fsprobe
    - Loads sys/ioctl.h on some more platforms in usd
    - Includes some missing header files
    - Removes unused variables
    - Makes it clear that VIsSalvager does handle all enumerated types
    - Adds some more prototypes

Reviewed-on: http://gerrit.openafs.org/508
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:58:16 -07:00
Simon Wilkinson
6dcf37d810 Remove some more warnings from rx
The mtu variable in InitPeerParams is in the wrong place. It's only
required when the (never used) AFS_USERSPACE_IP_ADDR code is enabled.
Move the variable to the appropriate location, and indent the if and
endif directives in this section to try to make it clearer what the
control flow is (my brain hurt)

Remove the unused rx_pthread_n_event_wakeups variable

ANSIfy rxi_syscall - we can't prototype it yet, sadly.

Reviewed-on: http://gerrit.openafs.org/503
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:36:20 -07:00
Simon Wilkinson
9d42c45e65 Warning fixes for afs_fetchstore
The recent afs_fetchstore refactoring added a load of warnings. Remove
them.

Reviewed-on: http://gerrit.openafs.org/502
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:36:06 -07:00
Simon Wilkinson
4c1c92c0bd Fix signed/unsigned warnings in XDR
Our xdr routines use the same native functions to read signed, and
unsigned integers from the wire. This leads to compiler warnings when
the unsigned versions of these functions are called. This patch always
casts to (afs_int32 *) when calling PUT_INT32 and GET_INT32, to resolve
these warnings

Reviewed-on: http://gerrit.openafs.org/507
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:35:51 -07:00
Simon Wilkinson
4bbc4a5a1d Tidy up unlog
Remove warnings from the unlog code
   - Prototype internal functions, and make them static
   - Define variables appropriately
   - Remove uneccesary local function defintions

Reviewed-on: http://gerrit.openafs.org/505
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:35:38 -07:00
Simon Wilkinson
ace95ffa63 Remove warnings in the update client and server
rx_Read and rx_Write take a datablock which is a char *, rather than a
void *. Cast appropriately.

Reviewed-on: http://gerrit.openafs.org/506
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:35:24 -07:00
Simon Wilkinson
fabe41d644 Squish some warnings in ubik/
Remove some more warnings from the ubik/ directory
   - Remove a dangling else case from an if statement
   - Prototype ubik_dprint_25
   - Don't do (a || b()) - it's horrible, and causes warnings!
     Replace with if (!a) b();

Reviewed-on: http://gerrit.openafs.org/504
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:35:08 -07:00
Simon Wilkinson
e14e5aa0cf Relax compiler specification on Darwin 9 and 10
Commit 1992b702f6 made it possible to
relax the compiler choice on a per architecture basis. That commit
allowed the user to specify their compiler of choice on all Linux
systems, but hardcoded 'cc' everywhere else.

This patch permits Darwin 9 and 10 users to also override the default
compiler for user space builds.

Reviewed-on: http://gerrit.openafs.org/501
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-28 01:13:15 -07:00
Marc Dionne
291d31e55f fetchOps: fix more() prototype
Adjust the prototype in the fetchOps structure to match the recent
change to rxfs_fetchMore().

Reviewed-on: http://gerrit.openafs.org/499
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-26 17:43:10 -07:00
Derrick Brashear
529d487d65 viced cap fetchdata len to avoid negative
when trying to read from a short or zero length file,
it's possible for sanity checking to knock the length below
zero. set a floor at zero.

Reviewed-on: http://gerrit.openafs.org/494
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-26 03:39:47 -07:00
Simon Wilkinson
bc6559d62c Attempt to fix CForeign moredata behaviour
The fetchstore patches changed the behaviour of the multiple chunk handling
that's used in FetchData when the vnode's CForeign bit is set. In the original
code, the data would be read as (length, payload) chunks. The new code does
(length, length, payload), which corrupts the incoming data.

This patch restores the original control flow.

Reviewed-on: http://gerrit.openafs.org/498
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-26 02:16:04 -07:00
Derrick Brashear
5d765426e5 h_GetHost_r cleanup cases
avoid potentially leaking a cb_in or a capabilities blob;
use a common exit function and free when these were left set.

Reviewed-on: http://gerrit.openafs.org/496
Tested-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-09-25 09:51:54 -07:00
Claudio Bisegni
ce9da0d76c AFSPreference Pane, has changed the content of launchd xml control file for AFSBackgrounder
has been used <key>Program</key> instead of <key>ProgramArgument</key>

Reviewed-on: http://gerrit.openafs.org/495
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-25 00:38:57 -07:00
Simon Wilkinson
f6f9ee5402 Fix CacheFetchProc in cases where the fileserver hates us
In some situations, the fileserver returns a large negative number
as the length in an FetchData64 call. The old FetchProc code used an int32
to hold this number, and checked length > 0 before attempting to read more
data. The new code uses a uint32, and does while (length), which causes the
cache manage to loop until RX aborts the connection.

This patch restores the old behaviour. length becomes a signed int once more
(and the original 32 bit length from the wire is used, rather than truncating
the 64 bit value), and the conditional checks for > 0.

Reviewed-on: http://gerrit.openafs.org/493
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-24 23:05:39 -07:00
Andrew Deason
29ee678f3a Unlink correct files in salvager
Fallout from 0ac956b3384842b3c60e72bde78a4baf58a5877f; a couple of
unlink() calls were not updated to use the absolute path. Update them,
and log errors from unlink(), since otherwise it is difficult to tell
that anything is going wrong.

Reviewed-on: http://gerrit.openafs.org/479
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-24 08:16:46 -07:00
Andrew Deason
07b1dc861b Solaris: Default to fs_pathconf in afs_pathconf
Instead of returning EINVAL in afs_pathconf when we don't recognize the
pathconf command, return the result of fs_pathconf. fs_pathconf provides
sensible defaults or correctly represents a filesystem not implementing
a particular pathconf cmd; all in-tree (Open)Solaris filesystems call
fs_pathconf for unimplemented commands. Returning EINVAL allegedly
represents that the fileystem does not support pathconf at all.

Also, account for OpenSolaris adding another parameter to
pathconf-related calls.

Reviewed-on: http://gerrit.openafs.org/488
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-23 16:53:05 -07:00
Simon Wilkinson
b56a794f8d Refactor the cache bypass determination code
The code which determines whether the cache can be bypassed occurs in
multiple locations in this file. Make a single static inline function
that can do this, and use it.

Reviewed-on: http://gerrit.openafs.org/489
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2009-09-23 16:52:14 -07:00
Andrew Deason
3567441f92 Remove one more AFS_UCRED struct
After 8a8244dd35, AFS_UCRED is no longer
assumed to be a struct. Fix one instance that still declares it as a
struct.

Reviewed-on: http://gerrit.openafs.org/487
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-22 17:15:00 -07:00
Simon Wilkinson
7edc6694e7 Whitespace cleanup (sorry)
The cache bypass code changed the indentation of afs_linux_readpage so
that pullups from 1.4 no longer works.

This patch simply restores the original (correct) indentation. Sorry for
a whitespace change, but this will make things much easier going
forwards.

Reviewed-on: http://gerrit.openafs.org/486
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-22 10:25:00 -07:00
Derrick Brashear
f3c3e4da18 DAFS protocol state diagrams
update DAFS protocol state diagrams

FIXES 124990

Reviewed-on: http://gerrit.openafs.org/485
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-22 01:53:02 -07:00
Andrew Deason
40b18318e4 Implement _PC_FILESIZEBITS for solaris pathconf
Using recent NFS clients and servers with the translator under Solaris
causes AFS to be queried for the _PC_FILESIZEBITS pathconf value. Right
now we don't implement it and return EINVAL, causing at least some
modern NFS clients to be unable to mount AFS via the translator on at
least some modern NFS servers.

So, return _PC_FILESIZEBITS as either 32 or 64, depending on whether we
are a 64-bit client or not.

Reviewed-on: http://gerrit.openafs.org/481
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-21 15:32:53 -07:00
Andrew Deason
b7ae31a748 Avoid salvager vol header read assert
When we read the volume header in order to write it back with a modified
inUse while salvaging, we were aborting if we couldn't read the header.
Since we can fail to read the header data if the volume header file
isn't associated with any data (and will be deleted by the salvager),
don't abort. Do still abort if we can't write the data back, since if
the data can be read but not written, other programs may think that the
volume is not being salvaged.

Reviewed-on: http://gerrit.openafs.org/480
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-21 15:32:14 -07:00
Andrew Deason
759c756b0f DAFS: Put back volumes we get in FSSYNC handlers
fssync-server.c has a few issues with not properly VPutVolume_r'ing
volumes that were VGetVolume_r'd. The most important of these was that
the handler for FSYNC_VOL_MOVE can put back a volume it did not get,
when DAFS is enabled.

Fix that, and another erroneous edge case in the FSYNC_VOL_QUERY_HDR
handler when DAFS is not enabled.

Reviewed-on: http://gerrit.openafs.org/477
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-21 09:44:37 -07:00
Derrick Brashear
1542d943df make 1.5.64 for unix
update version strings to 1.5.64

Reviewed-on: http://gerrit.openafs.org/478
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-21 09:36:26 -07:00
Felix Frank
e646a3e4dc Use the padd op.
When the padd operation was added, the change that makes actual use
of it got lost somewhere along the line. Fixed now.

Originally introduction of the padd op:
6220ede6a9

Reviewed-on: http://gerrit.openafs.org/471
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2009-09-21 09:30:28 -07:00
Jeffrey Altman
4fd7101577 Windows version number 1.5.64
Reviewed-on: http://gerrit.openafs.org/476
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-09-21 09:14:39 -07:00
Jeffrey Altman
91d9ca106d Windows: 1.5.64 updates for Windows Notes
LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/475
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-09-21 09:14:21 -07:00
Jeffrey Altman
10706d8208 Windows: uninitialized variable in cm_GetBuffer
Initialize code and code1 to zero.  Otherwise, a non-zero
value on the stack can result in an incorrect error value
being passed to cm_Analyze().

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/473
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-09-20 08:09:34 -07:00
Jeffrey Altman
65d1d94634 Windows: Protect against null serverp in cm_Analyze
If cm_Analyze is called with both 'serverp' and 'connp' set
to NULL and an RX error is provided, a null pointer dereference
will occur.  Test for non-NULL serverp before dereferencing

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/472
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
2009-09-20 08:09:17 -07:00
Jeffrey Altman
427b27a87f Windows: Do not mark server down due to Store / Fetch Data protocol error
When performing a StoreData or FetchData operation there are
several data validation checks performed to ensure that the
lengths of data obtained with rx_Write and rx_Read are consistent
with the RXAFS_FetchData and RXAFS_StoreData protocol operations.
When an inconsistency is detected the cache manager terminates the
call and returns an error to the caller which is passed to cm_Analyze().
The cache manager was returning -1 as the error code which is
equivalent to RX_CALL_DEAD which in turn will result in the server
being marked down.

This commit makes the following changes:

 . add trace logging to permit monitoring this case

 . instead of returning -1 return either RX_PROTOCOL_ERROR or RX_EOF
   depending on the situation

 . in cm_Analyze do not mark a server as down for rx errors other
   than RX_CALL_DEAD.  Instead, force a new connection and retry
   until the request timeout limit is reached.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/470
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
2009-09-20 05:47:25 -07:00