openafs.git
11 years agoSolaris: Don't access lbolt directly
Simon Wilkinson [Tue, 22 Dec 2009 21:46:43 +0000]
Solaris: Don't access lbolt directly

Recent changes in OpenSolaris have removed the 'lbolt' variable.
However, the ddi_get_lbolt accessor (which has been present since
Solaris 10) can be used to get access to the same value. So, use it.

Change-Id: I7a72bab14b0226fb25adb642f3621512e02ca216
Reviewed-on: http://gerrit.openafs.org/1022
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoSolaris: Don't directly fiddle with the groups structure
Simon Wilkinson [Tue, 22 Dec 2009 21:42:19 +0000]
Solaris: Don't directly fiddle with the groups structure

Solaris doesn't let us directly play with the groups structure
anymore. Instead, there is a crsetgroups accessor which can be
used instead. So, use it.

Change-Id: I4d5b99110318630c8a7744812476e1941c117381
Reviewed-on: http://gerrit.openafs.org/1021
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoSolaris: Be more flexible about compilers
Simon Wilkinson [Tue, 22 Dec 2009 21:38:00 +0000]
Solaris: Be more flexible about compilers

OpenSolaris doesn't have its C compiler in /opt/SUNWspro/bin/cc,
but we still have to be careful to avoid gcc, as that can't
build the kernel module.

As a short term stop gap, add a PATH_PROG test which looks in
both /opt/SUNWspro/bin and /opt/SunStudioExpress/bin for cc.
We probably should look in more places, and in the long run,
we should probably be taking whatever autoconf gives us
(for userspace, at least)

Change-Id: Ie31cf1bf474650a081fc101a2aa40cfa6bd39423
Reviewed-on: http://gerrit.openafs.org/1020
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLook for aclocal in more places
Simon Wilkinson [Tue, 22 Dec 2009 21:34:23 +0000]
Look for aclocal in more places

Some operating systems (cough, OpenSolaris, cough) have multiple
versions of aclocal installed, and don't populate the 'aclocal' name.
If 'aclocal' isn't present, then try using 'aclocal-1.10' before we give
up in disgust.

Change-Id: Iad6daf1038942aeee13f38cb0c00c58da621cfd1
Reviewed-on: http://gerrit.openafs.org/1019
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoFix typo in afs_linux_cred_is_current
Andrew Deason [Tue, 22 Dec 2009 14:49:21 +0000]
Fix typo in afs_linux_cred_is_current

987816dfa852750caca8c64c44174a5333ae0e3b introduced a stray 'cred' in
one of the afs_linux_cred_is_current definitions. Remove it so we can
build without STRUCT_TASK_HAS_CRED.

Change-Id: I7ef94c1c3d15a2a744755d8a20ec2b0c92cd5349
Reviewed-on: http://gerrit.openafs.org/1018
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoPrefix global defines
Michael Meffie [Thu, 10 Dec 2009 21:13:45 +0000]
Prefix global defines

Prefix constants relocated to the common afs_consts.h
header to void naming collisions.

Change-Id: Ib657e00385002c957b40b36058f260c6cabd108c
Reviewed-on: http://gerrit.openafs.org/905
Reviewed-by: Mickey Lane <mlane@sinenomine.net>
Tested-by: Mickey Lane <mlane@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoConsolidate duplicate definitions
Michael Meffie [Thu, 10 Dec 2009 16:37:34 +0000]
Consolidate duplicate definitions

Housekeeping change to consolidate some common definitions.
Create a new common header called afs_consts.h.  This allows
us to remove the afscp.c dependency on afs.h (so src/tests
will build again.) Rename the max filename definition in the
update server package to MAXFNSIZE to avoid a name conflict
with MAXSIZE.  The global defines will be prefixed with
AFS_ in a second patch.

Change-Id: I2b8d555a244cc92d889618de4eec4a99550d7c7f
Reviewed-on: http://gerrit.openafs.org/855
Reviewed-by: Mickey Lane <mlane@sinenomine.net>
Tested-by: Mickey Lane <mlane@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: fix sysctl for 2.6.33
Marc Dionne [Sun, 20 Dec 2009 13:30:07 +0000]
Linux: fix sysctl for 2.6.33

The sysctl patch for 2.6.33 was a bit overzealous and ifdef'ed
a few lines that it shouldn't have.

Change-Id: I7033259e567a06ce05b968366e810c5b2688c271
Reviewed-on: http://gerrit.openafs.org/1011
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: utsrelease.h is moving
Marc Dionne [Sun, 20 Dec 2009 03:22:05 +0000]
Linux: utsrelease.h is moving

In kernel 2.6.33, utsrelease.h has moved to include/generated.
Adapt the configure code to consider that location, and clean
up that section's indentation.

Change-Id: I5061043ff7f46875a39953b11c472693650c7485
Reviewed-on: http://gerrit.openafs.org/1009
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoFix PAGs for all platforms without Linux keyrings
Simon Wilkinson [Sat, 19 Dec 2009 21:53:54 +0000]
Fix PAGs for all platforms without Linux keyrings

The changes in 7b272177de4c6f78db7f2315f4e30e85ab7660bb sadly break
all platforms which aren't Linux. This is because the logic in PagInCred
doesn't handle the non-Linux case at all. Fix this so that we call
afs_get_group_pag whenever we're not running on Linux.

The code also doesn't match the comment - Linux kernels which don't
have keyrings should use afs_get_group_pag(), regardless of whether
STRUCT_TASK_HAS_CRED. It's unlikely this bit would ever bite anyone
though, kernels with cred support almost certainly require keyrings.

Change-Id: I5373da51151229dc13b6dc60c3cf10700f0f881a
Reviewed-on: http://gerrit.openafs.org/1006
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Simplify keyring compatibility code
Simon Wilkinson [Sat, 19 Dec 2009 20:21:36 +0000]
Linux: Simplify keyring compatibility code

This introduces a few inline functions in osi_compat.h, to reduce the
number of #ifdefs in the main chunk of code. In particular, we gain
  * afs_linux_key_alloc : to handle all the different key_alloc
                          signatures
  * afs_linux_search_keyring : to handle our two different mechanisms
                               for searching a keyring
  * afs_linux_cred_is_current : will return true if we're using native
credentials, and the passed creds are also
those of the current task

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

11 years agoLinux: Don't panic when keys aren't found
Simon Wilkinson [Sat, 19 Dec 2009 15:40:49 +0000]
Linux: Don't panic when keys aren't found

This fixes two potential problems in our session keyring lookup code,
which can lead to panics in situations where we're using the new struct
cred based code.

The first is that if there is no session kerying installed for the
current task, we'll attempt to do a lookup on a NULL kerying and oops.

