openafs.git
11 years agoauth: Permit NULL fallback in localauth case
Simon Wilkinson [Sat, 2 Feb 2013 07:20:14 +0000]
auth: Permit NULL fallback in localauth case

Allow the caller of afsconf_PickClientSecObj to specify both
local authentication, and to request fallback to null authentication
if local auth isn't available.

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

11 years agorx: Fix AIX test_and_set_bit
Simon Wilkinson [Sat, 2 Feb 2013 07:17:53 +0000]
rx: Fix AIX test_and_set_bit

The AIX definition of rx_atomic_test_and_set_bit had its test the
wrong way round - so an already set bit would return false, and a clear
bit would return true. Fix this.

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

11 years agofix some typos in bos_setrestricted
Thorsten Alteholz [Wed, 30 Jan 2013 19:11:04 +0000]
fix some typos in bos_setrestricted

the real name of the command is: 'bos setrestricted'
it is sufficient to name 'bos install' only once

Change-Id: Ic68f7cb55466e1c92c34eeda37c0a64a11b7e4d8
Reviewed-on: http://gerrit.openafs.org/8990
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorx: convert rxinit_status to atomic
Derrick Brashear [Mon, 21 Jan 2013 21:13:56 +0000]
rx: convert rxinit_status to atomic

we don't need to use a lock just for this; switch to atomic and use that
to trigger configuration.

Change-Id: Ia96ec308dda51d1f6d13f290a23251c66665e499
Reviewed-on: http://gerrit.openafs.org/8930
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agodarwin: stop processing upcalls once rx shutdown starts
Derrick Brashear [Mon, 21 Jan 2013 21:10:17 +0000]
darwin: stop processing upcalls once rx shutdown starts

we have a chicken and egg. can't stop upcall without
killing socket; can't kill socket while rx might try to transmit on it.
cheat, and if rx is shut down, don't process things upcall receives.

FIXES 131577

Change-Id: I6b72f6e7aefb7937b768dcb9c0a83d0ee3317bfa
Reviewed-on: http://gerrit.openafs.org/8931
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Disable hard dead timeout for RDR File Server connections
Jeffrey Altman [Wed, 19 Dec 2012 21:52:34 +0000]
Windows: Disable hard dead timeout for RDR File Server connections

The UNIX cache manager does not implement hard dead timeouts
on file server connections.  The Windows cache manager had to
because of the SMB connection timeout requirements.  For the
AFS redirector there is no timeout requirement.  Therefore,
when the SMB stack is disabled the Windows cache manager can
disable the hard dead timeout.

The idle dead timeouts are in place to cancel connections when
file servers stop replying with real data.

Change-Id: I44f77b78a52e7cac3a88a53830748b77f3ff4000
Reviewed-on: http://gerrit.openafs.org/8828
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolibafsrpc: avoid more concurrent libtool
Derrick Brashear [Fri, 1 Feb 2013 13:42:49 +0000]
libafsrpc: avoid more concurrent libtool

libtool gets confused if it is running two instances in the same
directory, so make sure we build libafsrpc.a after the other things
we already single-stream.

Change-Id: I4c26b5707fdb73319563b063b45eb40b7ca1457e
Reviewed-on: http://gerrit.openafs.org/9017
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agorx: atomic bit ops
Simon Wilkinson [Mon, 21 Jan 2013 21:50:25 +0000]
rx: atomic bit ops

Add rx_atomic_test_bit, rx_atomic_set_bit, and rx_atomic_clear_bit
to provide bitwise operations over atomic types. These allow the
use of atomic flag variables.

Uses native platform atomic operations wherever these are available,
otherwise falls back to our 'standard' MUTEX based implementation.

LICENSE BSD

Change-Id: I161631b2408e85f757ff04bf831a631ccb1f930d
Reviewed-on: http://gerrit.openafs.org/8936
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: rename 'rbytes' to 'rxbytes' for clarity
Jeffrey Altman [Fri, 25 Jan 2013 08:25:46 +0000]
Windows: rename 'rbytes' to 'rxbytes' for clarity

Throughout cm_dcache.c, the various 'rbytes' represents the number
of bytes to be read from the next rx_Read or rx_Readv call.
Rename the variable to 'rxbytes' to improve clarity.

Change-Id: Iffd8dd397c0e6ab4cc44019b7f937a80f5d492d2
Reviewed-on: http://gerrit.openafs.org/8952
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Update Bulk I/O Descriptor
Jeffrey Altman [Thu, 3 Jan 2013 19:11:31 +0000]
Windows: Update Bulk I/O Descriptor

Update the cm_bulkIO_t and associated functions such that
the 'reserved' field is no longer a boolean indicated whether
or not buffers have been reserved but instead becomes a count
of the number of buffers that have been reserved.

buf_TryReserveBuffers is modified to return an afs_uint64
count of the number of buffers reserved instead of a boolean.

cm_SetupStoreBIOD, cm_SetupFetchBIOD, and cm_ReleaseBIOD altered
to store the reserved buffer count and use it when freeing the
BIOD.

Prior to this change it was not possible to reserve a count other
than the number of buffers it takes to store one chunkSize of data.

Change-Id: I78d71c77ffddd7f34278314fcfe9ee568b835a8b
Reviewed-on: http://gerrit.openafs.org/8951
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: reformat
Jeffrey Altman [Sun, 16 Dec 2012 07:02:06 +0000]
Windows: reformat

Change-Id: Ifba4f0d54032bd9580c97e7a94d2550e49b1a1ac
Reviewed-on: http://gerrit.openafs.org/8950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: handle CM_ERROR_RETRY in cm_Analyze()
Jeffrey Altman [Tue, 6 Nov 2012 11:41:47 +0000]
Windows: handle CM_ERROR_RETRY in cm_Analyze()

cm_Analyze() was not forcing a retry when it received CM_ERROR_RETRY.

Change-Id: I5c392623a3917bebdd5cb9bd86b030395d7a7d48
Reviewed-on: http://gerrit.openafs.org/8949
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Decrement Fcb OpenHandleCount while locked
Jeffrey Altman [Sat, 29 Dec 2012 20:58:06 +0000]
Windows: Decrement Fcb OpenHandleCount while locked

AFSCleanup performs tests on the Fcb Open Handle Count to determine
when to perform final cleanup tasks on the last handle close.  The
test is protected by holding the Fcb Resource.  If the Open Handle
Count is decremented after dropping the Resource, it creates a
race with other threads that might be blocked entering AFSCleanup
to close their handle on the same object.

Change-Id: I0403d8aeafd736484728a25c5c48ab28e8b8a804
Reviewed-on: http://gerrit.openafs.org/8863
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSOpenRoot obtain VolumeRoot OpenReferenceCount earlier
Jeffrey Altman [Sat, 29 Dec 2012 21:12:21 +0000]
Windows: AFSOpenRoot obtain VolumeRoot OpenReferenceCount earlier

