openafs.git
10 years agoMerge branch 'rxkad-kdf-1.4' into origin/openafs-stable-1_4_x openafs-stable-1_4_x
Simon Wilkinson [Wed, 24 Jul 2013 15:27:20 +0000]
Merge branch 'rxkad-kdf-1.4' into origin/openafs-stable-1_4_x

Merge the changes for OpenAFS-SA-2013-003 and
OpenAFS-2013-004 back in to the stable branch

Change-Id: I0cd53a568758e3e81b487ba4f955b7e6c021b89a

10 years agoMake OpenAFS 1.4.15 openafs-stable-1_4_15
Simon Wilkinson [Tue, 16 Jul 2013 19:13:58 +0000]
Make OpenAFS 1.4.15

Change-Id: Ib6f8186bbf6cd21dc332d0080bbf473c01ef6882

10 years agoReload rxkad.keytab on CellServDB modification
Andrew Deason [Wed, 10 Jul 2013 17:52:28 +0000]
Reload rxkad.keytab on CellServDB modification

Make the reloading of rxkad.keytab keys occur in the same way that
KeyFile keys are reloaded. That is, we only try to reload them if the
CellServDB mtime has changed. This is intended to have exactly the
same reloading behavior as KeyFile reloads.

I would have triggered this from afsconf_Check, but that approach
has annoyances. (Calling ticket5_keytab functions directly from
cellconfig pulls in libkrb5 dependencies for everything that uses
cellconfig, and we'd have to trigger an afsconf_Check call by calling
some other cellconfig function.)

10 years agoDe-assert ticket5_keytab.c
Andrew Deason [Tue, 9 Jul 2013 22:45:08 +0000]
De-assert ticket5_keytab.c

These code paths involve processing untrusted user data. Just never
assert here, to be on the safe side.

Merge into "New optional rxkad functionality for decypting krb5
tokens"

10 years agoinit_krb5_lock is void
Andrew Deason [Wed, 10 Jul 2013 17:52:58 +0000]
init_krb5_lock is void

We don't return anything, and pthread_once expects a function
returning void. So make it actually void, to avoid warnings.

Merge into "New optional rxkad functionality for decypting krb5
tokens"

10 years agoComment cleanup
Andrew Deason [Tue, 9 Jul 2013 22:42:29 +0000]
Comment cleanup

No, we shouldn't assert, and those error codes should be okay (haven't
heard any better ideas). Get rid of these comments, so there's no
confusion.

Merge into "Clean up akimpersonate and use for server-to-server".

10 years agoAdd support for deriving DES keys to klog.krb5
Ben Kaduk [Sat, 13 Jul 2013 12:24:12 +0000]
Add support for deriving DES keys to klog.krb5

(cherry-picked from e79102e7918ce5196e870a806879135743ec3abb)

Change-Id: Ic83a203b9012620f77316207727a6eeb1c48423e

10 years agoMake server processes enable keytab decrypt
Chaskiel Grundman [Mon, 18 Mar 2013 05:22:00 +0000]
Make server processes enable keytab decrypt

1.6 has common code for this, but not 1.4....
Keep the calls conditional on the presence of a krb5 library.

Change-Id: I5a1bcd515cb56a410f94de0a0f3614a8c8312b19

10 years agoClean up akimpersonate and use for server-to-server
Ben Kaduk [Tue, 14 May 2013 23:42:05 +0000]
Clean up akimpersonate and use for server-to-server

Since a6d7cacfd, aklog has been able to print a krb5 ticket to
itself for an arbitrary client principal, allowing a user with
access to the cell's krb5 key to get tokens as an arbitrary user.

Now that it is possible to use native krb5 tickets with non-DES
enctypes for authentication, and akimpersonate is available from libauth,
use printed native krb5 tickets for server-to-server communication (as well
as the -localauth versions of the client utilities).

Before doing so, refactor the akimpersonate code to be more usable
and readable, and eliminate some dead code.  For example, we always printed
addressless tickets, so that code could be removed.  Other code had excessive
stack usage for a library routine, which is eliminated.  Use a start time
of 0 instead of 300 so that the printed ticket will always be
detected as infinite-lifetime.

In order to ensure usability on all platforms (in particular Solaris),
provide a couple more compat shims to implement routines which are not
always available from the krb5 library, in particular encode_krb5_ticket
and encode_krb5_enc_tkt_part.  Thanks to Andrew Deason for implementing
these compatibility routines.

UKERNEL doesn't need this stuff.

akimpersonate: Handle missing encode_krb5_ticket

If we don't have encode_krb5_ticket and encode_krb5_enc_tkt_part,
implement our own. Basically, transform the appropriate structure into
the Heimdal equivalent, and use our builtin Heimdal ASN.1 encoding
functions to do the actual encoding for us.

10 years agoMove akimpersonate to libauth
Alexander Chernyakhovsky [Tue, 14 May 2013 22:12:08 +0000]
Move akimpersonate to libauth

Give it its own source file and header, install the header at
depinstall time, and have aklog get the akimpersonate functionality
from libauth.

Keep the linux box copyright from aklog_main.c (but strip the trailing
whitespace), as that block was added with the akimpersonate code.

Remove all calls to afs_com_err() as is fitting for library code,
to let it build.  Do not bother removing curly braces which are
no longer needed; a future cleanup commit will catch that.

10 years agoDerive DES/fcrypt session key from other key types
Chaskiel Grundman [Mon, 18 Mar 2013 01:58:47 +0000]
Derive DES/fcrypt session key from other key types

If a kerberos 5 ticket has a session key with a non-DES enctype,
use the NIST SP800-108 KDF in counter mode with HMAC_MD5 as the PRF to
construct a DES key to be used by rxkad.

To satisfy the requirements of the KDF, DES3 keys are first compressed into a
168 bit form by reversing the RFC3961 random-to-key algorithm

Change-Id: I4dc8e83a641f9892b31c109fb9025251de3dcb27

10 years agoIntegrate keytab-based decryption into afsconf_ServerAuth
Chaskiel Grundman [Sun, 10 Feb 2013 18:27:03 +0000]
Integrate keytab-based decryption into afsconf_ServerAuth

Now all servers can have it, though they must call
rxkad_BindKeytabDecrypt themselves.

Change-Id: I95fecb3f88c19b3d5193ea8200fa20c86ec08ad7

10 years agoNew optional rxkad functionality for decypting krb5 tokens
Chaskiel Grundman [Sat, 9 Feb 2013 17:42:20 +0000]
New optional rxkad functionality for decypting krb5 tokens

An additional, optional mechanism for decrypting krb5-format tokens
is provided that uses the krb5 api with a key from a keytab
instead of using libdes and the AFS KeyFile

The AIX compat stub for krb5_c_decrypt is contributed by Andrew Deason.

Change-Id: I97c08122c60482b84d602d6fa6482f1d5deef142

10 years agoAdd rxkad server hook function to decrypt more types of tokens
Chaskiel Grundman [Sat, 9 Feb 2013 17:01:37 +0000]
Add rxkad server hook function to decrypt more types of tokens