The second is that if the keyring_search returns EPERM, then we can end
up unmasking that error code, and return NULL, rather than an error.

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

11 years agoLinux: Flush vcaches when a mount fails
Simon Wilkinson [Sat, 19 Dec 2009 14:48:32 +0000]
Linux: Flush vcaches when a mount fails

GetVCache (well, really NewVCache) creates a new vcache, with an attached
inode, and links it into the VLRU queue, regardless of whether it is
successful in populating that vcache or not. The attached inode, on Linux,
contains a reference to the super block of the filesystem. If the created
vcache is for the root, however, and populating that vcache failes, then mount
fails, and the super block is disposed of. This leaves us with a vcache in
the VLRU queue which contains a reference to a non-existent inode.

When ShakeLooseVCaches comes along a few minutes later, it attempts to discard
this inode. However, doing so fails because the inode no longer has a valid
super block.

Avoid this trauma by ensuring all vcaches are disposed of before the super
block goes away, in the event of a mount failure.

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

11 years agoDo not trust FetchData length from fileservers
Andrew Deason [Thu, 17 Dec 2009 20:59:44 +0000]
Do not trust FetchData length from fileservers

Currently the Unix CM implicitly trusts that the length from a FetchData
request from a fileserver will always be less than the requested length.
If the fileserver sends more data than requested, we can use up more
cache space than we intended, possibly exceeding the cacheinfo cache
limits.

Add a check for this, and return EIO to the caller if the fileserver
responds with too much data.

Change-Id: I413393a7bacbf207332d7f904cf396c79b77b6b5
Reviewed-on: http://gerrit.openafs.org/996
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoplatform target depends on cmd and vol
Andrew Deason [Fri, 18 Dec 2009 18:21:35 +0000]
platform target depends on cmd and vol

The 'platform' target depends on cmd and vol, since on solaris
non-namei, we build fs_conv_sol26.c, which depends on some volume
structures, and uses libcmd. So, have Makefile.in accurately reflect
that dependency so we can build.

Change-Id: Ic7038f252dd069522ebfc8e72b9743c01c97d99c
Reviewed-on: http://gerrit.openafs.org/998
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agokernel ioctl32 conversion typecasting
Derrick Brashear [Thu, 17 Dec 2009 14:48:06 +0000]
kernel ioctl32 conversion typecasting

cast types to avoid a pointer from integer warning when using pointer
types for sizing

Change-Id: Idac76608e5352c65a13d07bfadb66d78f9db0ffd
Reviewed-on: http://gerrit.openafs.org/988
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd the 'vos endtrans' command
Andrew Deason [Fri, 16 Oct 2009 22:12:35 +0000]
Add the 'vos endtrans' command

Add a command to vos to explicitly end volume transactions. These can
happen if (for example) we segfault or the user ctrl-C's in 'vos'
before/after a volume operation, but before we AFSVolEndTrans.

Change-Id: Ie34ee1fdff917b56900f456c7cf8b1329533a7da
Reviewed-on: http://gerrit.openafs.org/870
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoOpenAFS Preference Pane
Claudio Bisegni [Fri, 11 Dec 2009 21:03:39 +0000]
OpenAFS Preference Pane
Now the preference pane is fat compiled.

Change-Id: I5c54555d00b16d85f01286719bbc41ea5f1fb67d
Reviewed-on: http://gerrit.openafs.org/906
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoExpand ProgramType enumeration
Andrew Deason [Fri, 6 Nov 2009 20:03:52 +0000]
Expand ProgramType enumeration

The ProgramType values volumeUtility and salvager are overloaded. Expand
the ProgramType enum to include more specific program types, and adjust
conditionals to match.

Also, instead of determining all behavior by checking programType, add
some flags to be passed in to VInitVolumePackage to determine e.g.
whether or not we can use the FSSYNC channel. This makes it easier to
see the intent of some conditionals, and reduces the number of times a
caller must lie about what program it is.

Change-Id: Ic9852a35bb16a6b1f4b0aa9766de63178ecea56f
Reviewed-on: http://gerrit.openafs.org/786
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Use splice to speed up cache storeback
Simon Wilkinson [Fri, 20 Nov 2009 15:08:25 +0000]
Linux: Use splice to speed up cache storeback

This patch adds a new cache store function for Linux, which uses
splice() and direct access to the page cache, rather than doing
data copies to a temporary buffer between rx and afs. It removes
one copy, and some context switching, from the write codepath.

One side-effect here is that it will delay storebehinds from
returning control to the user. Instead of returning once the first
4k has been successfully transfered, we will wait until a cache
chunk has been transmitted. This is currently unavoidable, as we
can't take the GLOCK within a splice actor.

Change-Id: I5b0284d67febccf099710589908fad18b808332c
Reviewed-on: http://gerrit.openafs.org/903
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoRework cache store back
Simon Wilkinson [Fri, 20 Nov 2009 15:03:37 +0000]
Rework cache store back

This patch reworks the code to store data from the cache to the server,
such that the entire store loop can be replaced. The idea here is that a
platform which wishes to provide a different store loop, in particular
one which doesn't rely upon multiple data copies, may do so simply by
plugging in a new function.

Change-Id: I6573c6a5c3e93a1259266e7e1a2b7bd17357203f
Reviewed-on: http://gerrit.openafs.org/902
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: deal with ctl_name removal
Marc Dionne [Thu, 10 Dec 2009 00:06:18 +0000]
Linux: deal with ctl_name removal

The binary sysctl interface will be removed in kernel 2.6.33 and
ctl_name will be dropped from the ctl_table structure.
Make the code that uses ctl_name conditional on a configure test.

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

11 years agopt_util runs on database servers
Simon Wilkinson [Tue, 8 Dec 2009 15:21:54 +0000]
pt_util runs on database servers

Fix the pt_util manpage to reflect the fact that it is run on database
servers, not fileservers.

Change-Id: If2a8e5b65ef925c50eb9bfebea4e0d30c20f0970
Reviewed-on: http://gerrit.openafs.org/901
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: cm_BPlusEnumAlloc should not fail for zero entries
Jeffrey Altman [Sat, 5 Dec 2009 15:51:27 +0000]
Windows: cm_BPlusEnumAlloc should not fail for zero entries

If cm_BPlusEnumAlloc returns NULL, the caller assumes a
memory allocation error.  If the enumeration consists of
zero entries, allocate a structure that stores zero entries.

LICENSE MIT

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

11 years agoWindows: cm_BPlusDirBuildTree can fail
Jeffrey Altman [Sat, 5 Dec 2009 15:53:03 +0000]
Windows: cm_BPlusDirBuildTree can fail

