openafs.git
14 years agoBuild afsio on Windows; remove many warnings
Jeffrey Altman [Tue, 6 Oct 2009 15:03:27 +0000]
Build afsio on Windows; remove many warnings

With this commit afsio builds on Windows.   It will not work
until the VIOC_FS_CMD OSD extension is implemented in the
Windows Cache Manager.

Required changes:

  * Export ugen_ClientInit from libafsauthent.dll

  * Fix util_GetInt64 and util_GetUInt64 to return afs_int32
    instead of afs_int64 since it is just returning success
    or error

  * Define VIOC_FS_CMD for Windows even though it isn't implemented

LICENSE BSD

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

14 years agoMake namei convertROtoRW'd volumes usable
Andrew Deason [Wed, 7 Oct 2009 17:14:11 +0000]
Make namei convertROtoRW'd volumes usable

Right now, if you convertROtoRW a volume on namei, the converted volume
appears to need a salvage before it is usable, and the header of the old
(now empty) RO volume is kept around. Fix this:

 -- Set inUse = 0 on the converted volume, so the fileserver will be
    able to attach the volume when we give it back

 -- Unlink the RO header file, instead of trying to unlink the
    VI_VOLINFO file twice

 -- Log the actual error code (errno) in the error message for the last
    unlink

Reviewed-on: http://gerrit.openafs.org/591
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoUse page_offset() on Linux
Simon Wilkinson [Fri, 2 Oct 2009 22:15:26 +0000]
Use page_offset() on Linux

Since time began, Linux has provided page_offset() to turn a
page index into an offset into the corresponding file. Make us use
this everywhere we calculate a page offset, rather than doing our
own maths.

Reviewed-on: http://gerrit.openafs.org/581
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoWindows: fs listacl -cmd
Jeffrey Altman [Tue, 6 Oct 2009 13:33:45 +0000]
Windows: fs listacl -cmd

Add the new functionality from the Unix fs command to Windows.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/585
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Hartmut Reuter <reuter@rzg.mpg.de>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agodocumentation for "fs listacl -cmd"
Jeffrey Altman [Tue, 6 Oct 2009 13:48:57 +0000]
documentation for "fs listacl -cmd"

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/586
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Hartmut Reuter <reuter@rzg.mpg.de>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoafs_FindService should handle iana portnames
Derrick Brashear [Mon, 5 Oct 2009 16:45:26 +0000]
afs_FindService should handle iana portnames

right now we compare against /etc/services, and a hardcoded array.
but since there's no guarantee /etc/services will be useful, this
can mean inconsistent behavior. hardcode the iana names in the table,
and take the internal structure used private at the same time.

LICENSE BSD

Reviewed-on: http://gerrit.openafs.org/577
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>

14 years agoNew option '-cmd' for 'fs listacl'
Hartmut Reuter [Tue, 6 Oct 2009 07:10:45 +0000]
New option '-cmd' for 'fs listacl'

prints 'fs setacl' commands necessary to create the current
ACLs. This is useful for backup scripts using TSM (or others)
to save the ACLs into a file to allow for later restore.

Reviewed-on: http://gerrit.openafs.org/556
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoUse standard Linux paths for all headers
Simon Wilkinson [Fri, 2 Oct 2009 22:43:46 +0000]
Use standard Linux paths for all headers

As we're being built by the standard Linux module build system, we
can use the normal #include <linux/blah.h> convention from including
kernel headers.

Reviewed-on: http://gerrit.openafs.org/582
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoOSX Launchd Startup Manage with Preference Pane
Claudio Bisegni [Mon, 5 Oct 2009 11:42:27 +0000]
OSX Launchd Startup Manage  with Preference Pane

OpenAFS preference pane has been updated to manage the new launchd startup mode. Has been delete the custom startup and shutdown file now is user the /Library/OpenAFS/Tools/root.client/usr/vice/etc/afs.rc

OpenAFS.postinstall has been modified to remove the old existing /Library/StartupItems/OpenAFS directory
OpenAFS.pre_upgrade has been modified to shutdown daemon, if it is runnig, and remove the old preference pane to permit the one to be installed

Reviewed-on: http://gerrit.openafs.org/578
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoafsio is a command to pipe data into or out of afs files
Hartmut Reuter [Wed, 30 Sep 2009 08:06:14 +0000]
afsio is a command to pipe data into or out of afs files