Allow tokens to be encrypted with algorithms other than DES.
The security object owner must provide an implementation
by calling rxkad_SetAltDecryptProc.

Make sure plainsiz is initialized before calling the alternate decrypt
proc.

10 years agoFix scanf buffer overflows
Nickolai Zeldovich [Tue, 12 Feb 2013 20:08:38 +0000]
Fix scanf buffer overflows

Fix potential buffer overflows caused by misuse of the scanf function
in the fileserver and ptserver.

Also fix similar issues in the client side fs command and libadmin
library.

(cherry-picked from d1855f8e04b43c9e06cf5b8d48e51f7816cf7342)

Change-Id: Icc50158816c058a831267243d0e9fd443d01fa68

11 years agoLINUX: Avoid symlink-y resolution limits
Andrew Deason [Tue, 21 Aug 2012 22:03:30 +0000]
LINUX: Avoid symlink-y resolution limits

Implementing the d_automount or follow_link function pointers for our
directories means that we can hit symlink resolution limits during
lookup, since we look like a "symlink". We can hit these limits pretty
easily if there are just too many directories in the lookup path.

Our pseudo-symlink directories cannot contribute to an infinite
resolution loop, since our destination is always an actual directory,
not a symlink that will result in more redirection. So, decrement the
total_link_count counter when our d_automount or follow_link code is
reached, so we do not contribute to hitting the max resolution limit.

Note that this is not related to recursive symlink lookup (link_count)
but only to the iterative symlink limit (total_link_count). Our
lookups are not recursive here, and we are not causing more recursive
lookups like a normal text-based symlink would do.

Reviewed-on: http://gerrit.openafs.org/8009
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 238b88624a8fef39557d397cc336c88bd8efc5b1)

Change-Id: Ib14ee9d160189da658f36578e21bd458e6e7832a
Reviewed-on: http://gerrit.openafs.org/8195
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLINUX: Do not lookup immediately recursive mtpts
Andrew Deason [Fri, 6 Apr 2012 19:56:07 +0000]
LINUX: Do not lookup immediately recursive mtpts

On Linux, having a mountpoint in a volume root that points to the same
volume can cause serious problems. By 'immediately recursive', I mean
a situation like the following:

fs mkm mtpt vol
fs mkm mtpt/mtpt vol

If there are multiple dentry aliases for the directory (which is
possible if the directory is a mountpoint), an 'rmdir' on the
recursive mountpoint can cause the client to deadlock. Since the
'rmdir' code path in Linux locks the parent directory inode to perform
the rmdir, and locks the child directory inode after performing a
couple of sanity checks. For an immediately recursive mountpoint,
these two inodes are the same, and so we will deadlock.

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

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

11 years agoLinux: Make dir dentry aliases act like symlinks
Andrew Deason [Fri, 6 Jul 2012 21:37:39 +0000]
Linux: Make dir dentry aliases act like symlinks

Currently, we try to invalidate other dentries that exist for a
particular dir inode when we look up a dentry. This is so we try to
avoid duplicate dentries for a directory, which Linux does not like
(you cannot have hardlinks to a dir).

If we cannot invalidate the other aliases (because they are being
used), right now we just return the alias. This can make it very easy
to panic the client, due to the sanity checks Linux performs when dong
things like 'rmdir'. If we do something like this:

mkdir dir1
fs mkm dir1/mtpt vol
mkdir dir1/mtpt/dir2
fs mkm dir1/mtpt/dir2/mtpt2 vol
cd dir1/mtpt
rmdir dir2/mtpt2

For the 'rmdir', we will lookup 'mtpt2'. Since 'mtpt' and 'mtpt2'
are mountpoints for the same volume, their dentries point to the same
directory inode. So when we lookup 'mtpt2', we will try to invalidate
the other dentry, but we cannot do that since it is the cwd. So we
return the alias dentry (for 'mtpt'). The Linux VFS layer then does a
sanity check for the rmdir operation, checking that the child dentry's
parent inode is the same as the inode we're performing the rmdir for.
Since the dentry we returned was for 'mtpt', whose parent is 'dir1',
and the actual dir we're performing the rmdir for is 'dir2', this
sanity check fails and we BUG.

To avoid this, make the dentry alias act like a symlink when we
encounter an uninvalidateable dentry alias. That is, we allow multiple
dentry aliases for a directory, however, when the dentry aliases are
actually used, we redirect to a common dentry (via d_automount where
possible, and follow_link elsewhere).

This means that such mountpoints will behave similarly to symlinks, in
that we 'point' to a specific mountpoint dentry. This means that if we
have multiple different ways to get to the same volume, and all are
accessed at the same time, all but one of those mountpoints will
behave like symlinks, pointing to the same mountpoint. So, the '..'
entries for each path will all point to the parent dir of one
mountpoint, meaning that the '..' entry will be "wrong", but for most
cases it will still be correct.

In order to try to make the 'target', pointed-to directory consistent,
we add a new field to struct vcache: target_link. This points to the
dentry we should redirect to, whenever that vcache is referenced. To
avoid (possibly not-feasibly-solvable) problems with refcounting, this
pointer is not actually a reference to the target dentry, but just
serves as a pointer to compare to.

FIXES 130273

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

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

12 years agoviced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize
Jeffrey Altman [Tue, 3 Apr 2012 02:35:41 +0000]
viced: AFSDisk, AFSFetchVolumeStatus Int31 PartSize

The AFSDisk and AFSFetchVolumeStatus structures use signed
32-bit integers for representation partition size and
available blocks.  RoundInt64ToInt31() should be used instead
of RoundInt64ToInt32() when assigning their values.

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

Change-Id: Ieb55d057b09648c88cf1f8596fd934139dde3910
Reviewed-on: http://gerrit.openafs.org/7024
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agorx: Correctly test for end of call queue
Marc Dionne [Wed, 18 Jan 2012 01:19:54 +0000]
rx: Correctly test for end of call queue

The intention of this condition is to check if the current call
being considered is the last one on the queue, but the test is
incorrect.  A null next pointer indicates a removed item, not
the end of the queue.

Use the queue_IsLast macro instead to correctly determine that
this is the last item in the queue and that a call has to be
selected, either the current one or a previously seen good choice.

This can cause calls to get permanently stuck in the call queue
and never get assigned to a thread, even when all threads are
idle.

Reviewed-on: http://gerrit.openafs.org/6564
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 6ad3d646e62801cb81a3c9efeac320daa44936e1)

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

Change-Id: I86e43066ab20dc64749be2c2ba0fffa511e7f9ff
Reviewed-on: http://gerrit.openafs.org/6623
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>

12 years agolibafs: memset dirHeader->hashTable
Andrew Deason [Thu, 9 Jun 2011 03:50:27 +0000]
libafs: memset dirHeader->hashTable

Clear dirHeader->hashTable via memset instead of via a loop. This is
more efficient, and avoids the loop getting optimized into an unusable
_memset call on recent versions of Solaris Studio when building for
the kernel.

Thanks to Jeff Blaine for reporting the issue with Solaris Studio.

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

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