It is possible that cm_BPlusDirBuildTree can fail.  For example,
the server could be marked down after a callback is obtained
but before all of the directory data buffers have been fetched.
cm_BeginDirOp must check for the failure, destroy the tree,
and return the failure code to the caller.  Otherwise, a tree
with no entries may be created and marked with the current
data version.

LICENSE MIT

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

11 years agomacos avoid dotunderbar lookups in fakestat mode
Derrick Brashear [Mon, 7 Dec 2009 04:44:53 +0000]
macos avoid dotunderbar lookups in fakestat mode

cocoa tries to lookup ._ files for every object, possibly generating
AFSDB queries and other fun. avoid them

Change-Id: Id70b6335d4dddcb6d5628a9883b2c81193bb39d7
Reviewed-on: http://gerrit.openafs.org/896
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoadd newline to lockprocs_prototypes.h
Derrick Brashear [Mon, 7 Dec 2009 20:43:33 +0000]
add newline to lockprocs_prototypes.h

gcc was unhappy about the lack of trailing newline. add one.

Change-Id: Ie9c93bd9ed8c923ea8069fe49e7f5ddb20c28f80
Reviewed-on: http://gerrit.openafs.org/898
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoDump all hostFlags in hosts.dump
Andrew Deason [Tue, 24 Nov 2009 21:09:42 +0000]
Dump all hostFlags in hosts.dump

Currently only certain flags are dumped in hosts.dump. Also dump the
value of hostFlags itself, so we get more information from a host dump.

Change-Id: I2d265b85e057c2d44938e1d92f4c102048c4bf1f
Reviewed-on: http://gerrit.openafs.org/869
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Dan Hyde <drh@umich.edu>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoMake HandleClientContext take an afs_ucred_t
Andrew Deason [Sun, 6 Dec 2009 20:56:20 +0000]
Make HandleClientContext take an afs_ucred_t

5d5d18071608d9782a5d936f79215048af641410 missed one occurrence of
AFS_UCRED. Make HandleClientContext take an afs_ucred_t instead of
AFS_UCRED, so afs_pioctl.c builds again.

Change-Id: I04c831ad262cade5da0f90fb8860174657dae4bf
Reviewed-on: http://gerrit.openafs.org/895
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoRemove AFS_USEBUFFERS
Simon Wilkinson [Sun, 6 Dec 2009 14:25:08 +0000]
Remove AFS_USEBUFFERS

The AFS_USEBUFFERS code has been disabled for all supported platforms
since the initial OpenAFS code drop. Simplify the buffers code by
removing it entirely.

Change-Id: Iab6b2d54361eca1a1446b4804b3d6533d75f2831
Reviewed-on: http://gerrit.openafs.org/894
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoWindows: Version update for 1.5.68 openafs-devel-1_5_68
Derrick Brashear [Sat, 5 Dec 2009 00:53:21 +0000]
Windows: Version update for 1.5.68

1.5.6800 = 1.5.68

Change-Id: Id3bdc21e5f72ebe2047cb70c2496df2ba7300b4b
Reviewed-on: http://gerrit.openafs.org/891
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agounix 1.5.68
Derrick Brashear [Fri, 4 Dec 2009 16:52:29 +0000]
unix 1.5.68

update version numbers for unix

Change-Id: Ic8a42a9ca1cfc74ab2d8f8d2ac0442efa716a84b
Reviewed-on: http://gerrit.openafs.org/888
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agorx packet dumper not in kernel
Derrick Brashear [Fri, 4 Dec 2009 20:31:10 +0000]
rx packet dumper not in kernel

don't compile the rx packet dumper when in kernel

Change-Id: I8484f3ed80d3b97d733091901f6e252a455cefa1
Reviewed-on: http://gerrit.openafs.org/889
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoFix midnight volume calculation to build on Windows
Jeffrey Altman [Fri, 4 Dec 2009 15:52:21 +0000]
Fix midnight volume calculation to build on Windows

Change I516d732d broke the Windows build.  localtime_r does not
exist on Windows.

Change-Id: Ib28e414a85d763dbe146bc2fadec91310f6144ab
Reviewed-on: http://gerrit.openafs.org/887
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: Version update for 1.5.67
Jeffrey Altman [Fri, 4 Dec 2009 05:43:54 +0000]
Windows: Version update for 1.5.67

1.5.6700.0 == 1.5.67

Change-Id: I0f4402cdb8f387b67c93ee9066dc3be352d163c1
Reviewed-on: http://gerrit.openafs.org/886
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agounix 1.5.67 openafs-devel-1_5_67
Derrick Brashear [Fri, 4 Dec 2009 04:26:18 +0000]
unix 1.5.67

make 1.5.67 for unix

Change-Id: I1e25ec581b9b2a37230bd2a889f88f454a73ba8f
Reviewed-on: http://gerrit.openafs.org/885
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoadd rx packet trace debug dumping for unix
Derrick Brashear [Thu, 3 Dec 2009 20:37:52 +0000]
add rx packet trace debug dumping for unix

revised version of a patch i've had for months to actually be clean.
allow state of all packets to be dumped so you can see what's on what
queues where.

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

11 years agoCalculate midnight (for volume stats) based on standard functions
Rainer Toebbicke [Thu, 19 Nov 2009 13:07:07 +0000]
Calculate midnight (for volume stats) based on standard functions

The "tz" structure used with gettimeofday is not blessed by common
standards and not widely supported, on Solaris for example it does not
return anything useful.
Calculate midnight based on standard functions (localtime/mktime).

Change-Id: I516d732d4a9dd4696a524a271d806d349c074c25
Reviewed-on: http://gerrit.openafs.org/849
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoWindows: change notes for 1.5.67 release
Jeffrey Altman [Thu, 3 Dec 2009 20:47:38 +0000]
Windows: change notes for 1.5.67 release

Change-Id: I0eedd81fbfee98c591cfd57364bc23392ccca2da
Reviewed-on: http://gerrit.openafs.org/884
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoadd unlock support to afscp
Derrick Brashear [Tue, 1 Dec 2009 21:17:49 +0000]
add unlock support to afscp

make the afscp test client able to drop a lock on a file.
additionally, make it build again.

Change-Id: Ib4a5acf787f8f2e84699e1638a662068b993d965
Reviewed-on: http://gerrit.openafs.org/881
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoUse xdr_alloc and xdr_free within ptuser
Jeffrey Altman [Mon, 17 Aug 2009 16:30:44 +0000]
Use xdr_alloc and xdr_free within ptuser

If the memory allocation routines for libafsauthent and libafsrpc
differ, callers of the ptuser routines in libafsauthent will crash.
Use xdr_alloc and xdr_free in ptuser to ensure that the memory
allocation routines are always consistent.

LICENSE MIT

