]> git.michaelhowe.org Git - packages/o/openafs.git/log
packages/o/openafs.git
14 years agolibafs: Use vcount, not maxvcount to trim vcaches
Andrew Deason [Thu, 28 Apr 2011 16:48:18 +0000 (11:48 -0500)]
libafs: Use vcount, not maxvcount to trim vcaches

Every five minutes we afs_ShakeLooseVCaches to try and return the
number of vcaches in use down to the originally configured -stat level
(when we are using dynamic vcaches). We should calculate how many
vcaches to flush based on the number of currently active vcaches
(afs_vcount), not the peak number (afs_maxvcount). Otherwise, once we
exceed the configured -stat level, we will always keep trying to flush
numerous vcaches, even if we barely have any vcaches in use.

Reviewed-on: http://gerrit.openafs.org/4584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2a2206bfe16815a6625fee4d37520e9676d88ab4)

Change-Id: I80cfbf31ba81d7cf23013c0efcea0b8ac8c341db
Reviewed-on: http://gerrit.openafs.org/4602
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: Don't read pages beyond the cache eof
Simon Wilkinson [Mon, 25 Apr 2011 18:18:39 +0000 (14:18 -0400)]
Linux: Don't read pages beyond the cache eof

If we attempt to read past the end of the current cache file (for
example, when we're extending the file with ftruncate), don't force
the backend filesystem to populate that page with non-existent data.

This will hopefully fix a bus error when using tmpfs as a backing
cache.

FIXES 128452

Reviewed-on: http://gerrit.openafs.org/4562
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 79d5b5cce65b10134004c4cb2b7b34ac509cba6a)

Change-Id: Id9956be824a4c4d8db7deb65403f4d9740758e42
Reviewed-on: http://gerrit.openafs.org/4600
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Improve deleted client log messages
Andrew Deason [Wed, 27 Apr 2011 21:24:46 +0000 (16:24 -0500)]
viced: Improve deleted client log messages

Change the information logged related to deleted clients to be a
little more useful. In particular this includes adding the client and
host refcounts, to help see if the cause is a reference count leak.

Reviewed-on: http://gerrit.openafs.org/4583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 047cc473037efa62fa7698878e055ca4665e85ef)

Change-Id: I3bfcf49587f826129979b81de95b92cb2b332790
Reviewed-on: http://gerrit.openafs.org/4593
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Avoid ref leak on origin callback break
Andrew Deason [Wed, 27 Apr 2011 19:23:43 +0000 (14:23 -0500)]
viced: Avoid ref leak on origin callback break

When breaking a callback, sometimes we send a callback to the host
that performed the callback-inducing operation. When we do this,
currently BreakCallBack gives the origin host structure to
MultiBreakCallBack_r, which avoids releasing that host after the
callback is broken.

However, BreakCallBack obtains a reference to every host to which it
delivers a callback, even if it is the origin host, so a reference is
leaked. Fix this by not ever passing a host to MultiBreakCallBack_r,
and just have MultiBreakCallBack_r release a reference for every host
to which it delivers a callback break.

FIXES 129376

Reviewed-on: http://gerrit.openafs.org/4581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit af175ce2c7a4785ef1992d096adfdb27daa86ee4)

Change-Id: Ifd59c8ce93939f7b23e9f64bd7c0e527d3a2fa52
Reviewed-on: http://gerrit.openafs.org/4592
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Transfer host ref in h_FindClient_r
Andrew Deason [Wed, 27 Apr 2011 18:51:23 +0000 (13:51 -0500)]
viced: Transfer host ref in h_FindClient_r

In h_FindClient_r, we can change which client structure we're dealing
with if we find a different client struct in the Rx conn-specific
data. We adjust the refcounts for the client structures themselves,
but not the associated hosts. While the host structures should be the
same most of the time, we are not guaranteed that, so adjust their
refcounts as well.

Reviewed-on: http://gerrit.openafs.org/4580
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9a4e3ade396583d412a85c4e03238d18d5c533ee)

Change-Id: I9ec5ed707ef6b726c358fcaa46d81b9ea1a17ce7
Reviewed-on: http://gerrit.openafs.org/4591
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Release all hosts in h_Enumerate*
Andrew Deason [Sat, 23 Apr 2011 21:52:30 +0000 (16:52 -0500)]
viced: Release all hosts in h_Enumerate*

h_Enumerate and h_Enumerate_r were not releasing all of the holds they
obtained when the callback function caused the enumeration to bail
early. Correct them so all host holds are released.

Reviewed-on: http://gerrit.openafs.org/4530
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 211e906c86be9ad9cba324e776d56093579b6653)

Change-Id: Iceb1e2961e9bbb11640c6fccdeb8713a9657df99
Reviewed-on: http://gerrit.openafs.org/4534
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Print a warning when using a deleted client
Andrew Deason [Sat, 23 Apr 2011 21:44:41 +0000 (16:44 -0500)]
viced: Print a warning when using a deleted client

We should never get a deleted client back from GetClient. Log a
message if we do, to explain why access may suddenly appear to fail,
and assist in determining why.

Note that we still try to service the request, since the accessing
user may still have enough access to do whatever was requested.

Reviewed-on: http://gerrit.openafs.org/4529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8b07814e037d19dc9868dd202e82d69b96fbdcae)

Change-Id: I0b1d9fe46e5b83b93b59ff6facc2421db9136c12
Reviewed-on: http://gerrit.openafs.org/4533
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Force valid host enumeration flags
Andrew Deason [Sat, 23 Apr 2011 21:32:10 +0000 (16:32 -0500)]
viced: Force valid host enumeration flags

Make sure that the callback functions for h_Enumerate and
h_Enumerate_r give us back valid flags values by aborting if they
return an invalid value.

Reviewed-on: http://gerrit.openafs.org/4528
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 484b5b4cf4f88a9ddd04cdbe870d9c2959ef266c)

Change-Id: Ia1b7537d7988203bd8c0bbc619c04f5b3f9387a1
Reviewed-on: http://gerrit.openafs.org/4532
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agodoc: Fix 'vos endtrans' copyright
Andrew Deason [Thu, 28 Apr 2011 18:55:09 +0000 (13:55 -0500)]
doc: Fix 'vos endtrans' copyright

SNA owns this, not me.

Reviewed-on: http://gerrit.openafs.org/4586
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c7212aaaf155f60e28bf592a13e5a50c960e5017)

Change-Id: Ib260b89ced9616d31242237048a900616ca9820b
Reviewed-on: http://gerrit.openafs.org/4601
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: Fix caching of non-existing vols
Jeffrey Altman [Sun, 1 May 2011 04:11:13 +0000 (00:11 -0400)]
Windows: Fix caching of non-existing vols

In cm_UpdateVolumeLocation() the conditional that would
trigger the immediate return of CM_ERROR_NOSUCHVOLUME
was backwards which prevented the caching from working.

cm_CheckOfflineVolumes() is called by the daemon thread
to reset the status of offline volumes.  Non-existing
volumes are by definition offline and cannot be brought
online.  Therefore, the cm_CheckOfflineVolumes() function
should skip volumes with the CM_VOLUMEFLAG_NOEXIST flag
set.

Change-Id: I65534b78842b4887d2fde67162a9d854437001ed
Reviewed-on: http://gerrit.openafs.org/4597
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4598
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRename libcom_err to libafscom_err
Ben Kaduk [Sun, 19 Dec 2010 04:52:43 +0000 (23:52 -0500)]
Rename libcom_err to libafscom_err

We no longer provide a compatible libcom_err, and in fact
we renamed the symbols in our libcom_err several years ago
to reflect this fact.
When we build on a system where KRB5_LIBS includes
-lkrb5 -lcom_err , the new Unix build system will pick up
our libcom_err (as $(AFS_LDFLAGS) is the first argument in
AFS_LDRULE and pulls in a linker search path for our libcom_err)
which does not provide all the needed symbols for libkrb5.

Fully rename our libcom_err away to avoid these conflicts.

FIXES 128640

Reviewed-on: http://gerrit.openafs.org/3547
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 352c3e366c2e0a8de4550547192276e62afd2cc1)

Change-Id: I3aa116d280fe1b0efdfda79787f53fbee336a4e3
Reviewed-on: http://gerrit.openafs.org/4572
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomacos: further next version support
Derrick Brashear [Tue, 26 Apr 2011 14:46:41 +0000 (10:46 -0400)]
macos: further next version support

try to optimize out things which will be missing

Reviewed-on: http://gerrit.openafs.org/4569
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a33f77b6e11214326f5e752de171602c0e9efe86)