12 years agolibafs: Drop xvcache for AllocCBR
Andrew Deason [Tue, 15 Feb 2011 18:04:32 +0000]
libafs: Drop xvcache for AllocCBR

Normally when we AllocCBR, we are holding xvcache write-locked, since
it is called from FlushVCache. Before
a309e274632993c5aeec04c6e090f5ac95837a40, when AllocCBR needs to flush
CBRs due to a lack of space, we hit the net, giving up callbacks on
fileservers.

This can cause a problem if one of those fileservers needs to contact
us in order to complete that request, since the callback service
thread may be waiting for xvcache, causing a deadlock (that is
eventually broken by network timeouts).

To avoid this, drop xvcache if AllocCBR looks like it does not have
sufficient space. Fix all callers of afs_FlushVCache to handle the
case where we sleep, since with this change, afs_FlushVCache can sleep
on all platforms.

This partially reverts a309e274632993c5aeec04c6e090f5ac95837a40, as it
contains an alternative method of avoiding the xvcache lock in this
situation. This commit restores much of the code path to be much more
similar to how it used to be, except that it allows for dropping
xvcache for AllocCBR. This should make any change to our prior
behavior smaller/simpler, and thus safer and more consistent with
existing clients. This reintroduces the hard limit to how much space
we allocate for CBRs, although the part of
a309e274632993c5aeec04c6e090f5ac95837a40 that raised this limit is
retained.

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

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

12 years agoafs: Remove afs1_readdir
Andrew Deason [Thu, 29 Sep 2011 17:04:07 +0000]
afs: Remove afs1_readdir

The function afs1_readdir is not referenced anywhere. Remove it, as it
currently causes compilation errors (a typo with the
origOffset/orginOffset variable name).

This is a 1.6/1.4-only change. afs1_readdir was removed on master as a
part of commit 0284e65f97861e888d95576f22a93cd681813c39.

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

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

12 years agoLINUX: Revert group changes on keyring failure
Andrew Deason [Fri, 12 Aug 2011 19:50:26 +0000]
LINUX: Revert group changes on keyring failure

On Linux kernels that support keyrings, when we setpag we try to add
the PAG to the session keyring and to the supplemental group list.
Currently, if we fail to add the PAG to the keyring (which may happen
due to key quotas, or possibly other reasons), we return failure but
the group list is still modified with the new PAG in it.

Therefore, if the keyring-based approach fails, the new PAG may still
be in use, but there are no keyring keys associated with that PAG, so
the PAG may never get destroyed. This can cause a large number of PAGs
to accumulate over time, causing performance problems.

So, change this so that, in the event that keyring installation fails,
we revert the group list back to what it was before we touched it.
Also mark all unixusers with the new PAG as expired, in case one got
created during processing. Thus, the new PAG never gets used.

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

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

12 years agoLinux: Fix return codes from setpag
Simon Wilkinson [Tue, 15 Mar 2011 00:45: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: I197e963b9da6ba89a48998477ffda61b98903eb1
Reviewed-on: http://gerrit.openafs.org/5728
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agodir: Protect against circular hash chains
Simon Wilkinson [Fri, 15 Apr 2011 18:40:45 +0000]
dir: Protect against circular hash chains

The dir package didn't protect against circular hash chains when
performing directory lookups. A corrupt directory could therefore
cause a client or a fileserver to go into an endless loop if that
directory contained a loop in its hash chain pointers.

Fix this by exiting the lookup if the hash chain has more elements
than the total number of entries in a directory. This maximum number
of entries is taken as being (number of entries per page) * (max
number of pages), which is considerably more than the real maximum
value.

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

12 years agolibafs/dir: Verify directory pathnames
Simon Wilkinson [Sat, 16 Jul 2011 22:30:59 +0000]
libafs/dir: Verify directory pathnames

Provide a new routine, GetVerifiedBlob() which will ensure that the
pathname contained within a directory blob is correctly terminated
before returning it to the caller. For the purposes of this function,
correct termination is defined as having a terminating \0 character
within the same directory page as the blob itself.

Change-Id: I4b3bbb95cb49645a8ac52e6061f9e24f89924831
Reviewed-on: http://gerrit.openafs.org/5617
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>

12 years agolibafs: Set tvcp->callback before BulkStatus
Andrew Deason [Thu, 12 Aug 2010 19:38:55 +0000]
libafs: Set tvcp->callback before BulkStatus

When we call InlineBulkStatus or BulkStatus, we currently do not touch
tvcp->callback for any of the vcaches before making the call. This can
cause us to not notice an InitCallBackState issued by the fileserver
before the BulkStatus call returns, since the InitCallBackState
handler looks at tvcp->callback to determine what vcaches to clear
callbacks for. In turn, this can cause us to think we have a callback
agreement with the fileserver on one of the BulkStatus'd files, when
the fileserver does not actually have such a callback agreement.

So, set tvcp->callback to the server we are contacting, so if we get
an InitCallBackState call from that fileserver, the CBulkFetching
state will be cleared, and we will correctly discard the callback
information for that vcache.

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

Change-Id: I3bb9bd6b8c9f7e5ef9f63a62d80cf70629990db6
Reviewed-on: http://gerrit.openafs.org/5647
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

12 years agoviced: allow alternate addresses on the same hash chain again
Michael Meffie [Tue, 29 Dec 2009 18:40:15 +0000]
viced: allow alternate addresses on the same hash chain again

Revert the logic meant to prevent duplicate entries in the
host address hash table so hosts with multiple addresses can
be stored in the same hash bucket again.

Add a new log message to show when the host cannot be stored
in the hash table because of an address-port pair collision
with a host already in the hash table.

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

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

12 years agoptserver: Do not use cell for entry name len check
Andrew Deason [Fri, 30 Jul 2010 20:32:53 +0000]
ptserver: Do not use cell for entry name len check

Do not use the local cell name when determining if a new entry name is
too long. This check assumes that foreign cells will use our local
cell name (assumed to be our local Kerberos realm) in a certain way,
and prevents creating users that will make those names too long.

This is undesirable for several reasons. One is that the local realm
name may not be the same as the local cell name (and we may have many
local realms). Another is that we cannot reliably predict how foreign
cells will construct foreign pt entry names, so preventing entry
creation based on that may prevent names that will never cause any
problems. This check also assumes that our names will be used as
foreign entries in other cells, which may not be the case.

So, remove the check based on the local cell name, and remove the
pr_realmNameLen variable while we are at it, since this is all it is
used for.

Thanks to Jeffrey Altman for discussion, and for bringing this up in
the first place.

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

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

12 years agoRe-enable rx connection hard timeout
Rainer Toebbicke [Tue, 18 Jan 2011 13:56:17 +0000]
Re-enable rx connection hard timeout

A missing "conn->" in rxi_CheckCall prevents checking hard connection timeouts.

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

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

12 years agoCellServDB update 14 Aug 2011
GCO Public CellServDB [Sun, 14 Aug 2011 22:43:08 +0000]
CellServDB update 14 Aug 2011

Reviewed-on: http://gerrit.openafs.org/5270
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit a5d66d05fa0308d505de8bde59442e29be9d04f8)

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