afsio bypasses the cache manager to achieve higher throughput.
However, it uses the cache manager to stat or create files over the
AFS path.

Besides 'apropos' and 'help' there are 3 subcommands:

'write' pipes data into a new or empty AFS file

'append' pipes data at the end of an existing AFS file

'read' pipes data out of an AFS file

for 'write' there is an option '-md5' which calculates on the fly
the md5 chscksum and prints it to stdout. (Useful when you create
long time archives to keep it separately for later ...)

for 'write' there is also an option '-synthesize <size>' to do just
performance tests. It creates a file which contains at the
begin of each 4 KB block the offset printed in ascii.

for all subcommands exists a '-verbose' option which writes to
stderr data rate and timing information.

All three subcommands may also be used prefixed with 'fid' accepting
then a Fid instead of an AFS path. With the 'fid' prefix also a '-cell'
option is allowed.

Reviewed-on: http://gerrit.openafs.org/555
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoLinux: 2.6.32 - Adapt to writeback changes
Marc Dionne [Thu, 17 Sep 2009 20:57:52 +0000]
Linux: 2.6.32 - Adapt to writeback changes

Adapt to the writeback changes in kernel 2.6.32
- Since we define our own backing_dev, it needs to be registered with
the writeback code and attached to the super_block.  Otherwise it
might get ignored when writeback is needed.
- Each backing_dev now gets its own kernel thread.  The name of the
thread is based on the registered name - the openafs one will appear
as "flush-afs".

Reviewed-on: http://gerrit.openafs.org/574
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agorxfs_storePadd: return 0 on success
Marc Dionne [Sun, 4 Oct 2009 17:40:10 +0000]
rxfs_storePadd: return 0 on success

On success, storePadd should return 0, not the number of bytes
written by the last rx_Write call.  In some cases this return
value would leak all the way out to the close() system call,
causing it to fail.

Reviewed-on: http://gerrit.openafs.org/573
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoRefactor linux readpage support
Simon Wilkinson [Fri, 2 Oct 2009 13:34:50 +0000]
Refactor linux readpage support

The readpage call on Linux was becoming horribly complex.

This patch refactors it into three main components - a function which
fills a locked page (without unlocking it), a function which triggers
a cache bypass operation on a page, and a function which does
conditional prefetch, based on the properties of the page that was just
read.

In addition, we abstract out the cache bypass code further, and provide
static inline variants which are simply stubbed out when cache bypass is
disabled.

Reviewed-on: http://gerrit.openafs.org/569
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoRationalise some #ifdefs in the LINUX osi layer
Simon Wilkinson [Fri, 2 Oct 2009 12:43:01 +0000]
Rationalise some #ifdefs in the LINUX osi layer

Introduce osi_compat.h, a place to hide compatibility #ifdefs. Make
a start on using this by purging #ifdefs from osi_vnodeops, and pushing
changes into inline compatibility functions.

The general idea here is to create a single location where we can do our
multiple version compatibility magic, and by doing so reduce the
complexity of the rest of the code. The approach is that where the
kernel introduces a new interface, we should switch to using it in the
rest of the code, and add a compatibility function (in osi_compat.h)
which implements the new interface in terms of the old one, suitably
protected by #ifdefs.

Where an interface changes signature, but not name, we should implement
an afs_<blah> version of the function which has the signature of the
newest version, and within that call out to the real kernel versions,
mapping between the different parameters as appropriate.

Reviewed-on: http://gerrit.openafs.org/568
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoRemove pre-Linux 2.6 support
Simon Wilkinson [Fri, 2 Oct 2009 10:51:52 +0000]
Remove pre-Linux 2.6 support

This change removes support for kernels before Linux 2.6.0 from
src/afs/LINUX. Older kernels should be supported by the src/afs/LINUX24
code.

Reviewed-on: http://gerrit.openafs.org/567
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agocreate LINUX24 directory
Derrick Brashear [Thu, 1 Oct 2009 20:09:17 +0000]
create LINUX24 directory

shadow src/afs/LINUX into .../LINUX24, removing 2.6 code from it
same for rx/LINUX

cheat and simply modify MKAFS_OSTYPE in MakefileProto.LINUX.in

Reviewed-on: http://gerrit.openafs.org/565
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoThere can be only one ... MD5
Simon Wilkinson [Fri, 2 Oct 2009 17:36:24 +0000]
There can be only one ... MD5