Change-Id: Ie20120aad8cb477d532594b9462aca3cf993aabb
Reviewed-on: http://gerrit.openafs.org/4571
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoIRIX: set vfs pointer when creating new vcaches
Derrick Brashear [Tue, 26 Apr 2011 02:23:40 +0000 (22:23 -0400)]
IRIX: set vfs pointer when creating new vcaches

add missing call to set our vfsp on irix.

Reviewed-on: http://gerrit.openafs.org/4561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7d72a8c5c4b9df417c9337c01e8a7f26d8f6280b)

Change-Id: If0cccaa47f1110eca347734bfbaedc0456e53b21
Reviewed-on: http://gerrit.openafs.org/4579
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoLinux: Fix fallout from path_lookup commit
Marc Dionne [Wed, 30 Mar 2011 22:32:04 +0000 (18:32 -0400)]
Linux: Fix fallout from path_lookup commit

Fix a few issues with the recent commit to deal withg the removal
of path_lookup, spotted on RHEL 5:
- the configure tests needs fs.h to be included before namei.h, to
get the definition of struct inode
- we need to avoid the use of struct path unless its needed; on
older kernels the structure doesn't exist

(cherry-picked from commit f2e91cc3fe61956e7661eae9da82ddf746e63824)

Change-Id: I752976dd5a68dd4212ad2c0088f799bd6a44ffc6
Reviewed-on: http://gerrit.openafs.org/4382
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/4570

14 years agoviced: Fix host enumeration flags
Andrew Deason [Sat, 23 Apr 2011 21:25:00 +0000 (16:25 -0500)]
viced: Fix host enumeration flags

Do not give uninitialized flags values to h_Enumerate callback
functions. In fact, do not give a flags value to h_Enumerate or
h_Enumerate_r callback functions at all, since they are not actually
used.

Fix host enumeration callback functions to just return 0 or the
relevant flags, instead of basing the return value off of the given
flags value. Update MultiBreakVolumeCallBack_r to use the correct
return values, since it currently tries to use the old meanings of the
host enumeration return values.

FIXES 129376

(cherry picked from commit 5b9d427141f0a6fd0e83de9564e70ef2cfebf656)

Change-Id: Icae627318cd523fa225beb8b53449f61532c4a90
Reviewed-on: http://gerrit.openafs.org/4531
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: afskfw return error if krb5 not loaded
Jeffrey Altman [Tue, 26 Apr 2011 01:41:17 +0000 (21:41 -0400)]
Windows: afskfw return error if krb5 not loaded

If the Kerberos v5 library cannot be loaded (pkrb5_init_context
equal to NULL) return a reasonable error code instead of
returning success and doing nothing.

Change-Id: I90c106ff6bb4463c3d55d5ac1bbf225464c80c0d
Reviewed-on: http://gerrit.openafs.org/4560
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-on: http://gerrit.openafs.org/4568

14 years agoWindows: build afskfw.c without leashw32.dll
Jeffrey Altman [Tue, 26 Apr 2011 01:40:28 +0000 (21:40 -0400)]
Windows: build afskfw.c without leashw32.dll

remove our dependency on mit kfw leashw32.dll

Change-Id: Ibb5bc58dc6bf250d50ae8bd884a08449a356b6e2
Reviewed-on: http://gerrit.openafs.org/4559
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-on: http://gerrit.openafs.org/4567

14 years agoWindows: avoid preprocessor symbols redefinitions
Jeffrey Altman [Tue, 26 Apr 2011 01:29:46 +0000 (21:29 -0400)]
Windows: avoid preprocessor symbols redefinitions

In afskfw.h avoid preprocessor symbol redefinitions when
RD_AP_TIME or INTK_BADPW are already defined.

Change-Id: If123c7a7564c5dbe509ad107f2c856e96e562d33
Reviewed-on: http://gerrit.openafs.org/4558
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-on: http://gerrit.openafs.org/4566

14 years agoWindows: NPLogonNotify provide password in all cases
Jeffrey Altman [Tue, 26 Apr 2011 01:24:32 +0000 (21:24 -0400)]
Windows: NPLogonNotify provide password in all cases

When calling KFW_AFS_get_cred() from NPLogonNotify()
always provide the user password.  Do not count on a
credential cache existing from a previous call.

Change-Id: I24c51395f22c07b11107c03dc749a7c2eff694f7
Reviewed-on: http://gerrit.openafs.org/4557
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-on: http://gerrit.openafs.org/4565

14 years agowindows: improved logging from NPLogonNotify
Jeffrey Altman [Tue, 26 Apr 2011 01:23:34 +0000 (21:23 -0400)]
windows: improved logging from NPLogonNotify

Improve the detail and formatting of the windows event log
entries.

Change-Id: I28350202b954765c570582540fac180bd1f68206
Reviewed-on: http://gerrit.openafs.org/4556
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4564

14 years agoAIX51: Fix PAGs
Andrew Deason [Fri, 15 Apr 2011 16:18:37 +0000 (11:18 -0500)]
AIX51: Fix PAGs

On AIX 5.1 and later, we set a process' PAG by using the AIX PAG
mechanism (and not by group ids), but we were determining what PAG a
process was in by the group list. Instead use the PAG identifier.

This effectively reverts 277c37f48c8126ba9cb986ffc7361fcb98e2bbf2, but
it puts the kcred_getpag call in a different place that makes more
sense in the current PAG code organization.

Change-Id: Ifbc2602cfa9f32bf5d9b53b71fc67fe0761394ea
Reviewed-on: http://gerrit.openafs.org/4479
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/4503

14 years agoLinux: Restrict # of cbrs we allocate at once
Simon Wilkinson [Thu, 21 Apr 2011 15:07:05 +0000 (16:07 +0100)]
Linux: Restrict # of cbrs we allocate at once

With commit a309e274632993c5aeec04c6e090f5ac95837a40, we changed the
number of CBRs that we allocate in a chunk from 300 to 1024. However,
this change takes the amount of memory requried to allocate a chunk
of CBRs above PAGE_SIZE on Linux. This changes the allocator that we
use from kmalloc to vmalloc. Whilst we can, and do, prevent kmalloc
from flushing filesystem pages when we invoke it, we don't have a
similar level of control over vmalloc. 1.6 only: limit it back to 300
elsewhere.

In one reported case, clients deadlock whilst attempting to allocate
this memory, in a call stack that looks something like:

  afs_Daemon -> afs_ShakeLooseVCaches -> osi_TryEvictVCache
      -> afs_FlushVCache -> afs_QueueVCB -> afs_AllocCBR
      -> osi_linux_alloc -> ... -> __vmalloc_node -> ...
      -> try_to_free_pages

This is probably because we end up deadlocking in the writeback
invoked by try_to_free_pages, likely due to locks which are held
by ShakeLooseVCaches.

As a quick fix for the problem, make sure that the memory we
allocate always fits within a page, so we always use kmalloc for
it.

FIXES 129751

Reviewed-on: http://gerrit.openafs.org/4510
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3cb97cdaa867b0d9fef84c683251a0a8f59a1519)

Change-Id: I28a480788271eac1b69fb9704bed5c286be2c4c5
Reviewed-on: http://gerrit.openafs.org/4555
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: remove trailing whitespace
Jeffrey Altman [Mon, 25 Apr 2011 11:58:49 +0000 (07:58 -0400)]
Windows: remove trailing whitespace

remove trailing whitespace from

  NTMakefile
  *.h
  *.c
  *.cpp
  *.idl
  *.def
  *.txt
  *.htm

Change-Id: Ia1e44d8e15c1e4e076cc6d9bda42ffeaef943f76
Reviewed-on: http://gerrit.openafs.org/4548
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ebf5329e8ca1b3c0b581f436b28f6affe2c7c454)
Reviewed-on: http://gerrit.openafs.org/4549

14 years agoDarwin CM: afs_IsDynrootFid takes a fid ...
Simon Wilkinson [Thu, 21 Apr 2011 17:18:54 +0000 (18:18 +0100)]
Darwin CM: afs_IsDynrootFid takes a fid ...

... not a vcache.

Reviewed-on: http://gerrit.openafs.org/4511
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b178496063be6d95f301ae13c3e655c8fe94febc)

Change-Id: If77fd99c5b96b243e1a5aee10f93c75fcca3cc94
Reviewed-on: http://gerrit.openafs.org/4552
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoWindows: Remove duplicate file
Simon Wilkinson [Mon, 25 Apr 2011 12:56:38 +0000 (13:56 +0100)]
Windows: Remove duplicate file