12 years agolibafs: Avoid duplicate afs_Analyze in bulk stat
Andrew Deason [Fri, 22 Jul 2011 21:09:52 +0000]
libafs: Avoid duplicate afs_Analyze in bulk stat

In afs_DoBulkStat, we can call afs_Analyze multiple times for the same
set of connection objects. Since afs_Analyze puts its reference to the
given afs_conn and rx_connection structures, calling it more than once
can cause the reference counts on those objects to be lower than they
should be.

Instead of making another afs_Analyze call, just alter the error code
inside the normal do/while afs_Analyze loop, so the 'loop' afs_Analyze
call gets the appropriate error code from the first bulk stat'd entry.

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

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

12 years agoSOLARIS: Granular multiPage detection
Andrew Deason [Wed, 29 Jun 2011 18:51:22 +0000]
SOLARIS: Granular multiPage detection

Currently, a struct vcache has a multiPage counter, indicating how
many afs_getpage requests are in-flight for that vcache that involve
retrieving multiple pages. Any dcache associated with such vcaches are
then avoided when choosing dcache entries to evict from the cache,
since we may deadlock when trying to evict a dcache entry from one of
the earlier afs_GetOnePage calls in a particular afs_getpage request.

This behavior can cause the client to become unusable if the cache
becomes full, and the only items in the cache are dcache entries in a
file that has an in-flight multi-page afs_getpage request. Since, in
that case, we cannot kick out any entries from the cache, and so we
wait forever to wait for the cache utilization to go down.

To prevent this from occurring, record exactly which ranges in the
file have in-flight multi-page afs_getpage requests, and just avoid
dcache entries in those ranges. This way afs_GetDownD can evict dcache
entries in the same file, but still avoid entries that would cause a
deadlock.

Also add some comments explaining this situation a bit more.

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

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

12 years agoFileserver: Don't sync every 10 seconds
Simon Wilkinson [Mon, 17 May 2010 19:15:46 +0000]
Fileserver: Don't sync every 10 seconds

The patch which moved our calls to fsync into the background, added
a sync prior to each batch of fsync calls. This is an incredibly bad
idea.

POSIX says that sync "shall cause all information in memory that
updates file systems to be scheduled for writing out to all file
systems". On Linux this means that we in effect perform an fsync()
on every open filehandle on the entire system, and in addition flush
all superblocks and journals out to disk. This makes the following
fsync() calls superfluous - sync() will have already written out
all of the data.

Add to this the fact that the fileserver is doing this every 10
seconds, and this becomes a major performance bottleneck,
particularly if the machine uses a journalled fs - as any disk
operations will end up blocking whilst the journal is written to
disk.

Reviewed-on: http://gerrit.openafs.org/1977
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Rainer Toebbicke <rtb@pclella.cern.ch>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5ea24a7c5534b4fda7904284d21d34b6e52a3f27)

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

12 years agoafs: Avoid memory leak on recursive write flock
Andrew Deason [Fri, 1 Apr 2011 21:43:24 +0000]
afs: Avoid memory leak on recursive write flock

When a process requests an exclusive lock on a file on which it
already holds an exclusive lock, we basically form a no-op. However,
HandleFlock was allocating a new SimpleLocks and attaching it to
avc->slocks, without freeing the old SimpleLocks structure.

Since we don't need to do anything if we already hold an exclusive
lock, just break out of the loop right away when we detect that
scenario. Thus we avoid adding a new structure to avc->slocks, and we
avoid a memory leak.

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

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

12 years agoafs: Retry unlock after afs_StoreAllSegments
Andrew Deason [Fri, 1 Apr 2011 18:43:13 +0000]
afs: Retry unlock after afs_StoreAllSegments

HandleFlock calls afs_StoreAllSegments when unlocking an exclusive
flock lock. This can drop the write lock on avc, so we must
effectively retry the entire lock operation again, since the world may
have changed while we were waiting to reacquire the lock on avc. So,
retry once all of the lock checks up to that point, to ensure that a
lock on the file actually still exists.

FIXES 125446

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

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

12 years agomake bozo honor -rxbind correctly
Adam Megacz [Fri, 23 Mar 2007 19:14:41 +0000]
make bozo honor -rxbind correctly

Bozo needs to call rxInitHost() rather than rxInit() when -rxbind is
present. This patch causes it to read NetInfo/NetRestrict earlier in
the startup process so it can make that decision.

FIXES 57286

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

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

12 years agolibafs: Get rx conn ref with afs conn ref
Andrew Deason [Thu, 5 May 2011 16:18:08 +0000]
libafs: Get rx conn ref with afs conn ref

When we get a reference to an afs_conn with afs_Conn and its variants,
we assume we can use the tc->id rx connection without holding any
locks. However, if tc->forceConnectFS gets set, the tc->id connection
can be destroyed and recreated out from under us. So, to avoid using a
possibly freed rx connection, grab a reference to the rx connection at
the same time as we grab a reference to the afs conn. And also put
back the same reference with afs_PutConn.

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

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

12 years agolibafs: Avoid using changing unixuser ticket data
Andrew Deason [Wed, 4 May 2011 17:34:20 +0000]
libafs: Avoid using changing unixuser ticket data

PSetTokens was afs_osi_Alloc'ing after afs_osi_Free'ing the previous
token data. This can sleep, causing tu->stp to be pointing to garbage
while we wait to alloc. Additionally, rxkad_NewClientSecurityObject
can sleep while waiting to alloc memory, and so the given tu->stp
pointer given to it by afs_ConnBySA may be invalid by the time it
actually uses the data.

To fix this, we could implement unixuser locking to ensure mutual
exclusion of these events. However, this implements a more
conservative change for the 1.4 branch. In PSetTokens we alloc the new
memory before we change anything, and in afs_ConnBySA we make copies
of the ticket data before giving it to rxkad. With these changes, the
glock gives us enough serialization to avoid issues with tu->stp
changing underneath us.

This change is 1.4-specific. On the master branch, this issue is fixed
by implementing unixuser locks in change
Idd66d72f716b7e7dc08faa31ae43e9a23639bae3.

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

12 years agoSOLARIS: Reset syscalls on mod_install failure
Andrew Deason [Thu, 19 May 2011 22:02:35 +0000]
SOLARIS: Reset syscalls on mod_install failure

If our call to mod_install fails for any reason (for example, if the
afs entry is missing from /etc/name_to_sysnum), we may still have set
the sysent structures for setgroups and ioctl to point at libafs code.
So calls to those syscalls will cause a panic, since the code they
point to is no longer loaded.

To avoid this, just reset the sysent entries back to what they were if
we fail to load, just like we do when unloading the module.

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

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

12 years agounix blacklistonce should default to fail if no fid
Derrick Brashear [Mon, 26 Jul 2010 20:15:46 +0000]
unix blacklistonce should default to fail if no fid

return fail, rather than success, if no fid and thus
no list of servers to resort, in BlackListOnce.

will need a later change for vlservers