Change-Id: I20fa1e1fc0677917e47e2ed9f0eaec83f23b699b
Change-Id: Id31bf20b482e9502a5af79f4d86319fe530aa5a5
Reviewed-on: http://gerrit.openafs.org/319
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoshutdown_icl return type void
Michael Meffie [Tue, 1 Dec 2009 00:28:13 +0000]
shutdown_icl return type void

Change the shutdown_icl return type to void
to match the 1.4.x branch.

Change-Id: I641abbd0f87d648c3c9de3cab4d0dd926a51eb89
Reviewed-on: http://gerrit.openafs.org/879
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

11 years agoCorrect duplicate special inodes while salvaging
Andrew Deason [Mon, 26 Oct 2009 19:09:41 +0000]
Correct duplicate special inodes while salvaging

Right now when the salvager encounters duplicate special inodes for a
volume, it refuses to salvage the volume, presumably because it does not
know which inodes to use when recreating the volume header.

However, this can cause the confusing state where the fileserver and
various volume utilities have no problem with a volume, but the salvager
refuses to salvage it and marks the volume as needing salvage. When
salvaging, if we already have a volume header, and we encounter
duplicate special inodes, it is likely that the special inode referenced
by the volume header is the correct one.

So, instead of erroring out, keep track of which inodes are referenced
in the volume header, and if there are any duplicates, either ignore or
delete the unreferenced ones, depending on the -orphans setting. Also be
a little more verbose when logging errors in this area.

Change-Id: I15e34e8f2bccdc666bb59e3730fdf8bf51624259
Reviewed-on: http://gerrit.openafs.org/736
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Steve Simmons <scs@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoWarning fixes - key handling
Marc Dionne [Thu, 19 Nov 2009 23:29:08 +0000]
Warning fixes - key handling

Various warning fixes related mostly to the different types used
to handle keys.  This should clear most of the remaining warnings
in this area.  The technique of inline converter helpers is
extended to cover a few more cases.

README.WARNINGS is adjusted to reflect the current status.

Fixes:
- bos: define and use an inline converter from a ktc key to a bozo key
- bos.c and bos_utils.c should no longer have warnings - adjust Makefile
- define a ktc key to char * converter and use it in a few places
- define kas key to bozo key ptr converter and use it in a few places (afs_bosAdmin)
- cast a few arguments to ka_StringToKey which expects non-const pointers
Change-Id: I1c19869ac232d78209126d4eeeb11af8bcb95815
Reviewed-on: http://gerrit.openafs.org/860
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd server prefix to utst_int.xg
Andrew Deason [Sun, 29 Nov 2009 03:25:27 +0000]
Add server prefix to utst_int.xg

When compiling src/ubik/utst_int.ss.c, a warning would be produced since
the server stubs are defined as accepting an rx_connection instead of an
rx_call, and since the server and client RPC stubs have the same name.
Give a server prefix so we can distinguish between the two, and fix the
server stubs and squash the warning, similar to
bd011aeee7f5dad5c61fd81a90b296c46a0b9058.

Change-Id: Iebf843bcabb4cf8f4a56c6ac30d210573b58d801
Reviewed-on: http://gerrit.openafs.org/876
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd safety checks on all hostList traversals
Andrew Deason [Fri, 20 Nov 2009 20:15:28 +0000]
Add safety checks on all hostList traversals

Currently, h_Enumerate checks that it doesn't enumerate over more than
hostCount hosts, in case the hostList has a cycle or is otherwise
corrupt. Add similar checks to all places in the code that loop over
hostList, to prevent the code from getting in an infinite loop under
H_LOCK in the case of a hostList cycle.

Also, ShutDownAndCore instead of assert'ing, so we try and detach
volumes first, possibly reducing salvaging time when we restart after
core'ing.

Change-Id: Ide1e5aca7c2c4a4af3f62bc07821db694f2f9999
Reviewed-on: http://gerrit.openafs.org/863
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoAdd a watchdog timer for ShutDownAndCore(PANIC)
Andrew Deason [Wed, 25 Nov 2009 21:23:06 +0000]
Add a watchdog timer for ShutDownAndCore(PANIC)

Add a watchdog timer that is started when ShutDownAndCore(PANIC) is
called, to ensure we actually panic and do not e.g. get stuck in
deadlock.

Change-Id: I9201fe7d09aeb6819beefaf1755b51129c7bda6b
Reviewed-on: http://gerrit.openafs.org/873
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoCorrect include paths in fs_conv_sol26.c
Andrew Deason [Wed, 25 Nov 2009 15:25:14 +0000]
Correct include paths in fs_conv_sol26.c

Make the #include paths in fs_conv_sol26.c correspond to the
36524b2ed73a2774ee1f6242208a1395be7736a8 changes, so fs_conv_sol26.c
will build again.

Change-Id: Ic454dae07c0fb324f8550d1281b63fe539f8d525
Reviewed-on: http://gerrit.openafs.org/871
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years ago'Flexible client buffer growth' fallout
Andrew Deason [Wed, 25 Nov 2009 21:47:27 +0000]
'Flexible client buffer growth' fallout

e7c966354c428a5a5929a3db6a829ee71c8ba2fc re-introduced a usage of the
'M' lock macro variants previously removed by
bab6fd227f5724c4e4ca5d0ba1dc64e21ed21f97. Use the non-'M' macros
instead so we can build.

Change-Id: Ie27fb8e82a7440a6952517d9a0cc1aeb8523511c
Reviewed-on: http://gerrit.openafs.org/872
Tested-by: Andrew Deason <adeason@sinenomine.net>
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>

11 years agoWindows: Fix test for setting FILE_ATTR_READONLY
Jeffrey Altman [Tue, 24 Nov 2009 23:08:55 +0000]
Windows: Fix test for setting FILE_ATTR_READONLY

When checking whether or not to enforce the unix mode
bits as if they were the Windows FILE_ATTR_READONLY flag
the mask 0200 is used.  Make sure that the same mask is
used when publishing the FILE_ATTR_READONLY flag to the
smb client.

LICENSE MIT

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

11 years agoFlexible client buffer growth
Rainer Toebbicke [Thu, 29 Oct 2009 13:52:45 +0000]
Flexible client buffer growth

Allocates the 2k-directory-buffers for the client as needed, in
small increments, rather than a fixed-length area upon startup.

Change-Id: I6061b71d40284a0059e54377e3b374fee9b86816
Reviewed-on: http://gerrit.openafs.org/799
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoWindows: disable readonly volume versioning due to file server bug
Jeffrey Altman [Thu, 19 Nov 2009 23:53:56 +0000]
Windows: disable readonly volume versioning due to file server bug