The 'Streamfiles.txt' file had been committed with both that name,
and an all lower case name. This makes git very sad on systems with
case insensitive filenames.

Change-Id: Ifc61e8b2366d8a191279f6ccbe394e55ffe15fef
Reviewed-on: http://gerrit.openafs.org/4550
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit ce256d586468911d5501f667c53247a837378c06)
Reviewed-on: http://gerrit.openafs.org/4551

14 years agoWindows: change thyper to offset and fix error
Jeffrey Altman [Tue, 19 Apr 2011 17:17:56 +0000 (13:17 -0400)]
Windows: change thyper to offset and fix error

In cm_ReadMountPoint and cm_HandleLink the variable 'thyper'
represets the 'offset' at which cm_GetData should fetch data.
Rename 'thyper' to 'offset' and fix a coding error caused by
misinterpreting the variable purpose.

Change-Id: Icdd2493e356803b4b2bd00c7349d8d882283d29b
Reviewed-on: http://gerrit.openafs.org/4501
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4523

14 years agoWindows: avoid race when writing mountPointString
Jeffrey Altman [Tue, 19 Apr 2011 04:12:49 +0000 (00:12 -0400)]
Windows: avoid race when writing mountPointString

cm_GetData() drops the cm_scache_t rw lock which permits other
threads to access the data while it is in an inconsistent state.
Avoid the race by using a stack allocated temporary buffer to
receive the data from cm_GetData().  Only copy the data into
the mountPointStringp buffer under the rwlock.

Change-Id: Id5ab3c5ed7c76551d53fedea96eeded59c2c699d
Reviewed-on: http://gerrit.openafs.org/4498
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoaklog: Return token when performing 524 conversion
Andrew Deason [Thu, 21 Apr 2011 19:24:45 +0000 (14:24 -0500)]
aklog: Return token when performing 524 conversion

We weren't actually returning a token and username from
rxkad_get_converted_token. Do so.

This is a 1.6-specific change. This issue was fixed on master when
aklog was changed to use the new SetTokenEx family of pioctls in
commit 53837416cbed3ba4d11f63015e1f13800519f2ed.

Change-Id: I7395034c5225ca62b562ea39bd01762c74090b03
Reviewed-on: http://gerrit.openafs.org/4518
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoasetkey: permit des-cbc-md5 and des-cbc-md4 keys
Jeffrey Altman [Tue, 12 Apr 2011 15:48:27 +0000 (11:48 -0400)]
asetkey: permit des-cbc-md5 and des-cbc-md4 keys

A DES key is a DES key.  Permit importing CRC, MD5 and MD4
when using non-MIT keytab support.

Add a special error message that specifies what principal
name, kvno, and enctype were being searched for when the
error is KRB5_KT_NOTFOUND.

Change-Id: Ie04e86fc5516064a67d7804cc47f2e27a30ea7ea
Reviewed-on: http://gerrit.openafs.org/4459
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agolibafs: Do not specify an Rx busy channel error
Andrew Deason [Tue, 12 Apr 2011 21:30:55 +0000 (16:30 -0500)]
libafs: Do not specify an Rx busy channel error

Do not specify an error for Rx busy channels in libafs, so we do not
get notified of busy channel notifications. The current code just
specifies RX_CALL_TIMEOUT for the busy channel error, which has
problems (in particular, for RXAFS calls that are not wrapped in an
afs_Analyze loop). So, disable this behavior.

This is a 1.6-specific change. The master branch will instead get
fixes for this functionality, and it will get turned on in 1.6 again
as appropriate.

Change-Id: I0ed292a61ba4c8d0e59017b3dfaadc88d17591e6
Reviewed-on: http://gerrit.openafs.org/4460
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoOpenBSD: Complete implementation of afs_osi_TimedSleep
Antoine Verheijen [Mon, 28 Mar 2011 16:05:40 +0000 (10:05 -0600)]
OpenBSD: Complete implementation of afs_osi_TimedSleep

The OpenBSD version of afs_osi_TimedSleep() is missing the required
afs_event structure and afs_getevent routine. This update adds them
(by borrowing a copy of the code from the FreeBSD implementation).

Reviewed-on: http://gerrit.openafs.org/4373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a4b8823950d0d7f3806fe9e7aed22502b72a79e4)

Change-Id: I1886cbb995a6c3e6ef3d4cc73895215d6293fe15
Reviewed-on: http://gerrit.openafs.org/4388
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: 2.6.39: replace path_lookup with kern_path
Marc Dionne [Sun, 27 Mar 2011 14:59:55 +0000 (10:59 -0400)]
Linux: 2.6.39: replace path_lookup with kern_path

path_lookup is no longer available, use kern_path instead.

Reviewed-on: http://gerrit.openafs.org/4360
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7d162266c4958b22cc45d65e3f204a96c218e5f6)

Change-Id: I1c2aba273d1d597346ecb92f75caed6b6d624454
Reviewed-on: http://gerrit.openafs.org/4371
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoLinux: 2.6.39: deal with BKL removal
Marc Dionne [Sun, 27 Mar 2011 15:20:17 +0000 (11:20 -0400)]
Linux: 2.6.39: deal with BKL removal

For 2.6 kernels the OpenAFS code is already BKL free, but the
corresponding header file smp_lock.h is still included in various
places.  This header no longer exists, so remove all occurrences
outside of LINUX24.

Reviewed-on: http://gerrit.openafs.org/4361
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 9376293634393597ac7db88593100937621f6c3f)

Change-Id: I8e7e244b2e45a7a3af0505531757b8a54a0b3d29
Reviewed-on: http://gerrit.openafs.org/4370
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: change log for 1.5.9904 (1.6.0pre4)
Jeffrey Altman [Sat, 26 Mar 2011 17:05:26 +0000 (13:05 -0400)]
Windows: change log for 1.5.9904 (1.6.0pre4)

Reviewed-on: http://gerrit.openafs.org/4347
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 620ec4382fbf79908c62e4ce1e451b8743e457ac)

Change-Id: Id226e7534ca5d7fee623d3b3a24edac76b354685
Reviewed-on: http://gerrit.openafs.org/4372
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoSOLARIS: Correct ioctl syscall error handling
Andrew Deason [Fri, 25 Mar 2011 21:37:30 +0000 (16:37 -0500)]
SOLARIS: Correct ioctl syscall error handling

Do not use the return code from ioctl for errno. Ioctl itself will set
the errno and return value correctly, so don't mess with them.

Reviewed-on: http://gerrit.openafs.org/4345
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 99ed22fb02a3b44c03327a1fdd5ef56e211724b6)

Change-Id: Ie7ba95f14a2c34f11b358b482bd58bdacba6bed6
Reviewed-on: http://gerrit.openafs.org/4369
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: REALLYCLOSE origfdP after CoW
Andrew Deason [Fri, 25 Mar 2011 20:54:01 +0000 (15:54 -0500)]
viced: REALLYCLOSE origfdP after CoW

In StoreData_RXStyle, we save a pointer to the original FdHandle_t if
we need to CopyOnWrite the target vnode, for the purposes of possibly
copying additional data later on.

After the CopyOnWrite call, this points to an inode that is not in the
current volume, and is thus less likely to be accessed. In CopyOnWrite
itself, the original file handle is FDH_REALLYCLOSE'd because of this,
so the handle does not remain in the cache. Do the same in
StoreData_RXStyle, so origfdP is always FDH_REALLYCLOSE'd after we
have called CopyOnWrite.

Reviewed-on: http://gerrit.openafs.org/4344
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 55781a831954cb1e7253a12e0f9b581b586c3603)

Change-Id: I184a7e0b0ac05361c491821bc6a3756db3e24221
Reviewed-on: http://gerrit.openafs.org/4352
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agonew files for FreeBSD packaging at 1.6.0pre3
Ben Kaduk [Fri, 17 Dec 2010 06:16:30 +0000 (01:16 -0500)]
new files for FreeBSD packaging at 1.6.0pre3

Packaging for use with FreeBSD's Ports Collection.
The directory layout is flattened, and a couple of files that do not
make sense here are not included.
The afsd rc script lives in packaging/ as it is not runnable in
its committed form, it requires variable substitution that occurs
at install-time from the Ports Collection.

Reviewed-on: http://gerrit.openafs.org/4351
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7b4da89c8ed266959ec8d3ae4f6627b096206dee)