reported by jhutz@cmu.edu

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

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

12 years agoavoid downward vcache pressure when entries are free
Derrick Brashear [Fri, 29 Apr 2011 07:59:19 +0000]
avoid downward vcache pressure when entries are free

we try to keep VCACHE_FREE entries free. if there's already that many free,
do nothing.

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

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

12 years agolibafs: Use vcount, not maxvcount to trim vcaches
Andrew Deason [Thu, 28 Apr 2011 16:48:18 +0000]
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: Ia8074673ac8c07770bb90016502a9ea860445660
Reviewed-on: http://gerrit.openafs.org/4621
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

12 years agomake 1.4.14.1 19/4619/1 openafs-stable-1_4_14_1
Derrick Brashear [Tue, 3 May 2011 12:49:14 +0000]
make 1.4.14.1

update configure version strings for 1.4.14.1. note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.4.14.1.
switch to 1.4.15 dev 1 for macos.

Change-Id: I955a54fd44a411989b5eea2521f82909621f14cd

12 years agoSOLARIS: Perform daemon syscalls as kernel threads
Andrew Deason [Mon, 2 May 2011 22:23:23 +0000]
SOLARIS: Perform daemon syscalls as kernel threads

Add AFS_SUN5_ENV to the list of platforms where AFS_DAEMONOP_ENV is
defined. Implement the necessary functionality so we spawn kernel
threads when a daemon syscall is called. Remove the rxk_Listener
wrapper, since it will be called in a separate thread via the
afs_DaemonOp interface.

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

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

12 years agolibafs: Consolidate afs_DaemonOp code
Andrew Deason [Tue, 8 Mar 2011 21:37:17 +0000]
libafs: Consolidate afs_DaemonOp code

Create the AFS_DAEMONOP_ENV define to simplify the logic of when we
perform afs_DaemonOp-y code paths. Also create the daemonOp_common
function, to perform common pre-fork operations that are common
between platforms.

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

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

12 years agolibafs: Indent afs_call.c ifdef maze
Andrew Deason [Tue, 8 Mar 2011 20:59:44 +0000]
libafs: Indent afs_call.c ifdef maze

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

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

12 years agoFix cherry-pick of “linux: 2.6.38: New d_op handling”
Anders Kaseorg [Sun, 1 May 2011 03:35:02 +0000]
Fix cherry-pick of “linux: 2.6.38: New d_op handling”