The cache manager has two implementations of md5 - one in afs_md5.c
(used by afs_NewCell) and one in afs_util.c - used by Linux's MD5-inode
code.

Remove the one in afs_util.c in favour of using the common
implementation in afs_md5.c

Reviewed-on: http://gerrit.openafs.org/572
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agolaunchdaemon support for MacOS
Derrick Brashear [Thu, 1 Oct 2009 08:34:09 +0000]
launchdaemon support for MacOS

the changes needed to switch from a StartupItem to a LaunchDaemon for
the MacOS OpenAFS client

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

14 years agoRemove page past end of file optimisations
Simon Wilkinson [Thu, 1 Oct 2009 20:27:11 +0000]
Remove page past end of file optimisations

The kernel checks itself for read() calls which attempt to fetch
pages past the current file extents. Remove ours.

Reviewed-on: http://gerrit.openafs.org/566
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoDAFS: Wait until preattach to service FSSYNC reqs
Andrew Deason [Wed, 30 Sep 2009 21:50:07 +0000]
DAFS: Wait until preattach to service FSSYNC reqs

Make FSYNC_sync wait until VInit == 2 before serving FSSYNC requests.
This follows the existing similar behavior of waiting until after volume
preattachment is completed before serving RPC requests in DAFS. This
prevents FSSYNC clients from being denied requests simply due to a
volume not having been preattached yet, at the small cost of delaying
how soon we can serve FSSYNC requests.

This does not alter the behavior of non-DAFS, which still only waits
until VInit == 1, since volume attachment takes significantly longer
than preattachment.

Reviewed-on: http://gerrit.openafs.org/563
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoDAFS: Avoid volserver segfault in GetVolInfo
Andrew Deason [Wed, 30 Sep 2009 21:42:46 +0000]
DAFS: Avoid volserver segfault in GetVolInfo

It is possible for GetVolObject to return success, but result in a NULL
fs_tv. In particular, when the fileserver responds with FSYNC_WRONG_PART
or FSYNC_UNKNOWN_VOLID. It is possible, though difficult, for the
fileserver to respond with FSYNC_UNKNOWN_VOLID if the requested volume
hasn't been preattached on the fileserver yet.

So, in GetVolInfo, also check fs_tv, so we don't try to dereference it
later.

Reviewed-on: http://gerrit.openafs.org/562
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoWindows version 1.5.65 openafs-devel-1_5_65
Jeffrey Altman [Wed, 30 Sep 2009 19:43:45 +0000]
Windows version 1.5.65

Reviewed-on: http://gerrit.openafs.org/560
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoopenafs 1.5.65
Derrick Brashear [Wed, 30 Sep 2009 21:28:36 +0000]
openafs 1.5.65

make openafs 1.5.65 for unix

Reviewed-on: http://gerrit.openafs.org/561
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoWindows: change log for 1.5.65
Jeffrey Altman [Wed, 30 Sep 2009 19:42:16 +0000]
Windows: change log for 1.5.65

LICENSE: MIT
Reviewed-on: http://gerrit.openafs.org/559
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoAdd configure test for pagevec_lru_add_file
Simon Wilkinson [Wed, 30 Sep 2009 09:44:51 +0000]
Add configure test for pagevec_lru_add_file

pagevec_lru_add_file isn't available on all Linux kernels.
Fallback to using pagevec_lru_add where necessary.

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

14 years agomake VOL_STATE_VLRU_ADD exclusive
Tom Keiser [Tue, 29 Sep 2009 14:25:55 +0000]
make VOL_STATE_VLRU_ADD exclusive

VLRU_Add_r() places a volume into VOL_STATE_VLRU_ADD before
calling VLRU_Wait_r(), which drops VOL_LOCK while waiting
for the required VLRU queue to quiesce.  Thus, it is essential
that state VOL_STATE_VLRU_ADD be marked exclusive so that
another thread cannot mutate state until the VLRU generation
add transaction completes.

Reviewed-on: http://gerrit.openafs.org/554
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoWindows: short circuit background volume checks for shutdown
Jeffrey Altman [Tue, 29 Sep 2009 12:29:55 +0000]
Windows: short circuit background volume checks for shutdown