Change-Id: I0051b9d609736fc172a7c3fefd23cb910b4543e6
Reviewed-on: http://gerrit.openafs.org/4355
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoRemove outdated rc file for afsd on FBSD
Ben Kaduk [Mon, 22 Nov 2010 04:32:37 +0000 (23:32 -0500)]
Remove outdated rc file for afsd on FBSD

The semantics of rc scripts have changed drastically since this
was written.  It will need to be rewritten from scratch; the
new version will live in src/packaging/FreeBSD as afsd.in, as it
is included with the port packaging in that form.

Reviewed-on: http://gerrit.openafs.org/4350
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit dce071acef1119aceca7eb80a66c035fb03e9259)

Change-Id: I17bd69033e51bc5c59d70f982f8deb04fd18d5b4
Reviewed-on: http://gerrit.openafs.org/4354
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoRemove stale FreeBSD packaging
Ben Kaduk [Sat, 6 Nov 2010 04:30:12 +0000 (00:30 -0400)]
Remove stale FreeBSD packaging

We no longer use the Transaarc paths, and the rc environment
and packaging methods are quite different now.

Reviewed-on: http://gerrit.openafs.org/4349
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f901c0f5258c14f5d04d9b64ca5b472c468f60bd)

Change-Id: I764eb311082fbaf2b6b918f9023b53f0f3f67872
Reviewed-on: http://gerrit.openafs.org/4353
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agosalvager: Stop asking for DAFSness on SYNC_FAILED
Andrew Deason [Thu, 24 Mar 2011 22:57:32 +0000 (17:57 -0500)]
salvager: Stop asking for DAFSness on SYNC_FAILED

Break out of the loop so we stop asking the same thing repeatedly.

Reviewed-on: http://gerrit.openafs.org/4315
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c5be1f72875bcb083a9ddef4621efecf62aa880e)

Change-Id: Ia90d4d439d054b95d8ea686ab853fb2067e19d38
Reviewed-on: http://gerrit.openafs.org/4337
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: Allow the volumeSalvager to checkout volumes
Andrew Deason [Wed, 23 Mar 2011 22:38:35 +0000 (17:38 -0500)]
DAFS: Allow the volumeSalvager to checkout volumes

Reviewed-on: http://gerrit.openafs.org/4298
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ad0afb57b9172bb7cfa0853b5f34259c0958d248)

Change-Id: I1eac22970f5665c7bdb2138ae380b59263836d99
Reviewed-on: http://gerrit.openafs.org/4336
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoadd AFS_DEMAND_ATTACH_UTIL
Derrick Brashear [Thu, 24 Mar 2011 20:11:17 +0000 (16:11 -0400)]
add AFS_DEMAND_ATTACH_UTIL

use this for non-pthreads "support code" e.g. salvager.

Reviewed-on: http://gerrit.openafs.org/4312
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 04bcfa2821c9deba151f562bb78452276d8d7443)

Change-Id: If956be50059ac128b5880131f961342c2661e5b7
Reviewed-on: http://gerrit.openafs.org/4335
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: trailing dot not part of volume name
Jeffrey Altman [Fri, 25 Mar 2011 12:58:20 +0000 (08:58 -0400)]
Windows: trailing dot not part of volume name

When dynamically adding new cell mount points to the Freelance
directory do not include a trailing dot when specifying the root.cell
volume name.

Change-Id: I23e47791b412f8f6260ca921daaf0200b19f4179
Reviewed-on: http://gerrit.openafs.org/4334
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoWindows: avoid recursive cm_CheckOfflineVolume
Jeffrey Altman [Wed, 16 Mar 2011 06:17:38 +0000 (02:17 -0400)]
Windows: avoid recursive cm_CheckOfflineVolume

Add a new cm_req_t flag CM_REQ_OFFLINE_VOL_CHK which is used
to prevent cm_Analyze() from performing recursive
cm_CheckOfflineVolume operations that will exhaust the stack.

Reviewed-on: http://gerrit.openafs.org/4240
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 11ad1e467f9708f12fe09228cbb827b8f4e1225b)

Change-Id: I3385d7b5a90e77ba8d6c87b9f29f39b62c17bb23
Reviewed-on: http://gerrit.openafs.org/4314
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
14 years agoDAFS: Do not VDeregisterVolOp_r while exclusive
Andrew Deason [Wed, 23 Mar 2011 16:07:03 +0000 (11:07 -0500)]
DAFS: Do not VDeregisterVolOp_r while exclusive

We should wait for a volume to transition out of an exclusive state
before calling VDeregisterVolOp_r on a volume, since some code may be
examining the vol op outside of VOL_LOCK in an exclusive state. We
should be doing this anyway before performing volume state checks,
since we may be trying to e.g. attach the volume at the same time.

Reviewed-on: http://gerrit.openafs.org/4287
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d4ebebd0c3f89b65e93f0da6d53665271e6d2a61)

Change-Id: I55f07806a4e089577252ddb527a86142b10f797d
Reviewed-on: http://gerrit.openafs.org/4306
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCorrectly document the AFS client setuid defaults
Russ Allbery [Thu, 24 Mar 2011 19:56:56 +0000 (12:56 -0700)]
Correctly document the AFS client setuid defaults

AFS no longer honors setuid status by default.  Update the admin
guide documentation appropriately and add a warning recommending
against enabling setuid status given the limitations of the current
AFS protocol.

Reformat this section of the admin guide to make it easier to
maintain.

Reviewed-on: http://gerrit.openafs.org/4311
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7b00c17b49fe6a54f99f3c23bfc307a4b10d88e2)

Change-Id: I0dd638c37a116f39f93f08cc41c400f43a685940
Reviewed-on: http://gerrit.openafs.org/4313
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoUpdate NEWS for 1.6.0pre3 release
Russ Allbery [Tue, 22 Mar 2011 09:04:46 +0000 (02:04 -0700)]
Update NEWS for 1.6.0pre3 release

Add additional NEWS entries from the 1.6.0pre3 release notes.

Reviewed-on: http://gerrit.openafs.org/4270
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d4e8b729d8f216e9f033e95194740ff4cb566688)

Change-Id: Ic64819d6182c57e081e0e0d85c3629a3f7c11ed3
Reviewed-on: http://gerrit.openafs.org/4310
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoUpdate 1.6 NEWS entry based on 1.6.0pre2 release notes
Russ Allbery [Mon, 14 Feb 2011 20:36:18 +0000 (12:36 -0800)]
Update 1.6 NEWS entry based on 1.6.0pre2 release notes

Reviewed-on: http://gerrit.openafs.org/3950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f378dcf785967374309523a02ea06d6d1a3ff148)

Change-Id: Ic5625c6eb32238b177716c0f87ea6e62521a9de8
Reviewed-on: http://gerrit.openafs.org/4309
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agorpm: Build srpms without %dist in their name
Simon Wilkinson [Wed, 23 Mar 2011 15:35:35 +0000 (15:35 +0000)]
rpm: Build srpms without %dist in their name

On RHEL6, %dist is set for all RPMS and SRPMS built on the system. This
leads to makesrpm.pl building SRPMS with .el6 in their release. As we
endeavour to use the same SRPM on all of our Fedora platforms, this is
less than ideal, so change makesrpm.pl to squash the setting of %dist
before building the RPM.

Reviewed-on: http://gerrit.openafs.org/4285
Reviewed-by: Alexander Ivan Redinger <aredinger@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b0921071dd1b4d460d406985bba9619561444055)

Change-Id: I9e5bb2ce13378a0927763535d885a4728bd48f06
Reviewed-on: http://gerrit.openafs.org/4307
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agomacos next support
Derrick Brashear [Wed, 23 Mar 2011 18:17:25 +0000 (14:17 -0400)]
macos next support

first brush at supporting next macos. totally not lion about it.
(cherry picked from commit XXX)

Change-Id: I4ede2a940c3881b588117c2b80f62f71563e78ce
Reviewed-on: http://gerrit.openafs.org/4291
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoosconf: reduplicate systype stuff
Derrick Brashear [Wed, 23 Mar 2011 18:11:31 +0000 (14:11 -0400)]
osconf: reduplicate systype stuff

in some cases there is more to do, and in some cases we probably
already didn't build anymore, but, let's simplify.
(cherry picked from commit XXX)

Change-Id: I48248c2fc081413536763f09608e00153c4ea3ee
Reviewed-on: http://gerrit.openafs.org/4292
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: Correct VolumeNumber for large volume IDs
Andrew Deason [Fri, 11 Mar 2011 00:37:44 +0000 (18:37 -0600)]
vol: Correct VolumeNumber for large volume IDs