Conflicts in this cherry-pick (http://gerrit.openafs.org/4041) were
resolved incorrectly.  The correct resolution of
"""
 <<<<<<< HEAD
 ||||||| parent of 0d95e6b... linux: 2.6.38: New d_op handling
 #if defined(AFS_LINUX26_ENV)
 =======

 #if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
     sb->s_d_op = &afs_dentry_operations;
 #endif

 #if defined(AFS_LINUX26_ENV)
 >>>>>>> 0d95e6b... linux: 2.6.38: New d_op handling
"""
is
"""

 #if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
     sb->s_d_op = &afs_dentry_operations;
 #endif

"""
and not
"""

 #if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
     sb->s_d_op = &afs_dentry_operations;
 #endif

 #if defined(AFS_LINUX26_ENV)
"""

As usual, it’s impossible to tell the difference in the default
conflict style, so I urge everyone reading this to run

git config --global merge.conflictstyle diff3

Change-Id: I09fb77b2f1d80beda7b81fa1f40f663117dae920
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4596
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

12 years agoSolaris: stop NetIfPoller on shutdown
Andrew Deason [Wed, 12 May 2010 18:59:06 +0000]
Solaris: stop NetIfPoller on shutdown

The NetIfPoller code that is enabled on AFS_SUN510_ENV never gets
shutdown properly. The current code looks as if it was intended for
NetIfPoller to recognize the appropriate termState and just return,
but we never wait for it, and so we can complete the shutdown sequence
without NetIfPoller ever knowing that we are shutting down. This can
cause the machine to panic, as we keep attempting to run NetIfPoller
even after libafs has been unloaded.

Since NetIfPoller is fired by default every 30 seconds, we probably do
not want to wait for it to fire during shutdown. Instead, just destroy
the necessary timeout and task queue, which will wait for NetIfPoller
to complete if running, and will just prevent it from running in the
future otherwise.

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

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

12 years agoLinux: 2.6.38: dentry->d_count is not an atomic
Marc Dionne [Thu, 3 Feb 2011 02:55:27 +0000]
Linux: 2.6.38: dentry->d_count is not an atomic

d_count is now an int protected by the dentry's d_lock.
Take the lock when we use it, instead of using an atomic_*
function.

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

Change-Id: Id6b17d9cfe18d348a66df02f6b309fc53b00da86
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3999
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-on: http://gerrit.openafs.org/4044
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agoLinux: 2.6.38: deal with dcache_lock removal
Marc Dionne [Sat, 29 Jan 2011 01:59:17 +0000]
Linux: 2.6.38: deal with dcache_lock removal

dcache_lock is gone in 2.6.38, and some of the vfs locking rules
have changed.

Of interest for openafs:
- inode->i_lock protects the d_alias list
- dentry->d_lock protects d_unhashed()

Add a new configure test for dcache_lock, and replace its use by
the appropriate new lock(s).

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

Change-Id: Ie405bb1e40cca4ba83bca3e051e2ab54b8850ac6
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3998
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-on: http://gerrit.openafs.org/4043
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agolinux: 2.6.38: Make d_revalidate RCU-walk aware
Marc Dionne [Tue, 25 Jan 2011 23:18:56 +0000]
linux: 2.6.38: Make d_revalidate RCU-walk aware

Signal to the vfs that we don't support path RCU walk in
d_revalidate.  It will call back in non-RCU mode.

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

Change-Id: Id346ca87a1a064ab7d66140156cb8eb48a888566
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3995
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-on: http://gerrit.openafs.org/4042
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agolinux: 2.6.38: New d_op handling
Marc Dionne [Tue, 25 Jan 2011 22:17:21 +0000]
linux: 2.6.38: New d_op handling

In 2.6.38, the super block structure has a new field to hold the
default dentry ops.  The vfs will automatically set it for new
dentries in most cases.

Set s_d_op to our set of operations, and omit setting the dentry
ops where the vfs will already do it (and where new locking rules
prohibit it).

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

Change-Id: Ia808d6bcd119f3999a1805b1d31678f5a3ba3d55
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3994
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-on: http://gerrit.openafs.org/4041
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agoLinux: 2.6.38: Adjust for permission inode operation changes
Marc Dionne [Sat, 29 Jan 2011 00:41:32 +0000]
Linux: 2.6.38: Adjust for permission inode operation changes

The permission i_op has a new signature with a flags argument, and
must now deal with RCU path walking.
- Fix existing configure test for this i_op, it succeeds when it
shouldn't
- Add a new configure test for the new signature
- Make our permission i_op "RCU-walk aware" - return ECHILD if
called in that mode

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

Change-Id: I38db16f0f62500f46fad9c92d045ccfa6cfe1c38
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3997
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-on: http://gerrit.openafs.org/4040
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agoLinux: allow compile flags to be passed to AC_CHECK_LINUX_BUILD
Marc Dionne [Sat, 29 Jan 2011 00:03:39 +0000]
Linux: allow compile flags to be passed to AC_CHECK_LINUX_BUILD

Some linux autoconf tests require particular compile flags such as
-Werror.  Add a parameter to the AC_CHECK_LINUX_BUILD macro that
lets the caller pass in any needed special flags.

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

Change-Id: If4daa7b1202e30046d22bda5eca6b191130945ea
[andersk@mit.edu: Remove modifications of existing tests]
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3996
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-on: http://gerrit.openafs.org/4039
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agoLinux: Add general autoconf macro for Linux kernel
Simon Wilkinson [Tue, 27 Apr 2010 16:41:22 +0000]
Linux: Add general autoconf macro for Linux kernel

Add AC_CHECK_LINUX_BUILD() to do a standardised Linux build, which
takes a "checking" message, the autoconf variable to use to cache
the results, headers and code to run, preprocessor variable to
define, and a description of that variable.

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

Change-Id: I75c5efbf69b54e0f0b1aedcb157992e13c6a8aa7
[andersk@mit.edu: Remove reimplementation of existing check macros]
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3993
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-on: http://gerrit.openafs.org/4038
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 years agoLinux: Add autoconf macro for structure checks
Simon Wilkinson [Tue, 27 Apr 2010 12:02:20 +0000]
Linux: Add autoconf macro for structure checks

Add a new autoconf macro for doing structure element checks.

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

Change-Id: Id7768128e058805baf8d44f2610f3345b25ac973
[andersk@mit.edu: Remove modifications of existing structure checks]
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3992
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>
Reviewed-on: http://gerrit.openafs.org/4037
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

12 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.

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

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

12 years agoRemoved kpasswd from openafs-file-list
Jonathan Billings [Wed, 30 Jun 2010 19:09:39 +0000]
Removed kpasswd from openafs-file-list

The executable %{_bindir}/kpasswd was included in the
the 'openafs' base package.

This change removes the kpasswd executable from the base package.  It
is still built and is installed in the 'openafs-kpasswd' package.  I
believe this was the original intent of the 'openafs-kpasswd' package.

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

Change-Id: I9153aedd35551382101a6e9d7ed4e1e54382d442
Reviewed-on: http://gerrit.openafs.org/3753
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jonathan Billings <jsbillin@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/4035
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoOpenBSD: Eliminate complaint about built-in malloc.
Antoine Verheijen [Mon, 24 Jan 2011 07:38:03 +0000]
OpenBSD: Eliminate complaint about built-in malloc.

With OpenBSD 4.8, OpenBSD now uses gcc 4. With its new
defaults, the OpenAFS compile of the kernel module now
complains incessantly about the conflict between the
built-in malloc versus the kernel version (which has
extra parameters). Therefore, set -fno-builtin-malloc
when compiling the kernel module to remove the noise
since the differences can't be reconciled otherwise.

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

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

13 years agoOpenBSD: Remove user.h from dir.c for OpenBSD 4.8
Antoine Verheijen [Mon, 24 Jan 2011 07:34:56 +0000]
OpenBSD: Remove user.h from dir.c for OpenBSD 4.8

OpenBSD 4.8 no longer needs to include h/user.h in dir.c
and it's presence now gets in the way of the compile so
remove it.

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

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

13 years agoOpenBSD: curproc has moved in OpenBSD 4.8
Antoine Verheijen [Mon, 24 Jan 2011 07:17:46 +0000]
OpenBSD: curproc has moved in OpenBSD 4.8

With OpenBSD 4.8, curproc has moved from h/proc.h to
h/systm.h. Fix rx_event.c to reflect this change.

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

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

13 years agoOpenBSD: Add support for OpenBSD 4.8
Antoine Verheijen [Mon, 24 Jan 2011 07:16:02 +0000]
OpenBSD: Add support for OpenBSD 4.8

Add param headers and other config info for OpenBSD 4.8
support.

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

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

13 years agoOpenBSD: Add amd64 config header for OpenBSD 4.7
Antoine Verheijen [Fri, 25 Mar 2011 23:03:36 +0000]
OpenBSD: Add amd64 config header for OpenBSD 4.7

Add amd64 param header file for OpenBSD 4.7. This got missed
when the original header was put in for the i386 version.

Note: This change is (very) loosely related to commit
      cd6bd75d1c97ce87ab1597d80fcd3cee2ea18825.

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

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

13 years agosalvager: Do not abort on large volume IDs
Andrew Deason [Thu, 10 Mar 2011 20:55:50 +0000]
salvager: Do not abort on large volume IDs

The salvager was parsing volume IDs just using atoi() and checking if
the result was negative. Since the result is a signed int, this fails
on any volume ID larger than 2^31-1. Change the parser to use strtoul
instead of atoi, and change the check.

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

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

13 years agoviced: Enforce lwps limit for -L
Andrew Deason [Mon, 7 Feb 2011 19:13:31 +0000]
viced: Enforce lwps limit for -L

Previously, we only enforced the calculated lwp/thread maximum when
the -p argument was specified. When -L was specified, we set lwps to
128, which can be over the max of (effectively)
MAX_FILESERVER_THREAD-FILESERVER_HELPER_THREADS, depending on the
value of MAX_FILESERVER_THREAD.

Instead, enforce the lwps min/max after all code to set the lwps has
run. Note that this is slightly different for 1.4, so we don't reduce
the number of threads we run.

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

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

13 years agorx: Reset fd_set in LWP rxi_Sendmsg
Andrew Deason [Mon, 21 Feb 2011 18:39:48 +0000]
rx: Reset fd_set in LWP rxi_Sendmsg

When we select() on the socket fd in rxi_Sendmsg, we do not reset the
fd_set, and just use the same memory for any necessary subsequent
select()s. However, if the select returned on EINTR, the fd_set may be
cleared, and so we may try to select() on an empty fd_set forever. To
be sure that we don't do that, reset the fd_set to the socket fd every
time.

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

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

13 years agoviced: Set HWHO_INPROGRESS in CheckHost_r
Andrew Deason [Fri, 4 Mar 2011 17:35:06 +0000]
viced: Set HWHO_INPROGRESS in CheckHost_r

When we are probing a host in CheckHost_r, set the HWHO_INPROGRESS
flag on the host, so other threads know that the host is locked while
we are waiting for a probe response, and the h_threadquota mechanism
can work correctly.

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

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

13 years agoSolaris: do not call VFS_RELE with GLOCK
Andrew Deason [Sun, 16 May 2010 04:12:33 +0000]
Solaris: do not call VFS_RELE with GLOCK

VFS_RELE can call afs_freevfs, which grabs GLOCK. Thus, don't call
VFS_RELE with GLOCK held or we can try to recursively acquire GLOCK
and panic.  This is currently unlikely to occur (sans vfs refcount
unbalances) without support for forced unmounts, since the last vfs
ref will usually come from the caller of afs_unmount(). But it still
may be possible.

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

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

13 years agoLinux: Reduce key_alloc flags confusion
Anders Kaseorg [Tue, 22 Feb 2011 23:18:17 +0000]
Linux: Reduce key_alloc flags confusion

KEY_ALLOC_IN_QUOTA should be 0, not 1.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4033
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c576ca12b6618d2a121b29562aa70532b4cf65a9)