Change I17e3980184ec68e38c5186e1c9637ac6e38451fe corrects a file
server bug that results in invalid volume sync data being sent
to clients during bulk status rpcs.  Unless this is fixed in the
file servers it is not safe to use the volume versioning functionality.

This patchset disables the functionality by default and permits
it to be turned on via a registry value.  If the client is deployed
in an environment in which all of the file servers have been fixed,
then it will be safe to turn this feature on.

LICENSE MIT

Change-Id: I0db38ffc9cdeb90db20b92adca9a42a06fed2e2f
Reviewed-on: http://gerrit.openafs.org/859
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: provide enhanced error output to aklog
Jeffrey Altman [Thu, 19 Nov 2009 16:35:12 +0000]
Windows: provide enhanced error output to aklog

Add Simon Wilkinson's change from Unix aklog to Windows aklog
If afs_com_err fails to describe the error, allow the krb5
error_message function try.

LICENSE MIT

Change-Id: I47bb6806f1076116a68967617d32d69b98a5bba9
Reviewed-on: http://gerrit.openafs.org/852
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: cm_TryBulkStatus processing changes
Jeffrey Altman [Thu, 19 Nov 2009 23:21:39 +0000]
Windows: cm_TryBulkStatus processing changes

move the logging of success or failure in order to
try to avoid the VS8 compiler optimizing them out.

merge the bulk status information if the current
cm_scache_t object is flagged with an access denied
failure on the last request or if it is a readonly
volume.  This permits us to return something valid
to the directory enumeration that generated the
cm_TryBulkStatus call.

LICENSE MIT

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

11 years agoWindows: when assigning a new clientModTime, hold a lock
Jeffrey Altman [Thu, 19 Nov 2009 23:19:39 +0000]
Windows: when assigning a new clientModTime, hold a lock

The smb server modifies the cm_scache_t clientModTime without
holding a write lock creating a race condition.  Fix it.

LICENSE MIT

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

11 years agoWindows: modify src/rxkad/NTMakefile to avoid file copies
Jeffrey Altman [Thu, 19 Nov 2009 19:18:18 +0000]
Windows: modify src/rxkad/NTMakefile to avoid file copies