VolumeNumber was using atoi to convert a volume header name to a
volume ID. This can return just -1 for volume IDs larger than 2^31-1,
though, so use strtoul instead.

Reviewed-on: http://gerrit.openafs.org/4199
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0f1c921fa1738c383fd576e287f356dd13f92a58)

Change-Id: Ib56d3f77f0d90f5ad55b3c0de89632d271436f7e
Reviewed-on: http://gerrit.openafs.org/4284
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agosalvager: Fix volume parsing on 64-bit
Andrew Deason [Wed, 16 Mar 2011 19:44:56 +0000 (14:44 -0500)]
salvager: Fix volume parsing on 64-bit

When an unsigned long is wider than an afs_uint32, comparing the
afs_uint32 vid to ULONG_MAX is always going to be false (which the
compiler can warn us about). Fix this by storing to an unsigned long,
and converting to a volume id after ensuring that the result is not
too large.

(cherry picked from commit ce5e263b488f8cb85662031ee08eea448dab2d27)
Reviewed-on: http://gerrit.openafs.org/4244
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: Iec2d640daed1e9c175d17823750f272297f890a7
Reviewed-on: http://gerrit.openafs.org/4283
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Actually print client CPS
Andrew Deason [Thu, 17 Mar 2011 15:43:23 +0000 (10:43 -0500)]
viced: Actually print client CPS

Client CPS was not getting output on SIGXCPU like the rest of the
client information, since the conditional in the CPS loop was never
true. Fix this so we traverse the CPS entries correctly.

Reviewed-on: http://gerrit.openafs.org/4256
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5df51a82947f0ff60d57f551c5faa136ad7f6e0f)

Change-Id: Ic710d9ab4da5dc1fdb4a1ffca72590b043bff918
Reviewed-on: http://gerrit.openafs.org/4282
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: fix forceDAFS support in salvager
Derrick Brashear [Wed, 8 Dec 2010 02:26:59 +0000 (21:26 -0500)]
DAFS: fix forceDAFS support in salvager

we need to get the shared partition lock for the per-volume
forceDAFS case

Reviewed-on: http://gerrit.openafs.org/3487
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 81e7a5adf93a6b5eec104ca4bde429cf6cb0548a)

Change-Id: Ie7c6a43d25c621a3faca2a6564fbc06f9af87880
Reviewed-on: http://gerrit.openafs.org/4278
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: allow salvager to detect whether FSYNC server is DAFS
Derrick Brashear [Wed, 8 Dec 2010 02:23:53 +0000 (21:23 -0500)]
DAFS: allow salvager to detect whether FSYNC server is DAFS

in order to enable the right commands and print the right errors,
query for DAFS-only FSYNC op.
doesn't use bozo InstanceInfo as it's possible you can run fileserver
outside of bos.

(cherry picked from commit b9ecf28c6c7c232823ac9b44cd00db9afab81c91)
Reviewed-on: http://gerrit.openafs.org/3486
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: If53edc8d100d5eacaf4aaad9feee96211e24e1a2
Reviewed-on: http://gerrit.openafs.org/4277
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoopenafs 1.6.0pre4
Derrick Brashear [Wed, 23 Mar 2011 14:54:15 +0000 (10:54 -0400)]
openafs 1.6.0pre4

set version for 1.6.0pre4, and phasers for stun.

Change-Id: I43e36633b679f9af6156025842f2e1556fcbb17b
Reviewed-on: http://gerrit.openafs.org/4276
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorpms: Use new CellServDB
Simon Wilkinson [Thu, 17 Mar 2011 19:14:39 +0000 (19:14 +0000)]
rpms: Use new CellServDB

Update the CellservDB referenced by the spec file to the latest one
from grand.central.org

Reviewed-on: http://gerrit.openafs.org/4257
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 71380ee4f3522ba64ed60724a928f8efc16ca132)

Change-Id: I0f08b145073faca5d0dda2c6460e57dc448b3450
Reviewed-on: http://gerrit.openafs.org/4281
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorpms: Make makesrpm.pl cater for new rpm names
Simon Wilkinson [Thu, 17 Mar 2011 19:28:23 +0000 (19:28 +0000)]
rpms: Make makesrpm.pl cater for new rpm names

Starting from 1.6.0, our specfile no longer adds a stray '1.' to the
start of the release field. makesrpm.pl was failing to deal with
these new-style names and therefore not actually making an rpm.

Fix this by conditionalising on the OpenAFS version when selecting
which rpm to copy.

Reviewed-on: http://gerrit.openafs.org/4258
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit af854b4e2f19e5f1a83b686e99ca3dd6122af942)

Change-Id: I95bc506e1113d0054b2aaca3a301551de1f086db
Reviewed-on: http://gerrit.openafs.org/4280
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoutil: Fix exec_alt
Simon Wilkinson [Sun, 20 Mar 2011 21:13:09 +0000 (21:13 +0000)]
util: Fix exec_alt

exec_alt was failing its tests on Mac OS X (but passing them on Linux).

It turns out that this is because it was failing to NULL terminate the
string that it creates in construct_alt(), which copies in the
characters from argv0, prefix and suffix, but never copies in a trailing
NULL.

Amend the code so that the trailing NULL from suffix is used to
terminate the string.

Reviewed-on: http://gerrit.openafs.org/4267
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8c418408016ff8d6be9f85c4666a49954f61dbd0)

Change-Id: Ie34832eb94f91a6e9083f65aa81333cb7b1fbb30
Reviewed-on: http://gerrit.openafs.org/4279
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovclosevnodefiles-ihandle-leak-20090216
Jeffrey Altman [Tue, 17 Feb 2009 04:37:27 +0000 (04:37 +0000)]
vclosevnodefiles-ihandle-leak-20090216

LICENSE IPL10
FIXES 124359

don't leak ihandles on close. this isn't a complete fix for the issue
(cherry picked from commit b9816e12f7ed8213c9c4eaea09e992e69ce4ee05)

This reverts the part of 12e85227c5dbfdb1258718ee3360bffacc4f96ac that
reverted b9816e12f7ed8213c9c4eaea09e992e69ce4ee05.

Reviewed-on: http://gerrit.openafs.org/4272
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ef9fc4fadaded1c0ea067b2fd1d423df826606ae)

Change-Id: Ieeea51fd247ff4fc1b1da03c94a905c293b9fb7e
Reviewed-on: http://gerrit.openafs.org/4275
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoosx: prefs pane should properly detect version
Derrick Brashear [Thu, 17 Mar 2011 04:11:43 +0000 (00:11 -0400)]
osx: prefs pane should properly detect version

we use "new" afs conf after 1.4.6 or 1.5.36. detect correctly

Reviewed-on: http://gerrit.openafs.org/4254
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 0016e013aa012e179e7ac4c59b19a0ee1cbd0840)

Change-Id: I6796dee249eccd7646359deb8f29322b9954f803
Reviewed-on: http://gerrit.openafs.org/4269
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoosx: decode-panic should work in add-kext only land
Derrick Brashear [Thu, 17 Mar 2011 05:25:35 +0000 (01:25 -0400)]
osx: decode-panic should work in add-kext only land

in 64 bit 10.6, you need add-kext (not add-symbol-file)
to decode a panic. deal accordingly

Reviewed-on: http://gerrit.openafs.org/4255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c4744cc699be19fffb49f39f469e91ef6aac6585)

Change-Id: I3de2c4799ff1a552e67d4398b76e8736ba2abf7e
Reviewed-on: http://gerrit.openafs.org/4268
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoMacOS: allow cdead vcaches to be found in FindVCache if requested
Derrick Brashear [Thu, 20 Jan 2011 04:11:11 +0000 (23:11 -0500)]
MacOS: allow cdead vcaches to be found in FindVCache if requested

if we are trying to find a dead vcache, let it be found, don't immediately
attempt to recycle

FIXES 128511

(cherry picked from commit d73d9a1011cc3e1e5acfbc970434373f732c066e)

Change-Id: I4dde25e54e3d76faff58c8e42d0949493aa986f3
Reviewed-on: http://gerrit.openafs.org/4243
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agomacos: kernel socket upcall
Derrick Brashear [Wed, 16 Mar 2011 05:06:43 +0000 (01:06 -0400)]
macos: kernel socket upcall

support kernel socket upcall instead of listener env

(cherry picked from commit c10f5296d26eac9ac00018199ef579e8f6095c07)

Change-Id: Iaad3138106475219194772491d3e0915d60c466e
Reviewed-on: http://gerrit.openafs.org/4238
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoviced: Allow checkout of VOL_STATE_DELETED volumes
Andrew Deason [Thu, 30 Sep 2010 17:39:22 +0000 (12:39 -0500)]
viced: Allow checkout of VOL_STATE_DELETED volumes