Change-Id: Ifae4b158f8d4e1c39b8720b78843007da70ba4d1
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4066
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoLinux: install_session_keyring: key_alloc flags are unsigned long
Anders Kaseorg [Wed, 23 Feb 2011 00:18:30 +0000]
Linux: install_session_keyring: key_alloc flags are unsigned long

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4034
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 559152ac107f91c8c2f11a909ef638551227b04a)

Change-Id: I72b8d28b27114afb9bc25d4c8d6abe5a1daf34dd
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4055
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoDon't count root session keyrings against quota
Simon Wilkinson [Wed, 17 Mar 2010 11:56:12 +0000]
Don't count root session keyrings against quota

AFS PAM modules can call setpag() as root, regardless of the UID
being authenticated. This leads to the session keyring being created
using roots quota - on some systems (RHEL5) this quota is both small,
and of a fixed size.

Modify our keyring allocation code so that when a keyring is created
by root, we don't do any quota checks.

Reported-by: Rainer Toebbicke <rtb@pclella.cern.ch>
Reviewed-on: http://gerrit.openafs.org/1577
Tested-by: Rainer Toebbicke <rtb@pclella.cern.ch>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit c4537f0442ac7ecbf8c946de45004992e17d535f)

Change-Id: Ia152db35b756abc3b3684194ea3c155f22fef537
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4054
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoUse afs_foff_t for file offsets
Andrew Deason [Wed, 10 Nov 2010 15:11:47 +0000]
Use afs_foff_t for file offsets

Some callers in vol and volser were not using afs_foff_t for file
offsets for calls to STREAM_ASEEK, FDH_TRUNC, FDH_PREAD, or
FDH_PWRITE. Most notably, in code for volume cloning, purging, and
dumping operations. Fix them to use afs_foff_t to prevent errors when
dealing with large special files.

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

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

13 years agolibafs: consistently hold vnode refs
Andrew Deason [Thu, 29 Apr 2010 21:00:26 +0000]
libafs: consistently hold vnode refs

Make all common libafs code call AFS_FAST_HOLD to hold an afs vnode
reference, instead of sometimes calling VN_HOLD(AFSTOV(tvc)) directly.
Make AFS_FAST_HOLD always call osi_vnhold, and have each platform
define osi_vnhold for their platform-specific quirks (as it was doing
before).

This way, if a platform has an osi_vnhold that is special somehow (on
solaris, we bump a VFS refcount if the vnode refcount goes from 0->1),
it will always be called on vnode references.

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

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