Permit src/rxkad/domestic/* files to be compiled / installed
in place.  This permits the tree to build after the
application of change I0796fabcf83ffcd74e533624c64e138a160dd632.

Change-Id: I5616c7ab9374751dcb44bb2bce37dec40e01148a
Reviewed-on: http://gerrit.openafs.org/854
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoviced: set volume sync data in bulk status rpcs
Jeffrey Altman [Thu, 19 Nov 2009 23:11:06 +0000]
viced: set volume sync data in bulk status rpcs

The bulkstatus and inlinebulkstatus rpcs have a bug
that prevents the volume sync data from being set.
Currently the data is being set within the for loop
only when i == nfiles.  The conditional of the loop
is i < nfiles so the SetVolumeSync call is never
performed.  This patch changes the test for performing
SetVolumeSync to i == 0.

LICENSE MIT

Change-Id: I17e3980184ec68e38c5186e1c9637ac6e38451fe
Reviewed-on: http://gerrit.openafs.org/856
Reviewed-by: Dan Hyde <drh@umich.edu>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Keyrings PAG handling changes
Marc Dionne [Sun, 25 Oct 2009 02:10:46 +0000]
Linux: Keyrings PAG handling changes

We can take advantage of the fact that PagInCred now receives
a kernel credentials structure as an argument (including any session
keyring) to make some improvements in the handling of PAGs
when keyrings are in use.

These changes are effective only if keyrings are in use and we
have a recent enough kernel where we can use the kernel
credentials structure.

1 - Search the session keyring of the passed credentials instead of
the current process' to determine the PAG, if any.  This was always
not really correct, and now we're able to do the right thing.
In some situations such as background writeback and pre-fetching,
this means that we'll now do it with the right credentials, even when
in a PAG.

2 - Don't use groups at all to determine PAG membership.  Doing so
can lead to some inconsistent situations such as the one described
in RT 125198, where a process gets access through a soon to be
deleted PAG.  Make PagInCred look exclusively at the keyrings.
Groups are still updated to try to reflect the current PAG for now,
if the passed credentials belong to the current process.

Note that a process can no longer get a PAG's privileges simply by
adding the corresponding groups to its group list.

No behaviour change for kernels prior to 2.6.29.

FIXES 125198

Change-Id: Ifb171993cc9ca9d6a97fb7312909485ec0666efb
Reviewed-on: http://gerrit.openafs.org/730
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoRemove "unused" warnings from lex generated files
Marc Dionne [Sun, 22 Nov 2009 19:17:19 +0000]
Remove "unused" warnings from lex generated files

Some (f)lex generated source files produce warnings because of unused
labels or variables.
Since there is limited control of the source itself, just be more
permissive in this particular case with -Wno-unused.

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

11 years agoLinux: hinting removal fallout
Marc Dionne [Fri, 20 Nov 2009 22:27:20 +0000]
Linux: hinting removal fallout

The removal of the hinting missed a few things - the prototype to
afs_linux_raw_open needs to be changed, as well as a few additional
call sites.

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

11 years agoRevert "osi_UFSOpen returns struct osi_file *"
Marc Dionne [Fri, 20 Nov 2009 22:50:41 +0000]
Revert "osi_UFSOpen returns struct osi_file *"

This reverts commit 4057a9941b95f7a00c57738c1810ec5abf315e97.

UFSOpen shares a prototype with MemCacheOpen because of the
afs_cacheOps structure.  This is why a void * is used.
Revert until a more complete fix can be submitted that adresses
the memcache case as well.

Change-Id: I2e259c08a0bfbc695260c981d29319c2bb7c93dd
Reviewed-on: http://gerrit.openafs.org/865
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoosi_UFSOpen returns struct osi_file *
Simon Wilkinson [Thu, 19 Nov 2009 16:34:07 +0000]
osi_UFSOpen returns struct osi_file *

The osi_UFSOpen function always returns a (struct osi_file *). Fix
the code to reflect this, rather than casting to and from (void *).

Change-Id: I3aa0bb17b547060671aa7045a8237b3926ec613f
Reviewed-on: http://gerrit.openafs.org/851
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoRemove inode hinting for dcaches
Simon Wilkinson [Wed, 18 Nov 2009 20:07:04 +0000]
Remove inode hinting for dcaches

The VNOP read code has always contained incomplete support for inode
hinting. In theory this would let us attach open cache files to dcache
structures, so that we don't have the overhead of opening the file
with every read that we do.

However, this has been ifdef'd off ever since the first release, and
is fundamentally broken - it relied upon structure elements that just
don't exist, and has no mechanism for throttling the number of inode
hints that are maintained. Inode hinting also required that we store
an inode number within the osi_file structure (so hint validity could
be checked), which causes a problem on some modern OS's.

Simplify all of this, by just removing the partial hinting support.
If we want to revisit this in the future, then the code is in git,
but if we _do_ feel we want to keep open cache files around, it's
probably better to start from scratch!

Change-Id: Ia378922f7fcc24fb27b343015dbd16818302ec10
Reviewed-on: http://gerrit.openafs.org/850
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoDefine afs_maxvcount everywhere
Andrew Deason [Wed, 18 Nov 2009 20:33:09 +0000]
Define afs_maxvcount everywhere

afs_maxvcount can be referenced by non-Linux code, so define it
everywhere, not just on Linux.

Change-Id: I6e99b6735d58823d0809a00be42a447deb3ced89
Reviewed-on: http://gerrit.openafs.org/845
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoFix prepare and commit_write to do the right thing
Simon Wilkinson [Mon, 26 Oct 2009 19:58:53 +0000]
Fix prepare and commit_write to do the right thing

Even when we're doing syncronous writeback, as we currently do
for write() operations, it's important to correctly fill, and flag
the pages we're writing to. Not doing so has a huge performance
penalty, as it means even when we've just written a page, we have to
pull it back from the backing store for a read.

This code fixes prepare_write and commit_write (for RHEL5) and
write_begin and write_end (for Fedora) to correctly populate and
flag pages which are being written.

Change-Id: Iaa2165b9b429000dcf0c6dd452e3eb8033257277
Reviewed-on: http://gerrit.openafs.org/820
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Use atomics for credential reference counts
Simon Wilkinson [Sat, 24 Oct 2009 14:08:52 +0000]
Linux: Use atomics for credential reference counts

The reference count maintained as part of the afs_cred structure
wasn't being maintained atomically, requiring that crfree and
crhold always be called with the GLOCK held.

This patch just switches to using Linux's inbuilt atomic types to
maintain the reference count.

Change-Id: I1787061afbb48e234b4839b38b8801168ea2f25f
Reviewed-on: http://gerrit.openafs.org/726
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoDefine WCOREDUMP in salvsync-server.c
Andrew Deason [Wed, 18 Nov 2009 21:43:17 +0000]
Define WCOREDUMP in salvsync-server.c

Some platforms do not define WCOREDUMP. Conditionally define WCOREDUMP
in salvsync-server.c, and make all of the similar WCOREDUMP defines in
the tree consistent.

Change-Id: I197979881ade20f6e790bf41523938089379dbe3
Reviewed-on: http://gerrit.openafs.org/846
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoFix 2 errors in Windows release Notes
Mickey Lane [Wed, 18 Nov 2009 17:23:15 +0000]
Fix 2 errors in Windows release Notes

Description of registry key HKLM\ SOFTWARE\ OpenAFS\
Client\ Server Preferences\ File (and \ VLDB) states
"256" - should be 15 - and "ServerPreferences" should
have a space between the words.

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

11 years agoWindows: cm_BkgDaemon requeuing only applies to BkgStore
Jeffrey Altman [Fri, 13 Nov 2009 18:56:20 +0000]
Windows: cm_BkgDaemon requeuing only applies to BkgStore

cm_BkgDaemon currently requeues failed requests for a variety
of errors.  It only applies to cm_BkgStore requests.  The current
code only supports cm_BkgStore and cm_BkgPrefetch operations.
Additional background operations may be added in the future.
If requeues are meant to apply to the new operations, they should
be explicitly specified.  Specify cm_BkgStore explicitly now.

LICENSE MIT

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

11 years agoWindows: Improvements to background fetch processing
Jeffrey Altman [Sat, 14 Nov 2009 21:33:31 +0000]
Windows: Improvements to background fetch processing

Log offset and length in cm_BkgPrefetch()

Convert mxheld to rwheld in cm_BkgPrefetch() now that cm_scache_t
objects use rwlocks.

Do not clear CM_SCACHEFLAG_PREFETCHING from within the error
returns from cm_CheckFetchRange().  Let the caller decide if
that is appropriate.

Add CM_BUF_CMBKGFETCH cm_buf_t cmFlag to make it possible to
quickly detect if a background fetch operation has already
been queued for a particular cm_buf_t data range.

LICENSE MIT

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

11 years agoWindows: buf_DirtyBuffersExist uses fileHashp not allp list pointer
Jeffrey Altman [Sun, 15 Nov 2009 05:11:24 +0000]
Windows: buf_DirtyBuffersExist uses fileHashp not allp list pointer

buf_DirtyBuffersExist() should use the fileHashp pointer and not
the allp list pointer in order to walk the hash table list.

LICENSE MIT

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

11 years agoWindows: Permit custom version numbers and default cellname
Jeffrey Altman [Sun, 15 Nov 2009 20:48:00 +0000]
Windows: Permit custom version numbers and default cellname

Permit custom version numbers and default cellname to be
specified using environment variables.

LICENSE MIT

Change-Id: If72430a33d8317fcb59d2f83769193e79984046c
Reviewed-on: http://gerrit.openafs.org/829
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agosrc/afs/afs_user.c typo
Andrew Deason [Wed, 18 Nov 2009 20:14:16 +0000]
src/afs/afs_user.c typo

Commit eb8e55bba7740a87e07ef07bb4b789e6d4e36f0d had a paren-related
typo. Correct it to make afs_user.c build on some platforms again.

Change-Id: Iec4634b4c0f1769c81bf9baab0d2cc53f47aaa9c
Reviewed-on: http://gerrit.openafs.org/843
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoDefine T_SRV when not defined for us
Andrew Deason [Wed, 18 Nov 2009 20:08:49 +0000]
Define T_SRV when not defined for us

Define T_SRV when we don't have a usable arpa/nameser_compat.h, just
like we do with T_AFSDB. Some platforms like AIX do not have an
easily-usable arpa/nameser_compat.h.

Change-Id: I8406a3d2b1f98d0849a1739875656432869ea3c4
Reviewed-on: http://gerrit.openafs.org/842
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoAIX: Missing brace in afs_vnop_flock.c
Andrew Deason [Wed, 18 Nov 2009 20:25:48 +0000]
AIX: Missing brace in afs_vnop_flock.c

Commit 50f6529cf1f191606f55add4cabe53fceab492ed missed a brace in the
AIX lockIDSet. Add it back to make afs_vnop_flock.c build again.

Change-Id: I09c5ee58ee5258fb904fd752213eb28a1e80291a
Reviewed-on: http://gerrit.openafs.org/844
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoviced ihandle boost
matt@linuxbox.com [Tue, 6 Oct 2009 12:42:51 +0000]
viced ihandle boost

Make ihandle file descriptor cache parameters tunable, and accommodate
platforms where max open files is large.  Expand the fd cache hash table
to 2048 entries.  Raise fd cache size automatically to match configured
number of lwps.

NOTE: This code has been tested on Centos 5.3 x86_64, on VMWare, 2 physical,
2 logical CPUs (in tandem with viced_more_threads).

LICENSE BSD

Change-Id: If68eda6e1c955e026b250ca52bddf0b8383959c9
Change-Id: I5fbbec95523ea9cd9ff42dcf43f17db94c7bb161
Reviewed-on: http://gerrit.openafs.org/584
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoName chunkOps structure elements
Simon Wilkinson [Wed, 18 Nov 2009 11:23:06 +0000]
Name chunkOps structure elements

Name the structure elements in chunkOps, to reduce the danger of
things getting misaligned when new function pointers are added.

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

11 years agofix for volser transaction object race conditions
Michael Meffie [Wed, 18 Nov 2009 19:05:02 +0000]
fix for volser transaction object race conditions

Spell AFS_PTHREAD_ENV correctly and fix
missing pthread_mutex_init() argument.

Change-Id: I9a6397ef5ba3ef7197f3d927759258be31914fd7
Reviewed-on: http://gerrit.openafs.org/841
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoLinux: Fix lock ordering
Simon Wilkinson [Mon, 16 Nov 2009 22:52:01 +0000]
Linux: Fix lock ordering

The inode mutex (or semaphore) should be held before acquiring the
alloc semaphore. Fix the lock ordering to avoid theoretical deadlocks.

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

11 years agoaklog build fix: com_err.h header
Marc Dionne [Tue, 17 Nov 2009 22:59:58 +0000]
aklog build fix: com_err.h header

Fix this build error:
aklog_main.c:67:21: error: com_err.h: No such file or directory

On some systems this system header is actually "et/com_err.h".  Cope
by checking for this at configure time and using that location if
needed.

Change-Id: Iaf4fb4fe157ff8e54aa043785377706eab6fb3d1
Reviewed-on: http://gerrit.openafs.org/836
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>

11 years agoRationalise our include paths
Simon Wilkinson [Fri, 13 Nov 2009 09:50:29 +0000]
Rationalise our include paths

Our include paths are a bit of a mess. Fix these so that they're
more rational, and more in line with normal coding style.

In particular:
   *) Don't include all of the subdirectories of our top level
      include directory. If a file wants afs/file.h, it should
      include that, not "file.h"
   *) Try to avoid including '.' in the search path (although
      objdir builds make this harder)
   *) Don't blindly include other directories from the code tree
      in the search path. If a package wants another packages header,
      then it should get it from the include directory
   *) Use the convention that quoted includes ("") pick up local
      headers. Bracketed includes (<>) pick up ones from the top level
      include dir
   *) In directories which pull in files from multiple packages, don't
      blindly put all of the package directories in the search path.
      Specifically include the file's package directory when required

The big change here is that it's no longer possible to hide a system
include by placing a header of the same name in include/afs. The most
common case where this was happening was for 'assert.h'

Change-Id: I0796fabcf83ffcd74e533624c64e138a160dd632
Reviewed-on: http://gerrit.openafs.org/834
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoktc remove unused variable
Derrick Brashear [Tue, 17 Nov 2009 01:58:11 +0000]
ktc remove unused variable

inadvertantly introduced non-linux warning (error) due to unused variable.
fix it.

Change-Id: Ie44013fdf2ff8e5d401f5598a7ec628fd887588a
Reviewed-on: http://gerrit.openafs.org/832
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoTranslate messages from ktc_SetToken
Simon Wilkinson [Fri, 13 Nov 2009 16:40:53 +0000]
Translate messages from ktc_SetToken

Error messages from ktc_SetToken weren't being passed through com_err,
leading to the confusing

   unable to obtain tokens for cell inf.ed.ac.uk (status: 11862788).

error message. Instead, call into afs_com_err here, which gives:

   a pioctl failed while obtaining tokens for cell inf.ed.ac.uk

Much nicer ...

Change-Id: Id4c7e6f6a2f52efc6ac1db9fa007ba1a452092fe
Reviewed-on: http://gerrit.openafs.org/822
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoBetter errors from aklog
Simon Wilkinson [Fri, 13 Nov 2009 16:33:52 +0000]
Better errors from aklog

Since the great com_err fracture, aklog has only returned decent
error messages from AFS, leaving Kerberos errors untranslated.
Needless to say, this causes user confusion and distress.

This patch uses the error display proc hook to call out to the real
com_err in situations where AFS can't supply an error message, giving
clearer errors for Kerberos problems.

Change-Id: I8832b755beb84c593e1b2eace5c356e71a582b2a
Reviewed-on: http://gerrit.openafs.org/821
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoasm unexecutable stack
Derrick Brashear [Thu, 12 Nov 2009 00:36:01 +0000]
asm unexecutable stack

make stack not executable in assembled files

FIXES 125491

Change-Id: I396680b6877843201f6c07d5607385044abd5e74
Reviewed-on: http://gerrit.openafs.org/818
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoWindows: Code signing with cross-signed certificates
Jeffrey Altman [Sat, 14 Nov 2009 21:24:41 +0000]
Windows: Code signing with cross-signed certificates

Permit the version of signtool.exe to be specified with
the SIGNTOOL environment variable.

Add the CODESIGN_CROSS_CERT environment variable to
specify the cross-signed certificate to be used

LICENSE MIT

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

11 years agoWindows: Error mapping for VBUSY and VRESTARTING
Jeffrey Altman [Sat, 14 Nov 2009 21:27:37 +0000]
Windows: Error mapping for VBUSY and VRESTARTING

Add error mapping for VBUSY and VRESTARTING to
cm_MapRPCError().  Return CM_ERROR_ALLBUSY.
This prevents an unknown error from being returned
to the SMB redirector.

LICENSE MIT

Change-Id: Ie8bf8bc88e087a8eef428444ca07c7ca7c4621a8
Reviewed-on: http://gerrit.openafs.org/826
Reviewed-by: Jacob Thebault-Spieker <summatusmentis@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: Use STATUS_IO_TIMEOUT where STATUS_TIMEOUT was returned
Jeffrey Altman [Sat, 31 Oct 2009 14:33:00 +0000]
Windows: Use STATUS_IO_TIMEOUT where STATUS_TIMEOUT was returned

STATUS_TIMEOUT causes the smb redirector to drop the connection.
STATUS_RETRY is interpreted by the smb redirector as if the error was
generated by the transport stack and not the smb server.
STATUS_IO_TIMEOUT is listed in the SNIA CIFS 1.0 spec as a valid
return code for the smb server.  Lets us that.

LICENSE MIT

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

11 years agoWindows: Fix port assignment to use network byte order
Jeffrey Altman [Sun, 15 Nov 2009 06:01:23 +0000]
Windows: Fix port assignment to use network byte order

Service port numbers are stored within sockaddr* structures
and returned by afsconf_FindService() in network byte order.
getAFSServer() and afsconf_GetAfsdbInfo() accept and return
service port numbers in network byte order.

When processing the special case for 7002 and 7003 in
afsconf_GetAfsdbInfo(), the comparisons must consistently
use network byte order.

When assigning port numbers for AFSDB lookups, getAFSServer()
must use network byte order.

Document the use of network byte order for each variable.

LICENSE MIT

Change-Id: I2163826e8a234a1d19474b2eba3d36335ba12afb
Reviewed-on: http://gerrit.openafs.org/830
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoWindows: ports in the cache manager are stored in network byte order
Jeffrey Altman [Wed, 21 Oct 2009 22:41:59 +0000]
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

Change-Id: Ic22a445c9f6433f9f7544774ea9952d82fcdba8a
Reviewed-on: http://gerrit.openafs.org/791
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

11 years agoMake ktc_curpag also detect ONEGROUP PAG gids
Andrew Deason [Wed, 11 Nov 2009 17:23:49 +0000]
Make ktc_curpag also detect ONEGROUP PAG gids

ktc_curpag falls back to looking at the group list if the VIOC_GETPAG
pioctl fails. If we're in AFS_LINUX26_ONEGROUP_ENV in the kernel,
though, ktc_curpag still looks for two groups, instead of the one
combined group. Add a check for the big one group in the fallback if
we're on LINUX26.

Change-Id: I28e5eda5c62f13a6fb466c8a2b04d2628706498f
Reviewed-on: http://gerrit.openafs.org/815
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

11 years agoUse set_page_writeback and end_page_writeback
Simon Wilkinson [Wed, 21 Oct 2009 22:17:15 +0000]
Use set_page_writeback and end_page_writeback

Calling set_page_writeback and end_page_writeback is necessary to
ensure that the dirty page radix tree and the page dirty flags
tally. The results of end_page_writeback are also used by the
bdi code to prioritise writeback. The Linux kernel
documentation contains further warnings of doom for what may
happen due to not calling them.

Adding set_page_writeback and end_page_writeback also allows us to
unlock the page earlier (the page can be locked any time after the
writeback flag is set). This means that we're not calling the
backing filesystem's ->write function with our pages locked, and
should help reduce contention and the potential for deadlocks there.

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

11 years agoLinux: Use the kernel's credentials structure
Marc Dionne [Thu, 29 Oct 2009 23:58:00 +0000]
Linux: Use the kernel's credentials structure

Recent kernels (2.6.29 and above) have a separate ref-counted
structure for holding credentials.  Use it directly instead of
keeping a separate afs specific structure that shadows the same
information.

Also adapt Linux for the change from cr_xxx to afs_cr_xxx wrappers.

Reference counting is done with the appropriate get/put calls.

Change-Id: I1135bb5a66cda51cee4fa9f3f3e63eaa9af28f61
Reviewed-on: http://gerrit.openafs.org/797
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoDo not check *aoutSize in PGetPAG
Andrew Deason [Wed, 11 Nov 2009 16:51:19 +0000]
Do not check *aoutSize in PGetPAG

*aoutSize is always zero in pioctls, since afs_HandlePioctl handles
checking the output buffer size, and sets outSize to 0 before calling
the pioctl. So, PGetPAG was always returning E2BIG; remove the check to
make it work.

Change-Id: Ibed16b35ea14237f44a494add8c7a4a48e0c2b71
Reviewed-on: http://gerrit.openafs.org/814
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoUpdate warning inhibition
Simon Wilkinson [Wed, 11 Nov 2009 10:34:30 +0000]
Update warning inhibition

A number of recent changes haven't caught all of the locations where
warning inhibition can be removed. This patch updates all of the
inhibitions to reflect the current state of the tree when built with
gcc4.2

Change-Id: I7bad4fee1258f4e37fd729cda84711fed66acbc9
Reviewed-on: http://gerrit.openafs.org/813
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoPrototype kalog_Init
Simon Wilkinson [Wed, 11 Nov 2009 10:32:59 +0000]
Prototype kalog_Init

Prototype the kalog_Init function in kauth_internal.h, and remove
the warning inhibition from kaserver.c

Change-Id: Ic48d199126629f1c0c2e498081be97901678ec70
Reviewed-on: http://gerrit.openafs.org/812
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoconst char paths for ubik_ServerInit
Simon Wilkinson [Wed, 11 Nov 2009 10:28:29 +0000]
const char paths for ubik_ServerInit

ubik_ServerInit* take a pathname, which should really be a const.
It already is in many of the callers, some of which remove the
const by casting, the others throw errors.

Make pathName const for all of ubik_ServerInitByInfo, ubik_ServerInit
and ubik_ServerInitCommon.
Update all of our callers to remove the now unecessary casting.
Remove the now uneccessary warning inhibition on vlserver/vlserver.c

Change-Id: I009103dc49e4473eec65ebd75aab727915c26f3c
Reviewed-on: http://gerrit.openafs.org/811
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoFix des key type issue in bosoprocs
Simon Wilkinson [Wed, 11 Nov 2009 10:19:07 +0000]
Fix des key type issue in bosoprocs

The call to afsconf_AddKey was using 'akey' rather than 'akey->data'.
As data is the first element of the akey structure, these are actually
identical, but the compiler sees it as a type error. Fix to use the
correct name, and remove the warning inhibition.

Change-Id: Id4775a836276ddd6f5ae105c298dcc3c68b92145
Reviewed-on: http://gerrit.openafs.org/810
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoPrototype UV_Bind
Simon Wilkinson [Wed, 11 Nov 2009 10:13:57 +0000]
Prototype UV_Bind

Publicly prototype UV_Bind in volser_prototypes.h

Make dump.c use the public prototype, instead of an incomplete
private copy, and remove the warning inhibition that was required to
support the private copy.

Change-Id: I945192454702d79083a10062adaf2cb124d14a35
Reviewed-on: http://gerrit.openafs.org/809
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

11 years agoRemove 'M' variants of lock macros
Simon Wilkinson [Wed, 11 Nov 2009 08:32:48 +0000]
Remove 'M' variants of lock macros

Since the beginning, we've had M variants of the lock macros, which
are identical to the normal form. Dispose of these variants, to make
it clearer what's going on.

Change-Id: I0b7708ec670ef0edb4c1dc21d472e5041d31f6a2
Reviewed-on: http://gerrit.openafs.org/807
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>