The fileserver allows nonexistent volumes to be checked out. Since
VOL_STATE_DELETED volumes conceptually do not exist, we should also
allow them to be checked out.

Reviewed-on: http://gerrit.openafs.org/2873
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 88fc9ada4cfaee354199480916d139400ee0ef5b)

Change-Id: I24bf2100bf57a27323cd0e9e5081e767e67c944e
Reviewed-on: http://gerrit.openafs.org/4261
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoThrow the compiler a bone ...
Simon Wilkinson [Tue, 15 Mar 2011 21:48:43 +0000 (21:48 +0000)]
Throw the compiler a bone ...

... failing that, a semi colon.

Reviewed-on: http://gerrit.openafs.org/4234
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ffdc040d560a461abd59602ad62ba2fbf150227f)

Change-Id: I6dc924df277da7e650d6ae26f8520b23be10db3e
Reviewed-on: http://gerrit.openafs.org/4235
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: permit code signing without timestamps
Jeffrey Altman [Mon, 29 Nov 2010 22:47:10 +0000 (17:47 -0500)]
Windows: permit code signing without timestamps

If CODESIGN_TIMESTAMP is not defined, permit code signing
to occur but do not ask signtool to contact a timestamp
server.

Change-Id: Iaac89f8db96c9428481a638fc72f8d14c53e2045
Reviewed-on: http://gerrit.openafs.org/3393
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-on: http://gerrit.openafs.org/4231

14 years agoWindows: Add CODESIGN_OTHER option to make signtool rules
Jeffrey Altman [Thu, 18 Nov 2010 02:42:00 +0000 (21:42 -0500)]
Windows: Add CODESIGN_OTHER option to make signtool rules

Some organizations may need to pass additional parameters to
signtool.exe.  Add the optional CODESIGN_OTHER value to permit
arbitrary additional parameters to be specified.

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

14 years agoLinux: Fix return codes from setpag
Simon Wilkinson [Tue, 15 Mar 2011 00:45:45 +0000 (00:45 +0000)]
Linux: Fix return codes from setpag

Linux is a real stickler when it comes to error codes. Functions
which return positive error codes into the kernel tend to have
unfortunate effects. Because all AFS errors tend to be positive,
most of our kernel entry points negate errors before passing them
back to their caller.

This causes problems when internal functions themselves return
negative error codes. This was the case with the keyring functions,
which ended up returning a negative code to setpag(), this handed
that code ultimately up to the ioctl handler, which negated it (so
turning it positive) before throwing it up to the kernel.

The kernel sees this positive value as being a successful return,
and so passes it direct to userland, rather than assigning it to
errno. This led to the setpag() userspace function never being
aware of keyring errors that had occurred in the kernel.

Fix all this by making sure that all errors from the keyring code
are made positive before being passed upwards in the kernel module.

Reviewed-on: http://gerrit.openafs.org/4223
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3d92852ba99bc7591515992dfea3436d93c23b85)

Change-Id: I72177ad2ee6d0a2c2c3f6d6819289a761b2712f0
Reviewed-on: http://gerrit.openafs.org/4226
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRevert "Linux: normalize error return for emulated syscalls"
Simon Wilkinson [Tue, 15 Mar 2011 00:06:19 +0000 (00:06 +0000)]
Revert "Linux: normalize error return for emulated syscalls"

This reverts commit 0bc837f68a72ba1f75d940cc5dd057774d9f36bb.

Sadly, this change fixed setpag(), but broke all of the pioctls. The
problem is actually a little more nuanced than we at first thought.
What's happening is yet another case of Linux's special handling of
negative return values. When an ioctl handler returns a negative
return code to the kernel, it does errno = -code, and sets the
return code to -1. If you pass it a postive return code, however,
it just returns that straight to the application.

The pioctl code gets this right. However, the setpag code doesn't,
and so tries to return postive values, which is why ioctl appears
to be returning the error code in the return value, not in the
errno.

Reviewed-on: http://gerrit.openafs.org/4222
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ff2933a122ddf9421ebcacdc7e4ec5f44333f894)

Change-Id: Ibfb050552f8b2357e57139976e2bc42ce6187f4f
Reviewed-on: http://gerrit.openafs.org/4225
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: 1.6pre3 changes
Jeffrey Altman [Tue, 15 Mar 2011 02:55:26 +0000 (22:55 -0400)]
Windows: 1.6pre3 changes

Change-Id: Ia4d504c2f9478f88c219375b92cdcb203defddfc
Reviewed-on: http://gerrit.openafs.org/4228
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: mp target trailing dot not part vol name
Jeffrey Altman [Fri, 4 Mar 2011 16:04:40 +0000 (11:04 -0500)]
Windows: mp target trailing dot not part vol name

Instead of passing "root.cell." into cm_FreelanceAddMount
pass in "root.cell" and add the trailing dot within the function.

Reviewed-on: http://gerrit.openafs.org/4124
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 0d1335ad7104a6fa67525b84d70a33e7bb1b6c6a)

Change-Id: I27b077c7fd9e8ea5cb67da96b5172d69623e1122
Reviewed-on: http://gerrit.openafs.org/4221
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: avoid use of cm_buf for MPs and Symlinks
Jeffrey Altman [Wed, 2 Mar 2011 19:06:48 +0000 (14:06 -0500)]
Windows: avoid use of cm_buf for MPs and Symlinks

In the Windows cache manager, the symlink and mount point
target strings are stored in the cm_scache_t mountPointString
and are not accessed out of the cm_buf_t for offset zero
except when populating the mountPointString.  As a result,
every mountpoint and symlink object that is read into the cache
wastes a cm_buf_t which could otherwise be used to store
additional file or directory data.

Add cm_GetData() function which is similar to cm_GetBuffer()
except that it reads data from the file server into an arbitray
memory location instead of a cm_buf_t object.  Use cm_GetData()
to read directly into the cm_scache_t object.

In addition, further optimize the communication with the
file server by using cm_GetData() to perform a RXAFS_FetchData
RPC to obtain both the target string and the status information
instead of RXAFS_FetchStatus which only returns the status
information in cases where there are no outstanding callback
registrations on the object.  RXAFS_FetchStatus is still used
when a callback is active in order to obtain access permissions
for new users.

Reviewed-on: http://gerrit.openafs.org/4111
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit dec0ba1cfaf7dd6a4ed23a2f656bd6272600d51c)

Change-Id: I2ffa85193ffeb35c9558224985ba7485ec617712
Reviewed-on: http://gerrit.openafs.org/4220
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoreadme typos
Michael Meffie [Mon, 14 Mar 2011 14:15:35 +0000 (10:15 -0400)]
readme typos

Fix two typos in README.

Reviewed-on: http://gerrit.openafs.org/4218
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ba67ef96bb5216ecb03d656af22b3b7f7542efef)

Change-Id: Id202785ee2568bd625c1e781574d21dae3488982
Reviewed-on: http://gerrit.openafs.org/4219
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agopt_util: Initialise empty database correctly
Simon Wilkinson [Sun, 13 Mar 2011 14:45:04 +0000 (14:45 +0000)]
pt_util: Initialise empty database correctly

Commit dc8f18d6f5003712bc9ef989363137a84953df07 broke pt_util's
initialisation of empty databases. This is because Initdb was changed
to call Initdb_check through the ubik_CheckCache wrapper. However, that
wrapper was defined as a no-op in pt_util's ubik-shim.

Modify pt_util's ubik_CheckCache so that it always calls into the
wrapper routine - this mimics the old behaviour.

Add a trival test for pt_util - check that we can build the database,
using the example from the manpage, and then that the built database
matches what we expect.

(cherry picked from commit 4953ce8070497bc494e624d72271bcbc5dc1dbe7)
Reviewed-on: http://gerrit.openafs.org/4211
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: If4cfbda25f8d1c5e1da4c1e42982c74becf386e3
Reviewed-on: http://gerrit.openafs.org/4217
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: conditionally set tray icon state
Jeffrey Altman [Fri, 19 Nov 2010 05:07:36 +0000 (00:07 -0500)]
Windows: conditionally set tray icon state

If the checkbox IDC_TRAYICON is not present in the dialog,
do not attempt to use its value as a setting for
Config_SetTrayIconFlag().

FIXES 128591

Change-Id: Iff5ef4993f082e73cca93e79d17f49cc15b6264f
Reviewed-on: http://gerrit.openafs.org/3331
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/4207