In AFSOpenRoot obtain the VolumeRoot reference count before performing
any operations that require use of the VolumeRoot.  If the operations
fail, release the reference count.

Change-Id: I2e5a6574f87db858aa60d812c68f637266db529e
Reviewed-on: http://gerrit.openafs.org/8862
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: RDR FILE Processing Tracing
Jeffrey Altman [Sat, 29 Dec 2012 21:10:14 +0000]
Windows: RDR FILE Processing Tracing

Additional/improved trace messaging for name not found and
path not found errors.

Change-Id: Ieedbee072c0f2c7050a33734fe16b4dfc0504cea
Reviewed-on: http://gerrit.openafs.org/8861
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: DirOpenReferenceCount reorganizing completed
Jeffrey Altman [Sat, 29 Dec 2012 05:57:31 +0000]
Windows: DirOpenReferenceCount reorganizing completed

This patchset completes the reorganizing of the DirOpenReferenceCount
handling.  Now that every AFSCcb is given a refCount in AFSInitCcb()
which is released in AFSRemoveCcb() it is possible to simplify some
of the logic surrounding DirOpenReferenceCount handling across
the AFSCommonCreate -> XXX -> AFSLocateNameEntry -> {MountPoint, Symlink}
call sequences.

Wherever possible releasing of DirOpenReferenceCounts occur in a
functions try_exit block.  AFSCommonCreate() uses the new variables
bReleaseDir and bReleaseParentDir to track whether these refcounts
need to be released.  Additional comments document the decision
making.

There was at least one code path in AFSLocateNameEntry() where
the DirOpenReferenceCount could be dropped when it should not have
been. (pExistingDirNode == pDirNode).

Change-Id: I266a902ad4c44b4b8e49258c2da4acd2df1f4476
Reviewed-on: http://gerrit.openafs.org/8860
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: NameArray DIRENTRY_REF_COUNT logging
Jeffrey Altman [Sat, 29 Dec 2012 05:51:55 +0000]
Windows: NameArray DIRENTRY_REF_COUNT logging

Include the NameArray pointer in the AFS_SUBSYSTEM_DIRENTRY_REF_COUNTING
log messages generated from the NameArray management routines.  This
permits correlation between the reference count changes and the
NameArray to which they were associated.

Change-Id: Ieb1b78dec35b91fe2b325ed9da760f56e98759c3
Reviewed-on: http://gerrit.openafs.org/8859
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSSetRenameInfo DIRENTRY_REF_COUNTING
Jeffrey Altman [Sat, 29 Dec 2012 05:49:43 +0000]
Windows: AFSSetRenameInfo DIRENTRY_REF_COUNTING

When logging the result of the DirOpenReferenceCount increment,
use lCount instead of referencing the DirOpenReferenceCount field
which could have been changed.

Change-Id: I2227472bf903c347e505e4e1d8b60d35e176c0df
Reviewed-on: http://gerrit.openafs.org/8858
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSSetFileLinkInfo() DirOpenReferenceCount handling
Jeffrey Altman [Sat, 29 Dec 2012 05:44:27 +0000]
Windows: AFSSetFileLinkInfo() DirOpenReferenceCount handling

AFSSetFileLinkInfo() would leak a DirOpenReferenceCount when
pNewTargetDirEntry is not NULL upon exit.  It also did not
properly handle a STATUS_REPARSE response from AFSNotifyHardLink().
The AFSInsertDirectoryNode() call should not be performed when
the result is STATUS_REPARSE since that means the entry already
exists.

Change-Id: Ibbf497cb4c3c412e4f95cdffc6025f03f0e2ed8b
Reviewed-on: http://gerrit.openafs.org/8857
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSNotifyHardLink() DirOpenReferenceCount handling
Jeffrey Altman [Sat, 29 Dec 2012 05:40:25 +0000]
Windows: AFSNotifyHardLink() DirOpenReferenceCount handling

This patchset consolidates the releasing of the DirOpenReferenceCount
within AFSNotifyHardLink() into the try_exit block.  This clarifies
the logic and avoids duplicate code blocks.

Change-Id: I7bf7e5af55646ea570c76e36a673900521a3582c
Reviewed-on: http://gerrit.openafs.org/8856
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSNotifyFileCreate() DirOpenReferenceCount handling
Jeffrey Altman [Sat, 29 Dec 2012 05:36:44 +0000]
Windows: AFSNotifyFileCreate() DirOpenReferenceCount handling

This patchset consolidates the releasing of the DirOpenReferenceCount
within AFSNotifyFileCreate() into the try_exit block.  This clarifies
the logic and avoids duplicate code blocks.

Change-Id: I82e964f579f9e8b6e095291ace0bbe2cdac5af60
Reviewed-on: http://gerrit.openafs.org/8855
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSClose() DirOpenReferenceCount handling
Jeffrey Altman [Sat, 29 Dec 2012 05:29:45 +0000]
Windows: AFSClose() DirOpenReferenceCount handling

Unless the caller of AFSRemoveCcb() steals the DirectoryCB object
from the AFSCcb before calling AFSRemoveCcb(), AFSRemoveCcb() will
release the reference count.

In all but one case where the DirectoryCB must be accessed after
the AFSCcb is destroyed AFSClose() can now let AFSRemoveCcb() do the
work.

Change-Id: I8d631d79b2465cd6f2e31444fd052270b078915c
Reviewed-on: http://gerrit.openafs.org/8854
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Fix AFSLocateNameEntry prototype
Jeffrey Altman [Sat, 29 Dec 2012 05:28:04 +0000]
Windows: Fix AFSLocateNameEntry prototype

The VolumeCB parameter is an IN/OUT parameter.

Change-Id: I3eb4231e0d095cc98cc5847905d61d924d12e6f3
Reviewed-on: http://gerrit.openafs.org/8853
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSInitCcb redefinition
Jeffrey Altman [Sat, 29 Dec 2012 05:17:59 +0000]
Windows: AFSInitCcb redefinition

The new AFSInitCcb() allocates its own DirOpenReferenceCount to
associate with the AFSCcb.DirectoryCB.

It also accepts the GrantedAccess mask and the FileAccess values
which are stored in the AFSCcb.

These changes simplify the callers and remove responsibility of
tracking whether or not the DirOpenReferenceCount was successfully
associated with the AFSCcb.

The allocated DirOpenReferenceCount is always released by
AFSRemoveCcb().

Change-Id: Ib475310d934830974c553e0eeff96b114a56541b
Reviewed-on: http://gerrit.openafs.org/8852
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: AFSRemoveCcb cannot fail
Jeffrey Altman [Thu, 27 Dec 2012 19:41:29 +0000]
Windows: AFSRemoveCcb cannot fail

Since AFSRemoveCcb cannot fail, change the signature from returning
NTSTATUS to void.