If the service is shutting down or the machine is entering
a suspend state, short circuit the background volume checks
to permit faster shutdown.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/552
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoAdd support for background page copies
Simon Wilkinson [Tue, 14 Jul 2009 23:02:31 +0000]
Add support for background page copies

LICENSE BSD

This patch adds support for backgrounding the page copies which are
caused by a call to readpages() In theory, this should improve the
throughput of the AFS kernel module as it permits processes to start
work whilst data is still being read into the page cache for later
pages.

Reviewed-on: http://gerrit.openafs.org/537
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoAdd support for blocking readahead
Simon Wilkinson [Tue, 14 Jul 2009 22:55:18 +0000]
Add support for blocking readahead

This patchset adds support for the readpages() system call, and enables
readahead on Linux. At the moment each page read causes readpages to
block, so the client won't see much benefit from readahead, beyond the
reduction in call overhead.

Reviewed-on: http://gerrit.openafs.org/536
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoDemand attach warning fixes
Simon Wilkinson [Tue, 29 Sep 2009 10:26:55 +0000]
Demand attach warning fixes

Fix a whole host of warnings in the demand attach code.

Make a broken tvolser build stop the build, rather than carrying on
regardless.

Reviewed-on: http://gerrit.openafs.org/551
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoDon't use volatile when it makes no sense
Simon Wilkinson [Tue, 29 Sep 2009 08:25:53 +0000]
Don't use volatile when it makes no sense

The demand attach code defines volume pointers as volatile in
a number of places, despite the fact that the values in question
aren't being shared between multiple threads. It then also passes
these volatile pointers into functions which don't treat them as
volatile (and even to some which assign them to registers).

This patch simply removes the use of volatile in this situation.

Reviewed-on: http://gerrit.openafs.org/550
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agointptr fallout
Derrick Brashear [Tue, 29 Sep 2009 14:26:23 +0000]
intptr fallout

some kernels don't have e.g. uintptr_t; revert this hunk for now.
also, autoconf as recent as what's in rhel5 has no macros. provide
some.

Reviewed-on: http://gerrit.openafs.org/553
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoUse readpage, not read for fastpath access
Simon Wilkinson [Tue, 14 Jul 2009 22:39:44 +0000]
Use readpage, not read for fastpath access

Modify the fast path case so that it uses readpage(), rather than read()
to access data in the cache. This removes a lot of the hidden, uncessary
work that the kernel was doing behind the scenes, and takes advantage of
the fact that we know a page read will always result in a page read
against the backing cache.

Reviewed-on: http://gerrit.openafs.org/535
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoirix compile fixes
Derrick Brashear [Tue, 29 Sep 2009 09:25:46 +0000]
irix compile fixes

fix compilation for irix (and warning for solaris) for icreate
as well as more stdint.h fixes

Reviewed-on: http://gerrit.openafs.org/548
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoWindows: Trace log smb_FindFID errors
Jeffrey Altman [Mon, 28 Sep 2009 14:58:25 +0000]
Windows: Trace log smb_FindFID errors

To assist with debugging, add consistent trace log messages for
smb operations that generate an error because smb_FindFID failed.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/545
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoOS Preference pane clean for final version
Claudio Bisegni [Tue, 29 Sep 2009 07:57:52 +0000]
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>

14 years agoWindows: cm_GetBuffer does not need to contact file server when extended a file
Jeffrey Altman [Mon, 28 Sep 2009 14:22:31 +0000]
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>

14 years agoWindows: Directories do not have a default stream
Jeffrey Altman [Mon, 28 Sep 2009 14:52:45 +0000]
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>

14 years agoFormatting typo in vos_setfields manpage
Andrew Deason [Mon, 28 Sep 2009 15:14:23 +0000]
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>

14 years agoDon't try to print the thread ID
Simon Wilkinson [Mon, 28 Sep 2009 14:21:21 +0000]
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>

14 years agoFix warnings in new dumptag code
Simon Wilkinson [Mon, 28 Sep 2009 14:50:20 +0000]
Fix warnings in new dumptag code

3f2dd80697959f5922032f4d4a7c9ef0cfadf35c 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>

14 years agoSquash more viced warnings
Simon Wilkinson [Sat, 26 Sep 2009 16:44:06 +0000]
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>

14 years agoirix UCRED is already a struct
Derrick Brashear [Mon, 28 Sep 2009 13:53:11 +0000]
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>