14 years agomake openafs 1.6.0pre3
Derrick Brashear [Fri, 11 Mar 2011 13:27:24 +0000 (08:27 -0500)]
make openafs 1.6.0pre3

create version 1.6.0pre3 in the various bits we need it

Change-Id: Ia5768d097b1f4fa0df911db6d9d094584405c4db
Reviewed-on: http://gerrit.openafs.org/4205
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agosolaris: fix typo in the solaris 11 startup script
Chas Williams (CONTRACTOR) [Fri, 11 Mar 2011 18:33:50 +0000 (13:33 -0500)]
solaris: fix typo in the solaris 11 startup script

/etc/devlink.tab not /dev/devlink.tab

Reviewed-on: http://gerrit.openafs.org/4206
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7e68671f6acf66b568672d94b37ef456b1de8813)

Change-Id: I88f9ae47fcbb2878cc099fe783c72c32cc0b4a92
Reviewed-on: http://gerrit.openafs.org/4208
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoSOLARIS: Free vcache mappings on shutdown
Andrew Deason [Tue, 7 Dec 2010 16:50:31 +0000 (10:50 -0600)]
SOLARIS: Free vcache mappings on shutdown

Right before shutdown, go through all of our vcaches and flush them,
freeing any pages associated with the vcaches. If we don't do this,
pages associated with our vcaches may still be around after we
shutdown and the module is unloaded, causing a panic when the kernel
tries to deference the page's vnode.

Abstract out afs_freevfs() following the gafs_foo/afs_foo convention
from the vnode ops, since we're calling this in two different places.

Reviewed-on: http://gerrit.openafs.org/3472
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 592a33a4787db88993a7bf9d8f5ad8c11a576b56)

Change-Id: I809d10d2eceb7d0db92b3d149b13de0dc9221958
Reviewed-on: http://gerrit.openafs.org/4194
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agolinux: defer vcache evictions when sleep would be needed
Derrick Brashear [Thu, 17 Feb 2011 05:04:06 +0000 (00:04 -0500)]
linux: defer vcache evictions when sleep would be needed

because we're only willing to loop 100 times worth of "sleeps",
on a machine with heavy vcache demands we can end up just growing
the list huge. in the first pass, just clean up as many entries which
do not require sleeping as needed. if we need more entries, make
a second pass.

Reviewed-on: http://gerrit.openafs.org/3971
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3105c7ff0b4ae9c372dc4c1424f63b7f259dcda1)

Change-Id: Iced11ca56ced5971ab0cb8dbb65d275754ec33d5
Reviewed-on: http://gerrit.openafs.org/4186
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: handle rx busy call channel
Jeffrey Altman [Wed, 9 Mar 2011 12:51:02 +0000 (07:51 -0500)]
Windows: handle rx busy call channel

Register an error code for rx busy call channel detection.
Force a retry whenever CM_RX_BUSY_CALL_CHANNEL is received
by cm_Analyze().  Log the event to both the internal trace
log and the Windows Event Log along with the server address.

Reviewed-on: http://gerrit.openafs.org/4183
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 75c2f96364d598ec0c134cb6b366ce067b8b7f49)

Change-Id: I932c3d1fdb89f697347c0acc06dc628b3b6175da
Reviewed-on: http://gerrit.openafs.org/4185
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorpm: fix ChangeLog filename in doc rpm
Michael Meffie [Fri, 4 Mar 2011 01:22:54 +0000 (20:22 -0500)]
rpm: fix ChangeLog filename in doc rpm

Fix an rpmbuild error introduced in commit 8d157961.

(cherry picked from commit 8f8522e457eb7703f85da3a193134c50bcd8b6cf)

Change-Id: I69b402b1a31bfa1b5e5a14a3a86bc0d3fab7f842
Reviewed-on: http://gerrit.openafs.org/4184
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRX: Avoid timing out non-kernel busy channels
Andrew Deason [Mon, 7 Mar 2011 17:08:26 +0000 (11:08 -0600)]
RX: Avoid timing out non-kernel busy channels

When we encounter a "busy" call channel (indicated by receiving
RX_PACKET_TYPE_BUSY packets), we can error out a call with
RX_CALL_TIMEOUT to try and get the application code to retry the call.
However, many RX applications are not aware of this, and will just
fail with an error upon receiving a single busy packet.

So instead, make this behavior optional, and only do it if the
application tells us what specific error it expects to receive when a
busy call channel is detected. Enable this behavior for the Unix cache
manager, as it can cope with receiving an RX_CALL_TIMEOUT error in
this scenario.

Bump shlibafsrpc minor version to 5 instead of 3, so we don't collide
with the shlibafsrpc versions on the master branch.

Reviewed-on: http://gerrit.openafs.org/4159
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit eddcee3ad518dff9fbfda790640c5bfd2e97ef5a)

Change-Id: I38981ad3e3c2cbb03c516c02481a2f44cb5f9acf
Reviewed-on: http://gerrit.openafs.org/4182
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: Check for blank vnode in VAllocVnode_r
Andrew Deason [Fri, 25 Feb 2011 22:58:30 +0000 (16:58 -0600)]
vol: Check for blank vnode in VAllocVnode_r

When we alloc a vnode in VAllocVnode_r, we look up that vnode in the
vnode cache, to see if a vnode struct already exists for it. If it
doesn't, we check the vnode index to ensure that the vnode actually is
not in use (among other things). However, we do not perform the same
check for a vnode already in the cache. Add this check, to make sure
that we don't allocate an already-used vnode number, even if the
bitmap is screwed up.

Reviewed-on: http://gerrit.openafs.org/4060
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 974e95302a312c03cd735c0fdaa67fb02d254e26)

Change-Id: Ie75dc32c2a2c1ff05a96a1a14650e41ada07609d
Reviewed-on: http://gerrit.openafs.org/4170
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: VnLock after VnWaitQuiescent in VAllocVnode
Andrew Deason [Fri, 25 Feb 2011 22:01:32 +0000 (16:01 -0600)]
DAFS: VnLock after VnWaitQuiescent in VAllocVnode

In VAllocVnode, we write-lock the newly-allocated vnode. In DAFS,
however, we need to VnWaitQuiescent_r before VnLock'ing, since VnLock
in DAFS just sets the writer tid/pid. So, in VAllocVnode, move the
VnLock call to after we wait for quiescence, so we don't stomp over
the vnode when someone else has it write-locked.

Reviewed-on: http://gerrit.openafs.org/4059
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b41575d176c2d485d55aed8780bfab9db4b7587d)

Change-Id: I6c3d68f0f5248308d0f32e9fad5c540aaf593962
Reviewed-on: http://gerrit.openafs.org/4169
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: Wait for exclusive ops in VFreeBitMapEntry_r
Andrew Deason [Fri, 25 Feb 2011 20:43:09 +0000 (14:43 -0600)]
DAFS: Wait for exclusive ops in VFreeBitMapEntry_r

VAllocBitmapEntry_r puts the volume in an exclusive state and drops
VOL_LOCK when traversing the volume bitmap and updating the bitmap.
So, VFreeBitMapEntry_r must ensure the volume is not in an exclusive
state, to make sure that VAllocBitmapEntry_r is not updating the
bitmap at the same time. Do so, by waiting for the volume to come out
of exclusive state at the beginning of VFreeBitMapEntry_r.

Reviewed-on: http://gerrit.openafs.org/4058
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 08ffe3e81d875b58ae5fe4c5733845d5132913a0)

Change-Id: I0336bbc543828237cb9ae97ede18133b4e15100a
Reviewed-on: http://gerrit.openafs.org/4168
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol-salvage: VOL_DONE deleted volumes
Andrew Deason [Wed, 2 Mar 2011 20:11:43 +0000 (14:11 -0600)]
vol-salvage: VOL_DONE deleted volumes

When the salvager deletes a volume (because it is an invalid RO clone,
or because there is no data associated with the volume), we should
inform the fileserver that the volume is gone. Otherwise, the volume
in the fileserver can get put into an error state (in DAFS) when it
tries to attach the volume, preventing anything from creating or using
that volume.

Reviewed-on: http://gerrit.openafs.org/4118
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit a862d2df93fd4e8c8c7a0b8eebe9e59b75f54072)

Change-Id: I4ec62d4c6b06678af6e8e499e9dafb2d0698c9ab
Reviewed-on: http://gerrit.openafs.org/4167
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: Clear salvage stats on VOL_DONE
Andrew Deason [Wed, 2 Mar 2011 21:39:51 +0000 (15:39 -0600)]
DAFS: Clear salvage stats on VOL_DONE