Remove all error handling code.

Change-Id: Ifa893a714f97cefb9bd122ab84508e5d36987e88
Reviewed-on: http://gerrit.openafs.org/8851
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoRework set_header_word macros
Marc Dionne [Sat, 22 Dec 2012 12:54:54 +0000]
Rework set_header_word macros

Rework the set_header_word macros so that all compilers are
happy:
- the use of offsetof() is avoided, as it has an issue on IRIX
when the result is not constant
- the assignment within the macro is explicitely sequenced before
the function call to avoid a gcc sequence-point warning

Change-Id: I2355233e865b155f958379bfa2736fee19ef2680
Reviewed-on: http://gerrit.openafs.org/8816
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoNEWS updates for 1.6.2
Ken Dreyer [Wed, 12 Dec 2012 17:37:47 +0000]
NEWS updates for 1.6.2

Add an entry for 1.6.2 with "in progress" instead of a date to hold the
release notes for 1.6.2pre4 rather than creating separate entries for
each release candidate. Users who track the release candidates can refer
to the public announcements, and this will be cleaner when reading
history later on.

Change-Id: I625044e20836e072b62ffa738eca23f1d11813a5
Reviewed-on: http://gerrit.openafs.org/8750
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>

11 years agoCellServDB update 28 Jan 2013
Stephan Wiesand [Mon, 28 Jan 2013 14:53:36 +0000]
CellServDB update 28 Jan 2013

Change-Id: Icb622cc5480aeba108b9a11f55cfb44ab7f7c262
Reviewed-on: http://gerrit.openafs.org/8982
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agolibafs: fs flushall for unix cm
Michael Meffie [Thu, 7 Jun 2012 18:46:04 +0000]
libafs: fs flushall for unix cm

Implement the fs flushall command on the unix cache manager to flush
all volume data.  Uses a new common pioctl code point VIOC_FLUSHALL (14),
registered with the grand.central.org assigned numbers.

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

11 years agoWindows: Use %p for ptrs in redirector trace messages
Jeffrey Altman [Thu, 24 Jan 2013 03:50:26 +0000]
Windows: Use %p for ptrs in redirector trace messages

Pointers were being logged with %08lX which results in partial
pointer values being logged on 64-bit systems.

Change-Id: Ic11e5b607b3df41f145536dfcb02dfa22537ee77
Reviewed-on: http://gerrit.openafs.org/8943
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoSOLARIS: Use vn_renamepath as early as possible
Andrew Deason [Fri, 18 Jan 2013 20:27:16 +0000]
SOLARIS: Use vn_renamepath as early as possible

Commit 6c509601 uses the vn_renamepath when we are building on Solaris
11. However, some recent patch level of Solaris 10 (more recent than
stock 10u10) has the same problem fixed by that commit, where
vn_setpath takes an additional argument. So instead, just test for the
existence of vn_renamepath itself, so we also use it on Solaris 10
when we can.

Thanks to Rich Sudlow for reporting this.

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

11 years agoaklog: Fix allow_weak_crypto warning
Andrew Deason [Tue, 22 Jan 2013 21:41:38 +0000]
aklog: Fix allow_weak_crypto warning

It's _crypto, not _enctypes. The user will just be more confused than
before if we tell them to do the wrong thing.

Change-Id: Ib94b14efbd3c89d9f58fb8985326ee8691fd993b
Reviewed-on: http://gerrit.openafs.org/8938
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agorx: Remove warning inhibition on rx.c
Simon Wilkinson [Fri, 18 Jan 2013 22:54:03 +0000]
rx: Remove warning inhibition on rx.c

The CFLAGS_NOERROR rule for rx.c seems to have crept back in as
part of the libtool changes. The LWP build of rx.c has never had
warning inhibition on rx.c, and the inhibition in the pthread
builds was removed by 327762071be3806c5d08be0218982c7027754756

Change-Id: Icde3f0b6ee2f8ae0818a3dc722c6171284d6a9e6
Reviewed-on: http://gerrit.openafs.org/8921
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoFreeBSD 9.1: Warning fixes
Andrew Deason [Fri, 18 Jan 2013 23:05:12 +0000]
FreeBSD 9.1: Warning fixes

Fix warnings caused by some changes in FreeBSD 9.1:

 - afs_cmount takes a uint64_t for flags instead of an int
 - vn_rdwr takes a ssize_t* for resid instead of an int*

[kaduk@mit.edu: rebase onto master and use fine-grained version checks]

Change-Id: I03ab805a625790004a910df96b96aeda1121e2a7
Reviewed-on: http://gerrit.openafs.org/8922
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Police Library IOCTLs
Rod Widdowson [Sun, 30 Dec 2012 11:13:24 +0000]
Windows: Police Library IOCTLs

Ensure that the callers of the various library ioctls have
the correct identity or privs.  All this policing is done in
the fs (non unloadable) layer, and to ensure that the library
layer cannot receive these calls directly we forbid non
create Opens of the library control device.

Change-Id: I2342fe10047642082adfbd1cc6aaee09cc91b520
Reviewed-on: http://gerrit.openafs.org/8893
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Police the DEBUG TRACE ioctls
Rod Widdowson [Fri, 28 Dec 2012 15:00:15 +0000]
Windows: Police the DEBUG TRACE ioctls

When we get a IOCTL_AFS_GET_TRACE_BUFFER, a IOCTL_AFS_CONFIGURE_DEBUG_TRACE
or a IOCTL_AFS_FORCE_CRASH, we check to see whether the caller is in the
Administrators group and if it isn't we fail the request with ACCESS_DENIED.

NOTE that this does not check whether the user has done the "run as admin"
thing.  We actually need to determine which priviledges are appropriate to
this action and use that rather than group membership to police these actions
and this will be added in a later patch.  Meanwhile this represents a
significant increment in security from previously.

Change-Id: I0997e59a82735735674d8edee7a7a68d241e6ef8
Reviewed-on: http://gerrit.openafs.org/8843
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agomacos: update decode-panic
Derrick Brashear [Mon, 21 Jan 2013 16:57:54 +0000]
macos: update decode-panic

fix a couple brain-os from the last round of updates, so it can
actually decode panics.

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

11 years agoImprove libroken configure check
Andrew Deason [Thu, 17 Jan 2013 21:37:06 +0000]
Improve libroken configure check

It is not sufficient to just check if libroken is available; we need
to check if the specific functionality we want is there. So, try to
compile and link while referencing specific functions.

As mentioned in the comments, testing every single function we use may
not be practical, and we should perhaps just add functions to test as
we find breakage. This commit tests rk_rename, which is missing in at
least the Debian package heimdal-dev, version
1.4.0~git20100726.dfsg.1-2+squeeze1.

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

11 years agoxstat: length check cm call info
Michael Meffie [Mon, 10 Dec 2012 23:00:25 +0000]
xstat: length check cm call info