14 years agoMinimise crref() and add a fastpath for cache hits
Simon Wilkinson [Tue, 14 Jul 2009 22:33:16 +0000]
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>

14 years agomacos 10.6 warning fixes
Derrick Brashear [Mon, 28 Sep 2009 13:21:59 +0000]
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>

14 years agokauth should use static_inline for irix et al
Derrick Brashear [Mon, 28 Sep 2009 12:05:15 +0000]
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>

14 years agoUse configured compiler for libuafs on Darwin
Simon Wilkinson [Mon, 28 Sep 2009 10:01:54 +0000]
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>

14 years agoAdd support for warning checked builds
Simon Wilkinson [Mon, 28 Sep 2009 10:07:58 +0000]
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>

14 years agoconditionalize stdint.h inclusion in lwp
Derrick Brashear [Mon, 28 Sep 2009 11:54:02 +0000]
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>

14 years agoafsmonitor warnings fix
Derrick Brashear [Mon, 28 Sep 2009 11:46:48 +0000]
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>

14 years agokill cnvldb warnings
Derrick Brashear [Mon, 28 Sep 2009 10:32:09 +0000]
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>

14 years agoImplementation of new dump tag and length standard
Hartmut Reuter [Fri, 11 Sep 2009 10:29:45 +0000]
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>

14 years agoAvoid redefinition errors for AFS_NONFSTRANS
Simon Wilkinson [Mon, 28 Sep 2009 09:41:52 +0000]
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>

14 years agoUse intptr_t and uintptr_t for integer/pointer conversions
Marc Dionne [Fri, 28 Aug 2009 21:03:44 +0000]
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>

14 years agoMake butc logging use va_args
Simon Wilkinson [Mon, 28 Sep 2009 08:43:24 +0000]
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>

14 years agoMiscellaneous warning cleanup
Simon Wilkinson [Sat, 26 Sep 2009 17:11:53 +0000]
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>

14 years agoRemove some more warnings from rx
Simon Wilkinson [Sat, 26 Sep 2009 17:04:06 +0000]
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>

14 years agoWarning fixes for afs_fetchstore
Simon Wilkinson [Sat, 26 Sep 2009 21:12:11 +0000]
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>

14 years agoFix signed/unsigned warnings in XDR
Simon Wilkinson [Sat, 26 Sep 2009 16:34:48 +0000]
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>

14 years agoTidy up unlog
Simon Wilkinson [Sat, 26 Sep 2009 16:50:04 +0000]
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>

14 years agoRemove warnings in the update client and server
Simon Wilkinson [Sat, 26 Sep 2009 16:52:57 +0000]
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>

14 years agoSquish some warnings in ubik/
Simon Wilkinson [Sat, 26 Sep 2009 16:56:48 +0000]
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>

14 years agoRelax compiler specification on Darwin 9 and 10
Simon Wilkinson [Sat, 26 Sep 2009 19:54:06 +0000]
Relax compiler specification on Darwin 9 and 10

Commit 1992b702f64f561c75cc74d4645bb0e1afeec6bd 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>

14 years agofetchOps: fix more() prototype
Marc Dionne [Sat, 26 Sep 2009 13:32:46 +0000]
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>

14 years agoviced cap fetchdata len to avoid negative
Derrick Brashear [Fri, 25 Sep 2009 07:15:40 +0000]
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>

14 years agoAttempt to fix CForeign moredata behaviour
Simon Wilkinson [Sat, 26 Sep 2009 09:06:27 +0000]
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>

14 years agoh_GetHost_r cleanup cases
Derrick Brashear [Fri, 25 Sep 2009 09:19:33 +0000]
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>

14 years agoAFSPreference Pane, has changed the content of launchd xml control file for AFSBackgr...
Claudio Bisegni [Thu, 24 Sep 2009 17:03:28 +0000]
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>

14 years agoFix CacheFetchProc in cases where the fileserver hates us
Simon Wilkinson [Thu, 24 Sep 2009 23:27:40 +0000]
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>

14 years agoUnlink correct files in salvager
Andrew Deason [Mon, 21 Sep 2009 17:48:30 +0000]
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>

14 years agoSolaris: Default to fs_pathconf in afs_pathconf
Andrew Deason [Tue, 22 Sep 2009 21:59:34 +0000]
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>