When we VOL_DONE a volume, the volume has been deleted, so the salvage
stats/information are no longer relevant. Clear them out, so we don't
think the volume is still salvaging.

Reviewed-on: http://gerrit.openafs.org/4120
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 40049c56791f3488640ae65c5dc5c4d6503375bd)

Change-Id: I1c7f61994b050de7bd8c0e7fc39df978a31530a6
Reviewed-on: http://gerrit.openafs.org/4166
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: Allow LEAVE_OFF for DELETED volumes
Andrew Deason [Wed, 2 Mar 2011 21:02:40 +0000 (15:02 -0600)]
DAFS: Allow LEAVE_OFF for DELETED volumes

When a volume is VOL_STATE_DELETED, it effectively does not exist to
other programs over FSSYNC. So, do not prevent someone from issuing a
FSYNC_VOL_LEAVE_OFF for a VOL_STATE_DELETED volume.

Reviewed-on: http://gerrit.openafs.org/4119
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit ddf5ae4f746f2b5e522e10cfcacb6225499e7956)

Change-Id: I840930e144260036e2c96d83134a79dee3c9d083
Reviewed-on: http://gerrit.openafs.org/4165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol-salvage: calloc volume summary structs
Andrew Deason [Wed, 2 Mar 2011 20:10:33 +0000 (14:10 -0600)]
vol-salvage: calloc volume summary structs

Calloc volume summary structs instead of malloc'ing them, in
vol-salvage.c. This way, new fields added to struct VolumeSummary will
be known to be zeroed by default, without needing to update all of the
allocating callers.

Reviewed-on: http://gerrit.openafs.org/4117
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit bb25fc6418bac937b31476754a09199636c24211)

Change-Id: I9533d4f841ebc64bdf49c145512471ebbb51136e
Reviewed-on: http://gerrit.openafs.org/4164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agosalvager: Do not break cbks when salvaging parts
Andrew Deason [Wed, 29 Sep 2010 16:48:44 +0000 (11:48 -0500)]
salvager: Do not break cbks when salvaging parts

When salvaging whole partitions / whole servers, the fileserver is
assumed to not be running. So only break callbacks if we are salvaging
a single volume. If we are salvaging a whole partition, do not tell
the fileserver to break callbacks on changed volumes, since the
fileserver will not be around and we will just hang.

Reviewed-on: http://gerrit.openafs.org/2865
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fabd590cc4b0142fe97c4ffa6a4669fe5d44c359)

Change-Id: I62eaa14c95ecce3dcd5fdde97f3a45f9103fc7bc
Reviewed-on: http://gerrit.openafs.org/4175
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: vol-salvage SalvInfo fixes
Andrew Deason [Thu, 19 Aug 2010 16:35:40 +0000 (11:35 -0500)]
Windows: vol-salvage SalvInfo fixes

Commit 3d7388b790ef21de552ec60d379764df067ae421 broke the windows
build. Fix it:

 - SVGParms_t has no salvinfo member, but an svgp_salvinfo member

 - Correct the SalvageVolumeGroup prototype to match the actual
   implementation

Reviewed-on: http://gerrit.openafs.org/2595
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 87dc2a312ac94bc0a8b809a8f879128be8d9c791)

Change-Id: I8fd13e683060ae4ae4818a03626e95680cc3e86d
Reviewed-on: http://gerrit.openafs.org/4176
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol-salvage: Move global vars into SalvInfo struct
Andrew Deason [Thu, 24 Jun 2010 20:45:05 +0000 (15:45 -0500)]
vol-salvage: Move global vars into SalvInfo struct

Reduce the number of globals used in the salvager code, by making
functions pass around a 'salvinfo' structure that contains the
information regarding a particular salvage.

Reviewed-on: http://gerrit.openafs.org/2250
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3d7388b790ef21de552ec60d379764df067ae421)

Change-Id: I15137994806f0c753a42347c28cadcf48002b800
Reviewed-on: http://gerrit.openafs.org/4163
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFix positional I/O support for largefiles
Ryan C. Underwood [Sun, 6 Mar 2011 10:40:53 +0000 (10:40 +0000)]
Fix positional I/O support for largefiles

Commit 335ccb40 introduced positional I/O support for the fileserver,
but didn't handle the largefile versions of preadv and pwritev. As a
result, the fileserver cannot handle files of more than 2Gb in size.

Fix this by using preadv64 and pwritev64 where O_LARGEFILE is defined,
in the same way as for all other I/O primitives.

Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-on: http://gerrit.openafs.org/4152
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit bbf406da30428a22b4a6d28a7d36dbb786013cfa)

Change-Id: I5d15097e4c9aa83444520628f484407d244ddf97
Reviewed-on: http://gerrit.openafs.org/4161
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDisable vectored positional IO if no 64bit support
Simon Wilkinson [Sun, 6 Mar 2011 16:06:36 +0000 (16:06 +0000)]
Disable vectored positional IO if no 64bit support

In order to support vectored positional I/O, and large files, we
need there to be an implementation of preadv64 and pwritev64. If
this isn't present, then just disable HAVE_PIOV.

(cherry picked from commit 98a0c2f47b8641e3e31ed7d2f7d84c2eb484ef51)
Reviewed-on: http://gerrit.openafs.org/4153
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I4e199c748d7b88ff7076106b19c3dec0e60be39a
Reviewed-on: http://gerrit.openafs.org/4160
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRevert "LWP: remove ucontext header from preempt module"
Andrew Deason [Mon, 28 Feb 2011 20:03:46 +0000 (14:03 -0600)]
Revert "LWP: remove ucontext header from preempt module"

This reverts commit fbac809a46376fcf60d3dcedc0be962c43d9c74e.

The ucontext header is only included in lwp.h for platforms that use
ucontext as a means for context-switching in LWP. The preempt module
needs the ucontext header for signal handling on some platforms (at
least Solaris). So, ucontext.h may not be included by lwp.h on these
platforms, if that platform does not use ucontext for LWP
context-switching. So we need to explicitly include ucontext.h in
preempt.c.

Reviewed-on: http://gerrit.openafs.org/4095
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2681c49ada5679922f949e9c7d0010f2ee705dab)

Change-Id: Ie1858dc4e7dfc6e9db4a4f63deda8018645f9111
Reviewed-on: http://gerrit.openafs.org/4162
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoDon't trust # of entries from ListAttributes
Simon Wilkinson [Sun, 26 Dec 2010 14:54:43 +0000 (14:54 +0000)]
Don't trust # of entries from ListAttributes

ListAttributes returns the number of entries in its array as an RPC
argument. But, we can't trust this, as it could be manipulated and
end up pointing past the end of the returned array (which is counted,
so the entries argument is actually pointless).

Add bounds checking to the functions which use this value to prevent
this problem.

(cherry picked from commit 8992210f27671673a89a541776aa105238ad14cf)
Reviewed-on: http://gerrit.openafs.org/3597
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Change-Id: I318f2f956a48f10e91590ad9f28fab868d8ceb60
Reviewed-on: http://gerrit.openafs.org/4134
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRevert "Convert from using nvldbentry to uvldbentry"
Jeffrey Altman [Sat, 5 Mar 2011 05:40:13 +0000 (00:40 -0500)]
Revert "Convert from using nvldbentry to uvldbentry"

This reverts commit 4f1efdc8b73ed734197925766530d033c6f9794a.

The conversion to uvldbentry produced too many negative side
effects.  Revisit support for multi-homed servers when vos
is executed from a machine that can only see a random subset
of the addresses assigned to the server in the future.

(cherry picked from commit 9e539fbea456cdb416a487364d67ab54da1249a7)
Reviewed-on: http://gerrit.openafs.org/4131
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I9211d919e4584c1dac388155b6f4609f50fe603c
Reviewed-on: http://gerrit.openafs.org/4133
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRevert "modify FindIndex to compare uuids"
Jeffrey Altman [Sat, 5 Mar 2011 04:40:31 +0000 (23:40 -0500)]
Revert "modify FindIndex to compare uuids"

This reverts commit 9aad0979e9ff0601c249eb66a6ecfb3e76264702.

This is being pulled as the entire nvldbentry to uvldbentry
conversion is being reverted.

Reviewed-on: http://gerrit.openafs.org/4130
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ca0ae15d621dbd90339408a26715a107d1f69f23)

Change-Id: If97b81e874c87b10a4c4e5f190f573781fc3c158
Reviewed-on: http://gerrit.openafs.org/4132
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>