Define the cm xstat function call counters with an xmacro to avoid
duplicating the list of cm function names.  This obviates the need
to update xstat_cm_test.c when new function names are added to the
cm xstat collection id 0.

Check the number of returned records when printing the function call
counts to avoid over-running when a newer xstat_cm_test client
receives data from an older cm.

Change-Id: I3c5470afb7b04167173b41bb576a4a6ec14753f7
Reviewed-on: http://gerrit.openafs.org/8741
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoxstat: remove unused call info function
Michael Meffie [Mon, 10 Dec 2012 23:02:20 +0000]
xstat: remove unused call info function

Remove the dead function PrintCallInfo(), which was replaced
by print_cmCallStats() long, long ago.

Change-Id: Id67323d66cc498f77e55f173218547ad5d4223c7
Reviewed-on: http://gerrit.openafs.org/8740
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoOpenBSD: Add support for missing routine memmove() in kernel.
Antoine Verheijen [Mon, 21 Jan 2013 08:48:01 +0000]
OpenBSD: Add support for missing routine memmove() in kernel.

OpenBSD does not have the memmove() routine available to dynamically
loaded modules in its kernel. It exists but is not exported so it
winds up "mia" on dynamic load of the kernel module. It's needed for
the Heimdal code that's been added into OpenAFS. This patch deals
with this issue by creating an inline version in the OS-specific
param.h file.

Note that this issue does not seem to exist in the amd64 version of
OpenBSD so (at least for now) tis fix is only applied to the i386
version of the header files.

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

11 years agoOpenBSD 4.6/4.7: Define curproc for rx_atomic.h.
Antoine Verheijen [Mon, 21 Jan 2013 06:27:02 +0000]
OpenBSD 4.6/4.7: Define curproc for rx_atomic.h.

For OpenBSD 4.6 and 4.7, the rx_atomic.h header ultimately resorts
to the use of the default atomic routines that rely on MUTEX
macros. Those macros require that 'curproc' be defined, which in
turn requires the presence of the 'sys/proc.h' header. This patch
inserts that header into the param.h file for those systems.

Note that subsequent versions of OpenBSD have __sync_fetch_and_add
and don't require 'curproc' as a result.

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

11 years agoLinux 3.8: vmtruncate removal
Marc Dionne [Thu, 10 Jan 2013 02:22:27 +0000]
Linux 3.8: vmtruncate removal

vmtruncate had been deprecated for a while and has now been
removed.  Do things the new way based on truncate_setsize.

Change-Id: If584329f7330f44be3909e4c8b935e4fe5e2b536
Reviewed-on: http://gerrit.openafs.org/8906
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux 3.8: session_keyring changes
Marc Dionne [Thu, 10 Jan 2013 00:26:54 +0000]
Linux 3.8: session_keyring changes

The session_keyring is now attached directly to the cred structure
and the thread_group_cred structure (cred->tgcred) no longer exists.

Adapt code that makes use of tgcred, and use the standard rcu based
mechanism to update session_keyring.

Change-Id: If4b88cbc7f9af6343353648837b28541a5088429
Reviewed-on: http://gerrit.openafs.org/8905
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLinux: setpag() may replace credentials
Marc Dionne [Sat, 19 Jan 2013 03:40:03 +0000]
Linux: setpag() may replace credentials

For recent Linux. setpag() may replace the current process' cred
structure with a new one.  This is not a problem for most callers,
but in the case of processing a SetTokens2 pioctl with the setpag
option, the new credentials should be used to determine the target
for the token.

Change-Id: I4441349b8a72eac7d56276abcdf243b2ffd21b98
Reviewed-on: http://gerrit.openafs.org/8924
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agorxperf: print achieved transfer rate
Dan van der Ster [Fri, 14 Dec 2012 10:08:44 +0000]
rxperf: print achieved transfer rate

Prints the client transfer rate in appropriate units (kbit/s, Mbit/s, or Gbit/s).

Change-Id: I5632185953c5d2bfc962af71152734d842cfb021
Reviewed-on: http://gerrit.openafs.org/8758
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoCatch up to FreeBSD KPI for vfs_cmount
Ben Kaduk [Fri, 11 Jan 2013 18:03:02 +0000]
Catch up to FreeBSD KPI for vfs_cmount

Almost a year ago, mckusick changed the VFS KPI/KBI for the cmount
VFS operation, making the flags argument a 64-bit quantity.
Introduce appropriate conditionals for our prototype of afs_cmount
for the change on the 10.x and 9.x branches.

Change-Id: Ia0b8759f027e64f98f087daabbf1a51030171f21
Reviewed-on: http://gerrit.openafs.org/8907
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLINUX: fix array indexing issue in memory statistics
Chas Williams (CONTRACTOR) [Thu, 17 Jan 2013 02:16:31 +0000]
LINUX: fix array indexing issue in memory statistics

The comma is a sequence point and i gets incremented and then used.
This results in writing past the end of the array by one (and failing
to initialize the first element as well).

Potential fix for RT ticket 131566.

Change-Id: Iabe7e78961d1f5348bca75ca5b9e6e29d8554957
Reviewed-on: http://gerrit.openafs.org/8914
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoubik: Remove bare global ubik_epochTime
Andrew Deason [Thu, 17 Jan 2013 22:35:09 +0000]
ubik: Remove bare global ubik_epochTime

Commit e4ac552a moved ubik_epochTime into a global version_globals
struct. However, it missed a references to the existing
ubik_epochTime value it was moving, as well as its declaration. Remove
the declaration, and move the reference to use the version_globals
structure.

Change-Id: I2552ba850f286b2b93f3c1b696d993a7cfc074c8
Reviewed-on: http://gerrit.openafs.org/8918
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoubik: Trivial formatting fix
Andrew Deason [Thu, 17 Jan 2013 22:37:56 +0000]
ubik: Trivial formatting fix

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

11 years agogcc 4.8: fix warnings
Marc Dionne [Wed, 9 Jan 2013 23:42:32 +0000]
gcc 4.8: fix warnings

Quiet new warnings introduced by gcc 4.8:

- Many unused typedefs under src/admin.
- A possibly uninitialzed variable under src/viced

Change-Id: I96858c2d12a9ee3270d89a64fcf772affe93e9eb
Reviewed-on: http://gerrit.openafs.org/8913
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agodoc: dynamic mount requires dynroot and fakestat
Michael Meffie [Mon, 10 Dec 2012 17:01:38 +0000]
doc: dynamic mount requires dynroot and fakestat

Document that dynamic mount (/afs/.:mount) requires
dynroot and fakestat on non-linux unix.

Change-Id: I947edd30d510c7cc6840bc2cc74d0ef07b692afb
Reviewed-on: http://gerrit.openafs.org/8739
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>