13 years agoThrow the compiler a bone ...
Simon Wilkinson [Tue, 15 Mar 2011 21:48:43 +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: Ifcc938e594c5c126c8bcf8c7934a3b96ce7c5d85
Reviewed-on: http://gerrit.openafs.org/4236
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoRemove original rxgk implementation
Simon Wilkinson [Wed, 16 Mar 2011 10:01:41 +0000]
Remove original rxgk implementation

The 1.4 tree has an old implementation of "rxgk" which actually
implements a completely different protocol to what we're calling
rxgk today. It bears no resemblence to the work that's being done
on master, so remove it to avoid any confusion.

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

13 years agoFix cherry-pick of “Linux: 2.6.38: dentry->d_count is not an atomic”
Anders Kaseorg [Fri, 25 Feb 2011 11:37:54 +0000]
Fix cherry-pick of “Linux: 2.6.38: dentry->d_count is not an atomic”

Gerrit broke this patch while cherry-picking it; see
http://gerrit.openafs.org/3999 .

Change-Id: I16c8263d4173af35e524f0ec1bc058e8c6e02ab8
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/4057
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoSolaris: stop NetIfPoller on shutdown
Andrew Deason [Wed, 12 May 2010 18:59:06 +0000]
Solaris: stop NetIfPoller on shutdown

The NetIfPoller code that is enabled on AFS_SUN510_ENV never gets
shutdown properly. The current code looks as if it was intended for
NetIfPoller to recognize the appropriate termState and just return,
but we never wait for it, and so we can complete the shutdown sequence
without NetIfPoller ever knowing that we are shutting down. This can
cause the machine to panic, as we keep attempting to run NetIfPoller
even after libafs has been unloaded.

Since NetIfPoller is fired by default every 30 seconds, we probably do
not want to wait for it to fire during shutdown. Instead, just destroy
the necessary timeout and task queue, which will wait for NetIfPoller
to complete if running, and will just prevent it from running in the
future otherwise.

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

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

13 years agoLinux: 2.6.38: dentry->d_count is not an atomic
Marc Dionne [Thu, 3 Feb 2011 02:55:27 +0000]
Linux: 2.6.38: dentry->d_count is not an atomic

d_count is now an int protected by the dentry's d_lock.
Take the lock when we use it, instead of using an atomic_*
function.

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

Change-Id: Id30054cb110720632f6f4a7fc4d7860cb69cb1e7
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3999
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agoLinux: 2.6.38: deal with dcache_lock removal
Marc Dionne [Sat, 29 Jan 2011 01:59:17 +0000]
Linux: 2.6.38: deal with dcache_lock removal

dcache_lock is gone in 2.6.38, and some of the vfs locking rules
have changed.

Of interest for openafs:
- inode->i_lock protects the d_alias list
- dentry->d_lock protects d_unhashed()

Add a new configure test for dcache_lock, and replace its use by
the appropriate new lock(s).

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

Change-Id: Ic544db9bcf820f01f23227b71684847d742fa41f
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3998
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agolinux: 2.6.38: Make d_revalidate RCU-walk aware
Marc Dionne [Tue, 25 Jan 2011 23:18:56 +0000]
linux: 2.6.38: Make d_revalidate RCU-walk aware

Signal to the vfs that we don't support path RCU walk in
d_revalidate.  It will call back in non-RCU mode.

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

Change-Id: I6662782068e317a36ca70caa0d09665ff2183c2d
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3995
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agolinux: 2.6.38: New d_op handling
Marc Dionne [Tue, 25 Jan 2011 22:17:21 +0000]
linux: 2.6.38: New d_op handling

In 2.6.38, the super block structure has a new field to hold the
default dentry ops.  The vfs will automatically set it for new
dentries in most cases.

Set s_d_op to our set of operations, and omit setting the dentry
ops where the vfs will already do it (and where new locking rules
prohibit it).

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

Change-Id: I15affd47c02653b3b46a0c97e64d06ba4ecbac1c
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3994
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agoLinux: 2.6.38: Adjust for permission inode operation changes
Marc Dionne [Sat, 29 Jan 2011 00:41:32 +0000]
Linux: 2.6.38: Adjust for permission inode operation changes

The permission i_op has a new signature with a flags argument, and
must now deal with RCU path walking.
- Fix existing configure test for this i_op, it succeeds when it
shouldn't
- Add a new configure test for the new signature
- Make our permission i_op "RCU-walk aware" - return ECHILD if
called in that mode

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

Change-Id: Iebfab65b3442ea286873e6af96f1c05c98e5d126
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3997
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agoLinux: allow compile flags to be passed to AC_CHECK_LINUX_BUILD
Marc Dionne [Sat, 29 Jan 2011 00:03:39 +0000]
Linux: allow compile flags to be passed to AC_CHECK_LINUX_BUILD

Some linux autoconf tests require particular compile flags such as
-Werror.  Add a parameter to the AC_CHECK_LINUX_BUILD macro that
lets the caller pass in any needed special flags.

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

Change-Id: I8798e103b2aff77b87684b7fce56c730f0a74b8b
[andersk@mit.edu: Remove modifications of existing tests]
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3996
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agoLinux: Add general autoconf macro for Linux kernel
Simon Wilkinson [Tue, 27 Apr 2010 16:41:22 +0000]
Linux: Add general autoconf macro for Linux kernel

Add AC_CHECK_LINUX_BUILD() to do a standardised Linux build, which
takes a "checking" message, the autoconf variable to use to cache
the results, headers and code to run, preprocessor variable to
define, and a description of that variable.

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

Change-Id: I40730801f21bd058c66e475c4a5d2b67ace04cfb
[andersk@mit.edu: Remove reimplementation of existing check macros]
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3993
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 years agoLinux: Add autoconf macro for structure checks
Simon Wilkinson [Tue, 27 Apr 2010 12:02:20 +0000]
Linux: Add autoconf macro for structure checks

Add a new autoconf macro for doing structure element checks.

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

Change-Id: I3639293928a821ba41456b79fd1425711f6e36f4
[andersk@mit.edu: Remove modifications of existing structure checks]
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3992
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Russ Allbery <rra@stanford.edu>

13 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.

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

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

13 years agovolser-higher-thread-limit-20080327
Derrick Brashear [Thu, 27 Mar 2008 16:20:29 +0000]
volser-higher-thread-limit-20080327

LICENSE IPL10

with tvolser we can increase this and actually *see benefit*, so...
(cherry picked from commit 7c05046f1f097a6ded89a5928ea48aca224f520a)

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

13 years agoRemoved kpasswd from openafs-file-list
Jonathan Billings [Wed, 30 Jun 2010 19:09:39 +0000]
Removed kpasswd from openafs-file-list

The executable %{_bindir}/kpasswd was included in the
the 'openafs' base package.

This change removes the kpasswd executable from the base package.  It
is still built and is installed in the 'openafs-kpasswd' package.  I
believe this was the original intent of the 'openafs-kpasswd' package.

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

Change-Id: Ib095073c090ff59c305defda3c7a3f1f34bcb8cd
Reviewed-on: http://gerrit.openafs.org/3753
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jonathan Billings <jsbillin@umich.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoSOLARIS: Free vcache mappings on shutdown
Andrew Deason [Tue, 7 Dec 2010 16:50:31 +0000]
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: Ibf371870fed253c97799eca5a8331129c4455afb
Reviewed-on: http://gerrit.openafs.org/3587
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

13 years agoUINT_MAX requires limits.h
Andrew Deason [Tue, 6 Jul 2010 19:02:56 +0000]
UINT_MAX requires limits.h

We need to include limits.h to use UINT_MAX on some platforms, so
include it in src/rxkad/v5der.c.

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

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

13 years agorxkad heimdal cleanup
Derrick Brashear [Tue, 6 Jul 2010 13:36:27 +0000]
rxkad heimdal cleanup

don't assume every system have uint16_t and uint32_t;
instead massage for use of native afs types.

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

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

13 years agovol: Log ignored dirs that look like partitions
Andrew Deason [Sun, 3 Oct 2010 23:27:19 +0000]
vol: Log ignored dirs that look like partitions

If we see a /vicep*-like directory when we VAttachPartitions, and we
ignore it because it lacks an AlwaysAttach, log that we ignored it.
This may make things less confusing to admins that just try to create
a /vicep* directory and don't know why it doesn't work.

Feature suggested by Jason Edgecombe.

FIXES 128221

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

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

13 years agoHonour --enable-debug for userspace parts
Christof Hanke [Fri, 17 Dec 2010 15:08:14 +0000]
Honour --enable-debug for userspace parts

For userspace we use ${DBG}, whereas for libafs ${DBUG} is used.
Use ${DBG} outside of src/libafs.

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

13 years agovos: Mark longjmp-used variables as 'volatile'
Andrew Deason [Wed, 10 Mar 2010 00:07:18 +0000]
vos: Mark longjmp-used variables as 'volatile'

vsprocs tries to do error recovery by calling longjmp from a signal
handler. Although this is quite error-prone since we call a ton of
non-async-signal-safe functions, make it a bit more likely to work by
marking variables that are used after the longjmp as volatile. This
reduces how often (depending on the platform) these values will be
completely worthless after a longjmp since they were cached in a
register or similar.

FIXES 125535

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

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

13 years agovos status: actually show created time
Andrew Deason [Tue, 6 Jul 2010 17:36:27 +0000]
vos status: actually show created time

The 'created' field in 'vos status' output was being reported as
something else. Make 'vos status' actually report the time the
transaction was created in that field.

Reviewed-on: http://gerrit.openafs.org/2336
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 36af430c29bdbfc1b4b5c1ad7568cbffab04899f)

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

13 years agoopenafs 1.4.14 openafs-stable-1_4_14
Derrick Brashear [Fri, 17 Dec 2010 14:36:04 +0000]
openafs 1.4.14

perhaps 14 is luckier than 13. sigh.

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

13 years agoLinux: use DEFINE_MUTEX for afs_linux_alloc_sem on newer kernels
Alejandro R. Sedeño [Fri, 5 Nov 2010 21:24:43 +0000]
Linux: use DEFINE_MUTEX for afs_linux_alloc_sem on newer kernels

DECLARE_MUTEX is gone as of 2.6.37; afs_global_lock switches from
DECLARE_MUTEX to DEFINE_MUTEX at 2.6.16, so do the same here.

(cherry picked from commit f9409fcdffa594aff9530038a5ac81a2495da3b6)
Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3273
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

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

13 years agoLINUX: Use correct type of error in flock code openafs-stable-1_4_13
Simon Wilkinson [Wed, 11 Aug 2010 16:25:36 +0000]
LINUX: Use correct type of error in flock code

The flock code gets a kernel error code from afs_posix_lock_file()
but then passes this error code through afs_convert_code (which sees
that it is already negative, and returns EIO). Instead, we should just
return afs_posix_lock_file()'s code direct to our caller.

Reviewed-on: http://gerrit.openafs.org/2534
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5abe706a7e237d3872db3638d947a14c935370d5)
Change-Id: I8e12c9804cc81c8c88f820f55abd4ce863525c9a
Reviewed-on: http://gerrit.openafs.org/3533