14 years agoRefactor the cache bypass determination code
Simon Wilkinson [Wed, 23 Sep 2009 17:18:34 +0000]
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>

14 years agoRemove one more AFS_UCRED struct
Andrew Deason [Tue, 22 Sep 2009 22:36:38 +0000]
Remove one more AFS_UCRED struct

After 8a8244dd351f865af2da3b5ebb746ba57723b6a9, 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>

14 years agoWhitespace cleanup (sorry)
Simon Wilkinson [Tue, 22 Sep 2009 16:18:34 +0000]
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>

14 years agoDAFS protocol state diagrams
Derrick Brashear [Tue, 22 Sep 2009 08:51:15 +0000]
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>

14 years agoImplement _PC_FILESIZEBITS for solaris pathconf
Andrew Deason [Mon, 21 Sep 2009 21:57:01 +0000]
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>

14 years agoAvoid salvager vol header read assert
Andrew Deason [Mon, 21 Sep 2009 19:28:29 +0000]
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>

14 years agoDAFS: Put back volumes we get in FSSYNC handlers openafs-devel-1_5_64
Andrew Deason [Mon, 21 Sep 2009 16:09:56 +0000]
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>

14 years agomake 1.5.64 for unix
Derrick Brashear [Mon, 21 Sep 2009 16:33:37 +0000]
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>

14 years agoUse the padd op.
Felix Frank [Sun, 20 Sep 2009 12:43:34 +0000]
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:
6220ede6a96d06c53eddd848435764cff96be1b4

Reviewed-on: http://gerrit.openafs.org/471
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoWindows version number 1.5.64
Jeffrey Altman [Mon, 21 Sep 2009 16:11:25 +0000]
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>

14 years agoWindows: 1.5.64 updates for Windows Notes
Jeffrey Altman [Mon, 21 Sep 2009 16:07:23 +0000]
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>

14 years agoWindows: uninitialized variable in cm_GetBuffer
Jeffrey Altman [Sun, 20 Sep 2009 15:06:07 +0000]
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>

14 years agoWindows: Protect against null serverp in cm_Analyze
Jeffrey Altman [Sun, 20 Sep 2009 15:04:07 +0000]
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>

14 years agoWindows: Do not mark server down due to Store / Fetch Data protocol error
Jeffrey Altman [Sat, 19 Sep 2009 17:52:32 +0000]
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>

14 years agoWindows: more pioctl output validation
Jeffrey Altman [Mon, 14 Sep 2009 14:59:54 +0000]
Windows: more pioctl output validation

Add output validation checks to the Explorer Shell and the
Client configuration control panel.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/458
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: Use "Name not found" instead of "File not found"
Jeffrey Altman [Sat, 19 Sep 2009 08:55:09 +0000]
Windows: Use "Name not found" instead of "File not found"

When a file cannot be opened because the name of the file or
a directory in the path cannot be found, return "Name not found"
instead of "File not found".  "File not found" is the error returned
by the smb redirector to the application when the file cannot be
located in the search path.  "Name not found" indicates that the
entry is not present at the location requested.

The use of "File not found" prevented execution of applications
from the \\AFS name space on Windows 7.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/469
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows: trace logging changes for smb_ReceiveTran2QPathInfo
Jeffrey Altman [Fri, 18 Sep 2009 14:46:07 +0000]
Windows: trace logging changes for smb_ReceiveTran2QPathInfo

Add new trace log entries in smb_ReceiveTran2QPathInfo to
help track down the reason for queries in which the path and
tidPath are both the empty string.

LICENSE MIT

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

14 years agoWindows: Improve WKSSRC and SRVSVC compatibility with Windows
Jeffrey Altman [Fri, 18 Sep 2009 14:41:14 +0000]
Windows: Improve WKSSRC and SRVSVC compatibility with Windows

This commit includes several changes to improve compatibility
with Windows (in particular Windows 2000).

1. Specify a Lan Workgroup name.  We use "AFS".

2. Ensure that the server name returned does not include
   leading slash or backslash characters.  The name provided
   might include them but they are not part of the name and
   cannot be returned.

3. The NetrWkstaGetInfo and NetrServerGetInfo responses must
   be consistent.  Otherwise, the Explorer Shell will get confused and
   refuse to provide access to the server shares.

This commit also includes some minor comment changes.

LICENSE MIT

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