11 years agoSOLARIS: Avoid open count cleanup for Solaris 11
Andrew Deason [Tue, 8 Jan 2013 23:50:57 +0000]
SOLARIS: Avoid open count cleanup for Solaris 11

The comments in here no longer apply to Solaris, as of OpenSolaris
commit 11736:63a134e1f09c by Donghai Qiao (4492533 Filesystems may
need VOP_CLOSE() for executables following a VOP_OPEN()). This means
that this workaround should no longer be necessary for any Solaris 11
release, any illumos release, and anything else based off of
OpenSolaris. So, stop doing it.

Thanks to Frank Batschulat for pointing this out, and providing all of
the details.

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

11 years agoSOLARIS: Use vn_renamepath when available
Andrew Deason [Tue, 8 Jan 2013 23:41:21 +0000]
SOLARIS: Use vn_renamepath when available

In Solaris 11.1, the signature of vn_setpath changes; it gains an
extra boolean_t argument called 'force'. Instead of trying to adapt to
it, call vn_renamepath() instead, which will do the correct thing and
call vn_setpath &co for us. vn_renamepath has existed since Solaris 10
Update 8, and is in all releases of Solaris 11. Only call it in
Solaris 11, since it makes the ifdefs easier, and there are no
problems with calling vn_setpath on Solaris 10.

Thanks to Frank Batschulat for all of the relevant information.

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

11 years agoFix build for separate objdirs
Ben Kaduk [Mon, 7 Jan 2013 20:05:40 +0000]
Fix build for separate objdirs

In particular, setting UNTHREADED=${srcdir}/dir and then referring
to ${srcdir}/${UNTHREADED} is a recipe for sadness.

Fix the libtool invocation to correctly find .la.sym files in ${srcdir}.

Also add some missing header dependencies that are hidden when building
in the src tree.

Change-Id: I1b663141c549cc4b90e46327c3fb31dc80294eaa
Reviewed-on: http://gerrit.openafs.org/8891
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoWindows: Restrict the Service IOCTLS to the service process
Rod Widdowson [Fri, 28 Dec 2012 15:43:52 +0000]
Windows: Restrict the Service IOCTLS to the service process

When the service starts the system we save it's PID and when we see a
IOCTL_AFS_INITIALIZE_REDIRECTOR_DEVICE,
IOCTL_AFS_PROCESS_IRP_REQUEST, IOCTL_AFS_PROCESS_IRP_RESULT,
IOCTL_AFS_SYSNAME_NOTIFICATION or IOCTL_AFS_SYSNAME_NOTIFICATION
ioctl we check that the calling process has that PID.

Change-Id: Ie66676bba4b4e4d858979babe9c0af4c53ea0143
Reviewed-on: http://gerrit.openafs.org/8844
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agocorrect whitespace errors in readme files
Michael Meffie [Sat, 5 Jan 2013 18:37:51 +0000]
correct whitespace errors in readme files

Fix the trailing whitespace and leading spaces
before tabs in the readme files.

Change-Id: If20e528ddb28f82e4d3d1b1f03dec8670f914afc
Reviewed-on: http://gerrit.openafs.org/8877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Only allow the local system account to speak to the redirector
Rod Widdowson [Fri, 28 Dec 2012 14:40:40 +0000]
Windows: Only allow the local system account to speak to the redirector

When we get the IOCTL_AFS_INITIALIZE_CONTROL_DEVICE IOCTL we check to
see whether the calling process is the LOCAL_SYSTEM_SID (the one that
services run at if they are not running as a specified SID).  If we
are not then the initialize fails ACCESS_DENIED.

If the debug build ONLY, setting the AFS_DBG_DISABLE_SYSTEM_SID_CHECK
bit in OpenAFSDebugFlags circumvents this check, allowing interactive
debugging.

Existing code stops two processes (or even handles) from trying to
initialize the system.

Change-Id: I2ef8ca3a0df908acba38b435178d0509e96d6114
Reviewed-on: http://gerrit.openafs.org/8842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agolibadmin/vos/vosutils.c: mask out sign-extension
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:59 +0000]
libadmin/vos/vosutils.c: mask out sign-extension

Right-shifting a signed int by 24 bits can produce a value outside of
0..0xff due to sign-extension.  As a result, in AddressMatch(), the
first bPattern!=255 check can never succeed.  Fix by masking with 255
before comparison.

Change-Id: Idb0b4c176ff120c7cf0e03a935ebfdca51084bbd
Reviewed-on: http://gerrit.openafs.org/8884
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agolwp/iomgr.c: avoid off-by-one out-of-bounds access
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:46 +0000]
lwp/iomgr.c: avoid off-by-one out-of-bounds access

Avoid accessing sigDelivered[NSIG] and sigEvents[NSIG], which are
out-of-bounds by one.

Change-Id: Id6a1798cba901987b8103f287e0869b31040b45b
Reviewed-on: http://gerrit.openafs.org/8883
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agobutm/file_tm.c: check for null pointer before dereferencing
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:33 +0000]
butm/file_tm.c: check for null pointer before dereferencing

Move the null pointer check to before the pointer is dereferenced.

Change-Id: I9983dae8802706c1efeff8a507a001b649572686
Reviewed-on: http://gerrit.openafs.org/8882
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoauth/authcon.c: fix likely mistake
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:21 +0000]
auth/authcon.c: fix likely mistake

It seems likely the original developer intended to check
*scIndex==RX_SECIDX_NULL rather than scIndex==RX_SECIDX_NULL.

Change-Id: I8a33d3cb177a9212917613581957073392b08314
Reviewed-on: http://gerrit.openafs.org/8881
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>

11 years agotools/dumpscan/pathname.c: properly check strdup() return value
Nickolai Zeldovich [Sun, 6 Jan 2013 04:45:11 +0000]
tools/dumpscan/pathname.c: properly check strdup() return value

Fix the check for strdup() running out of memory.

Change-Id: I4e2d83036095c7b292ee4c386d8ed7b16ec75067
Reviewed-on: http://gerrit.openafs.org/8880
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoubik/udebug.c, vol/vol-info.c: check array index before dereferencing
Nickolai Zeldovich [Sun, 6 Jan 2013 04:44:55 +0000]
ubik/udebug.c, vol/vol-info.c: check array index before dereferencing

Avoid out-of-bounds array accesses by first checking that the index
is in-bounds, and then dereferencing; not the other way around.

Change-Id: Ib36a28ca6181a7a7fd602de45cb5a15fad099a44
Reviewed-on: http://gerrit.openafs.org/8879
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agovolser/vol_split.c: do not dereference known-NULL pointer
Nickolai Zeldovich [Sun, 6 Jan 2013 04:44:33 +0000]
volser/vol_split.c: do not dereference known-NULL pointer

Avoid dereferencing a pointer that we just checked is NULL when printing
an error message.

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

11 years agospelling corrections in readme files
Michael Meffie [Sat, 5 Jan 2013 15:40:42 +0000]
spelling corrections in readme files

Fix spelling errors in readme files.

Change-Id: I62348372d5e226f2b2a3a7732b4a5f8c7331b2ff
Reviewed-on: http://gerrit.openafs.org/8876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>

11 years agoSOLARIS: Look for ncurses in ncurses/ncurses.h
Andrew Deason [Fri, 4 Jan 2013 19:18:40 +0000]
SOLARIS: Look for ncurses in ncurses/ncurses.h

Solaris 11+ has ncurses.h in ncurses/ncurses.h. Look for it there.

Without this, on Solaris 11.1 we will detect libncurses automatically
(because it lives in /usr/lib), but not ncurses.h (since it is in
ncurses/ncurses.h, not ncurses.h). So, we will fall back to curses.h,
but will try to link to libncurses, which, as you might guess, fails
with various undefined symbols.

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

11 years agoSOLARIS: Avoid areq and auid conflict
Andrew Deason [Fri, 4 Jan 2013 18:47:35 +0000]
SOLARIS: Avoid areq and auid conflict

On new Solaris (11.1), nfs/auth.h #defines areq and auid to access
some elements inside the nfsauth_arg structure more easily. We have a
lot of functions that use those names as parameters, so the compiler
throws an error (since we have a decl like "struct vrequest
*areq_u.areq").

We cannot avoid including that header, since we need some NFS-related
headers for the NFS xlator, and they pull in nfs/auth.h
unconditionally. So, work around this by undefining areq and auid
afterwards.

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

11 years agoafs: Check dv against localhero aincr
Andrew Deason [Wed, 2 Jan 2013 19:09:06 +0000]
afs: Check dv against localhero aincr

For operations that modify directories, we call afs_LocalHero to
determine if we can perform the directory modification in our local
cache, and avoid fetching the dir blob from the fileserver. Currently,
afs_LocalHero assumes that the DV received from the fileserver is
correct, and will update the cache DV as long as we have a valid
callback on the file.

If for any reason the client cache falls out of sync with what's on
the fileserver, this can cause the client to incorrectly believe its
cache is up to date. Since, the cached data will be marked with the
newest DV, even if the DV on the server has jumped to be larger than
we expected.

While the client cache should never fall out of sync with the
fileserver, in the past this has been possible due to other bugs
(fileserver idle dead processing and client VNOSERVICE handling).
Assuming that the given DV is correct is also just unnecesarily
fragile, since we can always check if it is correct, so just check it,
and add some comments helping explain what's going on here. Note that
regular file writes effectively already check this.

Note that this change makes use of the 'aincr' argument to
afs_LocalHero, which was previously unused. aincr appears to have been
used for a purpose similar to this before OpenAFS 1.0, but was
removed, possibly accidentally.

It is possible this change negatively affects, or even breaks
(unlikely), functionality with the AFS<->DFS translator. Although
nothing of the sort has been seen, it is difficult to know one way or
the other, due to the lack of available DFS translators.

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

11 years agovol: correct old conditional for IH_CONDSYNC
Mark Vitale [Fri, 21 Dec 2012 23:26:18 +0000]
vol: correct old conditional for IH_CONDSYNC

Two places in the vol package performed IH_CONDSYNC(vp->linkHandle)
only if AFS_NT40_ENV.  This was correct when the namei implementation
was windows only; however, this ifdef was apparently overlooked
when namei was implemented for UNIX.

Change-Id: I0cbe2c5c0a65ece0485b8c2d5a5f92eeb53725fe
Reviewed-on: http://gerrit.openafs.org/8815
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoMake MIN/MAX code in rx/rx_packet.h more readable
Russ Allbery [Thu, 3 Jan 2013 22:09:02 +0000]
Make MIN/MAX code in rx/rx_packet.h more readable

Eventually all MIN/MAX code in the tree should be handled uniformly,
but until that day, make this chunk of it more readable and
document the odd exception case for Linux kernel builds.

Change-Id: I4afe5d99b63010df831943e6b82ff89733b08066
Reviewed-on: http://gerrit.openafs.org/8871
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoEnsure MIN/MAX are defined in userspace builds of rx
Russ Allbery [Thu, 3 Jan 2013 21:57:02 +0000]
Ensure MIN/MAX are defined in userspace builds of rx

The include of <sys/param.h> was removed from rx_packet.h on
Linux 2.6 and later to fix kernel builds with 3.7, which doesn't
have that header in kernel space.  However, while kernel space
always provides MIN/MAX defines, userspace relied on the header.
On at least powerpc, no other include chain includes sys/param.h,
so MIN/MAX were left undefined.

Fix this by only skipping the include of <sys/param.h> on Linux
if building in kernel mode.

Change-Id: Icd2edd645ef4d18d626de8ce8b81ac07f37b1f21
Reviewed-on: http://gerrit.openafs.org/8870
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoFix spelling error (retreive for retrieve) in strings
Russ Allbery [Thu, 3 Jan 2013 17:13:26 +0000]
Fix spelling error (retreive for retrieve) in strings

Caught by Lintian analysis of the compiled binaries.

Change-Id: I5d53d596d30ad8fea5d3f8f0116122a8c1aa808c
Reviewed-on: http://gerrit.openafs.org/8865
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoviced: initInterfaceAddr_r regardless of ICBS code
Andrew Deason [Fri, 28 Dec 2012 18:16:49 +0000]
viced: initInterfaceAddr_r regardless of ICBS code

Currently we only call initInterfaceAddr_r for a host if a call to
RXAFS_InitCallBackState3 succeeds. However, this leaves the host
without a host->interface structure, which indicates that the host
does not support UUIDs, and is represented by just a single host,port
pair.

But this is not correct; the host probably does have the relevant UUID
associated with it, but it is just not responding. So, with the
current code, we create a uuid-less host structure for a host that
probably has a uuid; that host structure will probably never be used,
and will just get deleted later.

So instead, always call initInterfaceAdd_r. Do it before the ICBS
call, so the host will be findable via UUID as early as possible. If
the ICBS call fails, the host will be marked as 'down' later on.

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

11 years agoviced: Avoid dangling uuid hash table entry
Andrew Deason [Fri, 28 Dec 2012 17:58:33 +0000]
viced: Avoid dangling uuid hash table entry

Currently we add a given host to the uuid hash table, then call
RXAFS_InitCallBackState3, and then only initialize the host->interface
structure if the ICBS3 call succeeded.

If the ICBS3 call fails, we have added a host to the uuid hash table,
but the host structure does not contain that uuid. If the host is then
deleted, we will not remove the host from the uuid hash table (since
host->interface is NULL), and so the uuid hash table entry will still
point to the freed host. If that host is then later looked up via that
uuid, we can reference a freed host, which can cause all kinds of
undefined behavior.

So instead, add the host to the uuid hash table at the same time that
we initialize the host->interface structure, inside
initInterfaceAddr_r.

FIXES 131277

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

11 years agovol: fix everything to use volumeid type
Derrick Brashear [Fri, 28 Dec 2012 05:46:12 +0000]
vol: fix everything to use volumeid type

use one type for volumeid, not 3. kill VolId, and stop
using afs_uint32 (and a few times, afs_int32)

Change-Id: Ibcbd09b5a24d8720b02a02f926e6f59dc0f529aa
Reviewed-on: http://gerrit.openafs.org/8845
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agovol: use header access macros everywhere
Derrick Brashear [Fri, 21 Dec 2012 11:44:18 +0000]
vol: use header access macros everywhere

a couple direct references to diskstuff have crept in. push them
back out

Change-Id: I66c7a157aeb326dee17012d551c0f499bae35bc7
Reviewed-on: http://gerrit.openafs.org/8807
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoafs: Add a little more info on SLVC loop panic
Andrew Deason [Fri, 28 Dec 2012 21:49:20 +0000]
afs: Add a little more info on SLVC loop panic

If we panic due to a perceived infinite loop, log a little more info
about our loop iterations.

Change-Id: Ifbb6d613aa482dbc33f7ba13dc959709e1688f15
Reviewed-on: http://gerrit.openafs.org/8850
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoafs: Avoid unnecessary panic in ShakeLooseVCaches
Andrew Deason [Fri, 28 Dec 2012 21:39:15 +0000]
afs: Avoid unnecessary panic in ShakeLooseVCaches

afs_vcount can change as we traverse the loop. If we successfully
evict something from the cache, afs_vcount goes down, but our loop
variable 'i' stays incremented. For example, if afs_vcount was 100 at
the start of the loop and we kicked out 50 things, by the time we
traverse the entire VLRU, we could have iterated over the loop 100
times, but afs_vcount would still be just at 50.

So, remember what afs_vcount was at the start of the loop, and use
that for our loop limit. Note that vcaches cannot be added to the VLRU
during the execution of this loop, since we're just kicking stuff out.
And nobody else can modify the VLRU but us, since we're holding
afs_xvcache, and if we drop afs_xvcache, we restart the whole eviction
process.

The bug here was introduced by commit bc6dd950, but usually did not
affect Linux until commit 696db866.

FIXES 131553

Change-Id: If30026b5b2101559e704d0e1961effe14beb915f
Reviewed-on: http://gerrit.openafs.org/8849
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoafs: Consolidate ShakeLooseVCaches retry init
Andrew Deason [Fri, 28 Dec 2012 21:36:42 +0000]
afs: Consolidate ShakeLooseVCaches retry init

Don't duplicate the initialization code in effectively three separate
places. Just goto the top of the loop again.

This should incur no functional change; it's just reorganization.

Change-Id: I40548919a5fa9c4e472a4de0eada8d213d034097
Reviewed-on: http://gerrit.openafs.org/8848
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoLINUX: Avoid infinite d_invalidate loop
Andrew Deason [Wed, 12 Dec 2012 22:14:55 +0000]
LINUX: Avoid infinite d_invalidate loop

In afs_linux_lookup, we try to invalidate as many dentry aliases as we
can. However, a successful d_invalidate() against a dentry does not
necessarily mean that the dentry will not show up in a later
d_find_alias() call. This is because d_invalidate() does not remove
the dentry from the d_alias list, but just removes it from the hash
chain. dput() is what removes it from the d_alias list when all of the
references go away. If a reference is grabbed between our
d_invalidate() and dput() calls, the dentry will stay on the d_alias
list.

We will then retry the loop, and we will get the same dentry back from
d_find_alias(). Running d_invalidate() on an unhashed dentry is a
no-op, so we don't change anything in the loop. We will retry again
and again, looping forever and spinning the CPU.

To avoid this, just call d_prune_aliases instead, instead of
repeatedly looping through the alias list ourselves. Note that this
does remove our check for DCACHE_DISCONNECTED in each alias' d_flags.
This should not be a problem, since we will still use any remaining
DCACHE_DISCONNECTED dentry via d_splice_alias if one still exists.

Change-Id: I8a09a922d07f2c4971269f3c681c748c33bf8e3d
Reviewed-on: http://gerrit.openafs.org/8751
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agovol: use defines for header name length
Derrick Brashear [Thu, 20 Dec 2012 20:54:57 +0000]
vol: use defines for header name length

instead of randomly hardcoding numbers in several places,
use macros

Change-Id: I153cbe74d0d297496fb39449c4a71ec81d5637c5
Reviewed-on: http://gerrit.openafs.org/8806
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoAdd configure option to not install kauth
Ben Kaduk [Thu, 8 Nov 2012 23:40:57 +0000]
Add configure option to not install kauth

Per http://www.openafs.org/pages/no-more-des.html the kaserver
suite of utilities is deprecated and is not supposed to be built
anymore in this post-1.6 world.
Not building them at all requires some effort, but not installing
them is pretty easy.  Do the easy part for now, and leave the hard
parts for a follow-up commit.

Change-Id: I1c400a7398b8708e7c9dc6613cd183b9b67e7a7f
Reviewed-on: http://gerrit.openafs.org/8457
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

11 years agoviced: Sanity check file link count during CoW
Andrew Deason [Wed, 19 Dec 2012 00:49:49 +0000]
viced: Sanity check file link count during CoW

A few ihandle bugs in the past have caused the CopyOnWrite code to
open cached file handles for files which have been deleted. When we
CoW, both of the files we're dealing with had better actually be on
disk, so bail out and flag an error if either of them appear unlinked.

FIXES 131530

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

11 years agoihandle: Add FDH_ISUNLINKED
Andrew Deason [Fri, 21 Dec 2012 18:30:24 +0000]
ihandle: Add FDH_ISUNLINKED

Add the FDH_ISUNLINKED functionality to ihandle. This lets the caller
know if the file for the underlying file descriptor has been deleted
out from under us. This is useful for sanity checks in some callers.

Change-Id: I59d4fffba853cfa1b900a08b7b43134c29bbf844
Reviewed-on: http://gerrit.openafs.org/8838
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoihandle: Indent ifdef maze
Andrew Deason [Fri, 21 Dec 2012 11:11:00 +0000]
ihandle: Indent ifdef maze

According to the mesoamerican long count calendar, ifdef ladders will
destroy the world in 2012.

Change-Id: Ie9b16d600e4743eba3d934f8c3cf4d299abbf7e3
Reviewed-on: http://gerrit.openafs.org/8837
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agovolser: Check vnode length on dump
Andrew Deason [Fri, 14 Dec 2012 21:05:53 +0000]
volser: Check vnode length on dump

Commit aadf69eabb1962496fa93745ab560a5b48cacd61 adds length checks on
vnodes during fileserver read/write operations. Do the same thing when
we dump volume data from the volserver, to ensure that we don't
transmit incorrect data e.g. to other RO sites when releasing.

FIXES 131530

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

11 years agoWindows: GetResourceParent processing for \\afs
Jeffrey Altman [Mon, 24 Dec 2012 07:40:08 +0000]
Windows: GetResourceParent processing for \\afs

When the input name is \\afs the parent must be an empty
NETRESOURCE structure.  The null lpRemoteName field represents
no parent.

Change-Id: I779f1c3357ac74aa76e6d1ed0b755841513ac260
Reviewed-on: http://gerrit.openafs.org/8831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Add SERVERHASINLINEBULK macros
Jeffrey Altman [Wed, 19 Dec 2012 21:59:57 +0000]
Windows: Add SERVERHASINLINEBULK macros

Implement SERVERHASINLINEBULK and SET_SERVERHASINLINEBULK macros.
Apply them to cm_vnodeops.c.

Change-Id: Ib9e3ed7f745a7ad3acf03ae918d8d1ca406f19c0
Reviewed-on: http://gerrit.openafs.org/8830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: move SERVERHAS64BIT macros to cm_conn.h
Jeffrey Altman [Wed, 19 Dec 2012 21:58:25 +0000]
Windows: move SERVERHAS64BIT macros to cm_conn.h

Move the SERVERHAS64BIT and SETSERVERHASNO64BIT macros to
cm_conn.h from cm_dcache.c.

Change-Id: I1e1a332a3bd968645912b4e0caa0d793ef96358c
Reviewed-on: http://gerrit.openafs.org/8829
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Fix smb_GetCallerAccess prototype
Jeffrey Altman [Wed, 19 Dec 2012 21:47:36 +0000]
Windows: Fix smb_GetCallerAccess prototype

to supress warnings.

Change-Id: I7d6597457dfe3c99fe7b62621dbad5ffd2f4f0bd
Reviewed-on: http://gerrit.openafs.org/8827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: SetRenameInfo do not reference deleted name
Jeffrey Altman [Mon, 24 Dec 2012 04:15:59 +0000]
Windows: SetRenameInfo do not reference deleted name

After the Target Dirctory CB has been deleted, it is not
safe to reference the FileName component.  Use the uniTargetName
in the error log message.

Change-Id: I83e6db62ffa0cf59d666066cae8f32e93d63d815
Reviewed-on: http://gerrit.openafs.org/8825
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoRemove AFSLore from wiki URLs
Michael Laß [Sat, 22 Dec 2012 21:54:20 +0000]
Remove AFSLore from wiki URLs

The URL of the openafs wiki doesn't contain "AFSLore" anymore. Although
these old URLs still work, replace them to point users to the correct
address in the first place. Also be consistent and always use a
trailing /.

Change-Id: I9d22694249c47331b4a5cd4f02f8815742c4b86f
Reviewed-on: http://gerrit.openafs.org/8819
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: more warnings on kernel builds
Rod Widdowson [Sun, 23 Dec 2012 14:48:14 +0000]
Windows: more warnings on kernel builds

This is the same sort of changes a per git commit 8a4094e9ffa5d0f96501817c8ffd3cc8dc7ec62b
but this time for the fs tree.  Again most of the work is UNREFERENCED_PARAMETER, initialize
variables where the compiler lacks the smarts and remove unused locals.

Change-Id: Id67246e8aaee292cb6f02833e9960f9545c55101
Reviewed-on: http://gerrit.openafs.org/8823
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Remove unused AFSVolumeWorkerThread
Jeffrey Altman [Wed, 19 Dec 2012 16:45:56 +0000]
Windows: Remove unused AFSVolumeWorkerThread

The currently implmentation does all maintenance work in the
AFSPrimaryVolumeWorkerThread which is associated with the
AFSGlobalRoot volume object.   Remove AFSVolumeWorkerThread as
it is unused.

Change-Id: I2174833093b436430fc46f056e23bb272df6388f
Reviewed-on: http://gerrit.openafs.org/8793
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: Wait for all worker threads to exit
Jeffrey Altman [Wed, 19 Dec 2012 14:31:06 +0000]
Windows: Wait for all worker threads to exit

The signalling mechanism for waking and shutting down worker threads
relies upon a per-queue event.  Therefore it is not guaranteed that
the worker thread that AFSShutdown*Thread() is attempting to wait
for is in fact the thread that will be woken and exit.  Modify the
code to loop waking threads until the one that is being waited for
does in fact exit.

Subsequent calls to AFSShutdown*Thread() will bypass the wait if
the thread has already exited.

Change-Id: I4555df062ac5a6161b5c55f4598d1bd34e144a2b
Reviewed-on: http://gerrit.openafs.org/8783
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agoWindows: warnings on kernel builds
Rod Widdowson [Fri, 21 Dec 2012 16:17:34 +0000]
Windows: warnings on kernel builds

I turned some new warning (by virtue of a more modern compiler) and
threw up a few hundred.  This checked supresses them:

- Mostly remove variables which are never used
- Make unused parameters UNREFERENCED_PARAMETER
- Initialize a couple of variables which were either forgotton or
  the compiler wasn't smart enough to notice were initialized.

Also strip out some extraneous tabs which had crept in.

Change-Id: Iee261ad8a7338bb5d8fde2d7229bbbbbd5af39ae
Reviewed-on: http://gerrit.openafs.org/8812
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>

11 years agomacos: avoid leaking iocount on synthetic fsevents
Derrick Brashear [Tue, 18 Dec 2012 14:04:15 +0000]
macos: avoid leaking iocount on synthetic fsevents

in certain cases we could leak an iocount. clean up even if
our event couldn't be run

Change-Id: I3a69f637c38478ac5f20a42af7db7f8a0ba7539a
Reviewed-on: http://gerrit.openafs.org/8777
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

11 years agoUpdate configure help msg to match actual defaults
Michael Laß [Fri, 14 Dec 2012 16:06:30 +0000]
Update configure help msg to match actual defaults

The defaults for LINUX_KERNEL_PATH and LINUX_KERNEL_BUILD in
acinclude.m4 were changed in 2cfd611, 94ff565 and 3f9d982 without updating
the output of ./configure --help. Change the description of
linux-kernel-headers and linux-kernel-build to show the correct defaults.

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

11 years agoLinux: Restructure kernel header detection
Stephan Wiesand [Sat, 15 Dec 2012 14:36:24 +0000]
Linux: Restructure kernel header detection

As of kernel 3.7, version.h has moved, and hence utsrelease.h was
no longer found. Loop over candidate directories and locations
within, and look for the files we're actually after.

FIXES 131525

Change-Id: I686212a283b9e0ce769b1351e3cb75e08f4b110c
Reviewed-on: http://gerrit.openafs.org/8761
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>