14 years agoWindows: Trace wkssvc and srvsvc rpc calls
Jeffrey Altman [Fri, 18 Sep 2009 14:25:59 +0000]
Windows: Trace wkssvc and srvsvc rpc calls

Add osi_Log statements identifying which RPCs are being called
from the wkssvc and srvsvc modules

LICENSE MIT

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

14 years agoWindows: No rand_s on Windows 2000
Jeffrey Altman [Fri, 18 Sep 2009 14:01:10 +0000]
Windows: No rand_s on Windows 2000

Even if the rand_s() function is supported by the compiler
it is not supported on Windows 2000 because the kernel level
functionality it requires does not exist on that platform.
Calling rand_s() on Windows 2000 will throw an exception
and terminate the service.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/464
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoDAFS assert correction in GetVolume
Andrew Deason [Fri, 18 Sep 2009 18:23:46 +0000]
DAFS assert correction in GetVolume

FSSYNC_VolOpRunningUnknown is a vol op state, not a pointer to a vol op
itself.

Reviewed-on: http://gerrit.openafs.org/468
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoLinux: Restore aklog -setpag functionality for kernel 2.6.32+
Marc Dionne [Mon, 14 Sep 2009 21:40:23 +0000]
Linux: Restore aklog -setpag functionality for kernel 2.6.32+

With kernel 2.6.32 it is now possible for a process to copy its session
keyring to its parent through the use of the KEYCTL_SESSION_TO_PARENT
function of the keyctl syscall.

We can't use this easily from kernel space to cover all calls to
VIOCSETTOK with the setpag flag - we'd need to make a syscall
or have keyctl exported.  Instead, a hook is added to ktc_SetToken to
make it honour the AFS_SETTOK_SETPAG flag, which was ineffective with recent
kernels.
This should cover the most common cases (ex: aklog) where this is needed.

The syscall is coded directly to avoid introducing a dependency on the
keyutils library or header files which may not be installed everywhere.

Reviewed-on: http://gerrit.openafs.org/463
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoManage the login in the OSX Fast User Switch mode
Claudio Bisegni [Tue, 15 Sep 2009 07:29:21 +0000]
Manage the login in the OSX Fast User Switch mode

AFSBackgrounder has been update to get notification for switch in/off in the "Fast User Switch" mode, and in switch in it try to get tokens.

Reviewed-on: http://gerrit.openafs.org/460
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

14 years agoRemove unecessary initialisation
Simon Wilkinson [Mon, 14 Sep 2009 12:49:22 +0000]
Remove unecessary initialisation

We already memset av to contain all 0s, therefore we don't need to
initialise individual elements to 0 as well.

Inspired by Rainer Toebbicke's patch for RT 125355 (which is 1.4.x only)

Reviewed-on: http://gerrit.openafs.org/456
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agoCorrects file_CmdRef_1_fs_chgrp_html and file_CmdRef_1_fs_chown_html sharing short...
Brant Gurganus [Mon, 14 Sep 2009 02:02:10 +0000]
Corrects file_CmdRef_1_fs_chgrp_html and file_CmdRef_1_fs_chown_html sharing short names.

Reviewed-on: http://gerrit.openafs.org/455
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoAdd indexing to Windows Release Notes
Jeffrey Altman [Sun, 13 Sep 2009 14:32:12 +0000]
Add indexing to Windows Release Notes

An initial pass at adding indexing to the Windows release notes.
The next pass should refine the index terms and add appropriate
secondary index values.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/454
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

14 years agoWindows Release Notes XML
Jeffrey Altman [Sun, 13 Sep 2009 05:45:48 +0000]
Windows Release Notes XML

Reformat the Registry and Environment Values in Appendix A
so that they are easier to identify in the table of contents.

LICENSE MIT

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

14 years agocm fetchstore should dereference unset ops
Derrick Brashear [Sun, 13 Sep 2009 05:00:45 +0000]
cm fetchstore should dereference unset ops

if rxfs_fetchInit fails, ops will not be set; calling the destroy op
unconditionally thus leads to a panic.

Reviewed-on: http://gerrit.openafs.org/452
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

14 years agomacos package updates openafs-devel-1_5_63
Derrick Brashear [Fri, 11 Sep 2009 17:26:01 +0000]
macos package updates

make the readme correct; allow back reving (downgrades)

Reviewed-on: http://gerrit.openafs.org/447
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>