]> git.michaelhowe.org Git - packages/o/openafs.git/log
packages/o/openafs.git
14 years agoMacOS: panic decoder should check for unloaded kexts
Derrick Brashear [Wed, 19 Jan 2011 19:58:59 +0000 (14:58 -0500)]
MacOS: panic decoder should check for unloaded kexts

if the openafs kext was unloaded from under us, try to handle that.

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

Change-Id: Iaa0ac75de42424411ea66f04afdf0e8303aa4adc
Reviewed-on: http://gerrit.openafs.org/3839
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovolser: select() cannot be used to sleep on windows
Jeffrey Altman [Sun, 16 Jan 2011 21:42:15 +0000 (16:42 -0500)]
volser: select() cannot be used to sleep on windows

On Windows must use Sleep() instead of select() with no
fd_set parameters.

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

Change-Id: I14ee3664bc247a432e8b350f78c7b7e56b8232b2
Reviewed-on: http://gerrit.openafs.org/3838
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: refactor cm_CheckCBExpiration multihomed
Jeffrey Altman [Sun, 16 Jan 2011 20:49:02 +0000 (15:49 -0500)]
Windows: refactor cm_CheckCBExpiration multihomed

cm_CheckCBExpiration() is refactored to make it easier
to read the decision process.  cm_CheckCBExpiration()
determines when a callback is no longer usable and as a
result the object status info should be discarded.

The windows cache manager preserves status info past
callback expiration if all of the sources of a volume
became inaccessible prior to the callback expiration
time.  The cache manager was improperly preserving the
status info for objects when the callback was issued by
a multi-homed file server when only the interface that
issued the callback is down.

A separate cm_server_t object is used to represent
each file server interface.  When one interface goes
down and others are left up, the cache manager will
now replace the down cm_server_t reference for one that
is up.  This substitution is performed as a side effect
of computing the effective downTime in cm_CBServersDownTime().

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

Change-Id: I43e05dde3d2f12d2130b34125a6103b22f0259e9
Reviewed-on: http://gerrit.openafs.org/3837
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: use cm_ServerEqual() in cm_Analyze()
Jeffrey Altman [Fri, 14 Jan 2011 05:22:39 +0000 (00:22 -0500)]
Windows: use cm_ServerEqual() in cm_Analyze()

In cm_Analyze() when processing VNOVOL, VMOVED or VOFFLINE errors
do not use pointer equivalence as the test to determine if a
server is affected by the error.  Use cm_ServerEqual() instead.

Fix cm_ServerEqual() to work even when both cm_server_t objects
are not UUID aware.

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

Change-Id: Iabebbb0e620c42898b428352ea2ec3cb64de8d74
Reviewed-on: http://gerrit.openafs.org/3836
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: Windows requires binary fmode for salvaged
Andrew Deason [Mon, 17 Jan 2011 18:35:46 +0000 (12:35 -0600)]
vol: Windows requires binary fmode for salvaged

Same as 98f633c60d20834cee0bbc0770a3146b06642a59, but for the
salvageserver.

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

Change-Id: I953a780f61ce377179829d4e42e9aab76b3a8f4d
Reviewed-on: http://gerrit.openafs.org/3835
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: use OS_UNLINK() instead of unlink()
Jeffrey Altman [Sat, 15 Jan 2011 16:49:54 +0000 (11:49 -0500)]
vol: use OS_UNLINK() instead of unlink()

OS_UNLINK provides the platform specific mechanism
for unlinking objects.

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

Change-Id: I58a6acbe7328faa1d0118073f24321ead378efe4
Reviewed-on: http://gerrit.openafs.org/3834
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: construct proper VolDir path on Windows
Jeffrey Altman [Sat, 15 Jan 2011 16:54:40 +0000 (11:54 -0500)]
vol: construct proper VolDir path on Windows

namei_HandleToInodeDir initializes the path name with
the nt_drive value.  Therefore calling addtoname(name, name->n_drive)
produces the invalid path "D:\D:\\Vol_.....".  Remove the unnecessary
addtoname() call.

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

Change-Id: Icd7c6225b80d77184e6a15df0dbb4fd0dfcd0506
Reviewed-on: http://gerrit.openafs.org/3833
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: fdHandleAllocateChunk should init all fields
Jeffrey Altman [Sat, 15 Jan 2011 16:52:45 +0000 (11:52 -0500)]
vol: fdHandleAllocateChunk should init all fields

fdHandleAllocateChunk() failed to initialize the fd_ihnext
and fd_ihprev fields.

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

Change-Id: I9fa401cb4ddec886a3f39ddfb926ce0be8cfa96e
Reviewed-on: http://gerrit.openafs.org/3832
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: use OS_DIRSEP when constructing paths
Jeffrey Altman [Sat, 15 Jan 2011 16:47:47 +0000 (11:47 -0500)]
vol: use OS_DIRSEP when constructing paths

Do not assume that / is the directory separator when constructing
paths for internal consumption or log messages.  Use OS_DIRSEP
or OS_DIRSEPC as appropriate.

(cherry picked from commit 47e2149335066883450cb2a751bd057dcd1af79d)
Reviewed-on: http://gerrit.openafs.org/3669
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Change-Id: Ic6fbe73ec112994079816942b3456fe95c193200
Reviewed-on: http://gerrit.openafs.org/3831
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: make namei_ListAFSSubDirs deal with multiple/bad linktables
Tom Keiser [Thu, 14 Oct 2010 05:24:03 +0000 (01:24 -0400)]
vol: make namei_ListAFSSubDirs deal with multiple/bad linktables

The salvager ends up deadlocking when multiple linktables exist
in the same volume group special directory.  The issue is that we
open and flock all discovered linktables, but only close out the
last one found.  Consequently, when our child scans the linktables
again, we deadlock against the locked and leaked descriptor(s) our
parent left around before forking.

While we have so far been unable to root-cause the actual creation
of spurious linktables, this patch will at least stop the salvager
from deadlocking against itself when this occurs.

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

Change-Id: Ifd81e41258b1974b4b6e0df893fa37387bc48757
Reviewed-on: http://gerrit.openafs.org/3889
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovolser: use OS_CLOSE() instead of close()
Jeffrey Altman [Sat, 15 Jan 2011 16:44:08 +0000 (11:44 -0500)]
volser: use OS_CLOSE() instead of close()

Use OS_CLOSE() instead of close() when closing vol package
allocated file descriptors.  On Windows, close() != nt_close().

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

Change-Id: I40114c0cf071a18612bb1ed29d18ab145f466dec
Reviewed-on: http://gerrit.openafs.org/3830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: initialize FdHandle_t stack objects
Jeffrey Altman [Sat, 15 Jan 2011 16:39:39 +0000 (11:39 -0500)]
vol: initialize FdHandle_t stack objects

In namei_create() a temporary FdHandle_t is allocated on
the stack but was never initialized.  Depending on what
prior data was on the stack the FdHandle_t could result
in subsequent operations failing in unpredictable ways.

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

Change-Id: I44913419e09b36a3581320cd169bbc4774cd0208
Reviewed-on: http://gerrit.openafs.org/3829
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: Fix ntops to provide expected semantics
Jeffrey Altman [Sat, 15 Jan 2011 16:07:19 +0000 (11:07 -0500)]
vol: Fix ntops to provide expected semantics

nt_open() can be asked to open a file with a path containing
directory components that do not yet exist.  Modify nt_open()
to automatically create directories if necessary.

nt_read() and nt_pread() should not treat partial reads due
to reaching EOF as an error.  Instead, return the bytes read.

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

Change-Id: I4a4c8a4894aa25bec883154cb73d1ee24986ba15
Reviewed-on: http://gerrit.openafs.org/3828
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomerge ntops and namei
Derrick Brashear [Thu, 28 Oct 2010 05:03:49 +0000 (01:03 -0400)]
merge ntops and namei

instead of having 2 implementations of nearly the same thing,
merge what we can. this can get closer, probably, but this is
a start.

(cherry picked from commit a8d1fe61f4a0d906d4086b71c88b0a3ab278b12c)
Reviewed-on: http://gerrit.openafs.org/3180
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Change-Id: Ieaf8b87862a692559971b2a54882a485590a715d
Reviewed-on: http://gerrit.openafs.org/3827
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoParallel I/O extensions to namei backend
Andrew Deason [Thu, 11 Mar 2010 18:19:47 +0000 (12:19 -0600)]
Parallel I/O extensions to namei backend

This adds the ability for certain namei operations (currently only
ListViceInodes) to occur across multiple different threads in
parallel. Currently this is only enabled when built with the
not-yet-existant AFS_SALSRV_ENV.

Originally written by Tom Keiser.

(cherry picked from commit 0a4a03ae68bea51a74a4ef496d50a800bd3e0cbd)
Reviewed-on: http://gerrit.openafs.org/1864
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I2fa3aa60a13c81e0a0bc7ffb5b323ec7580f560f
Reviewed-on: http://gerrit.openafs.org/3826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoihandle positional read and write
Michael Meffie [Mon, 15 Mar 2010 17:42:23 +0000 (12:42 -0500)]
ihandle positional read and write

When available, use POSIX positional read and write
calls in the ihandle package. Originally written
by Derrick Brashear and Andrew Deason.

(cherry picked from commit 335ccb4082657b7d0e4e9af1076356cf115642d2)
Reviewed-on: http://gerrit.openafs.org/1562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I6616a8f7ba04410c57097fb6fa687258b847ac4e
Reviewed-on: http://gerrit.openafs.org/3884
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agowindows: native versions of ih_pread and ih_pwrite
Rod Widdowson [Wed, 27 Oct 2010 22:20:30 +0000 (00:20 +0200)]
windows: native versions of ih_pread and ih_pwrite

Separate the windows code out in ihandle.c to reduce dependency on ntops.

As an aid to future threading issues, pass the offset in an OVERLAP
rather than doing a separate SetFilePointerEx.

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

Change-Id: Iaa340515bf36d249d4f2160b55c3fbb267bb90ee
Reviewed-on: http://gerrit.openafs.org/3825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: Windows requires binary fmode for salvager
Jeffrey Altman [Sat, 15 Jan 2011 16:04:48 +0000 (11:04 -0500)]
vol: Windows requires binary fmode for salvager

In order for salvager to work properly it must read and
write data in binary mode.  On Windows, this is accomplished
by calling _set_fmode(_O_BINARY) to set the default mode for
fopen(), etc.

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

Change-Id: Ibfdbcb9e2da6216f31f7a73d42acafa59b651350
Reviewed-on: http://gerrit.openafs.org/3824
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol: fix OS_LOCKFILE/OS_UNLOCKFILE for Windows
Jeffrey Altman [Sat, 15 Jan 2011 16:01:55 +0000 (11:01 -0500)]
vol: fix OS_LOCKFILE/OS_UNLOCKFILE for Windows

On UNIX the OS_LOCKFILE and OS_UNLOCKFILE macros return zero
on success.  Since Windows LockFile() and UnlockFile() return
non-zero (TRUE) on success, negate the return value as part
of the macro definition.

(cherry picked from commit e8e69d5b2c611df249fd613ed068fc030a0e30d1)
Reviewed-on: http://gerrit.openafs.org/3664
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Change-Id: Ifc9f7efcafee5a17fcf112556184be0072deb108
Reviewed-on: http://gerrit.openafs.org/3823
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: fixup gettmpdir()
Jeffrey Altman [Fri, 14 Jan 2011 05:15:10 +0000 (00:15 -0500)]
Windows: fixup gettmpdir()

Use InterlockedCompareExchangePointer for hostparse()
instead of fudging it and leaking memory.

If the max path length is MAX_PATH must allocate MAX_PATH+1.

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

Change-Id: I2183cd52298ea1d1204102fee66dea4755de3b41
Reviewed-on: http://gerrit.openafs.org/3820
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: osilog param size is size_t
Jeffrey Altman [Fri, 14 Jan 2011 05:13:49 +0000 (00:13 -0500)]
Windows: osilog param size is size_t

The parameter size is size_t which permits pointers to be stored
on 32-bit and 64-bit systems.  Make sure we store it as size_t
instead of truncating to long.

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

Change-Id: Ifff3cc8d9424c74d39a792f83b838965af95faea
Reviewed-on: http://gerrit.openafs.org/3819
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agorpm: don't package files twice
Stephan Wiesand [Sat, 8 Jan 2011 16:13:27 +0000 (17:13 +0100)]
rpm: don't package files twice

The LICENSE and two manpages were included in the main
package as well as one of the others. Remove duplicate entries.

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

Change-Id: I4120181c4384aa0f3f6f4c016c594d45cf037921
Reviewed-on: http://gerrit.openafs.org/3818
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agogit-version: Do not specify --ignore-submodules
Andrew Deason [Sat, 8 Jan 2011 01:48:18 +0000 (20:48 -0500)]
git-version: Do not specify --ignore-submodules

Only new git versions reognize the --ignore-submodules option to
diff-index and diff-files. Do not pass this, to make git-version more
likely to work across different versions, as we don't have any
submodules in the tree anyway.

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

Change-Id: Iae527081b431863fa1eae418b8468741f75f3f2e
Reviewed-on: http://gerrit.openafs.org/3817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: refactor buf_Get() to improve readability
Jeffrey Altman [Sat, 8 Jan 2011 17:21:23 +0000 (12:21 -0500)]
Windows: refactor buf_Get() to improve readability

Refactor buf_Get() by using a switch() instead of a jumble
of if() conditionals.

Improve comments to make it clear that given the current
use and implementation of cm_BufRead() from cm_dcache.c
that created buffer pages will never be populated with
actual data.

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

Change-Id: I32ff33df359fb7794e9cf47c2027eb48363c80eb
Reviewed-on: http://gerrit.openafs.org/3816
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: remove all refs to unused buf_GetNew()
Jeffrey Altman [Sat, 8 Jan 2011 17:19:07 +0000 (12:19 -0500)]
Windows: remove all refs to unused buf_GetNew()

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

Change-Id: Ideb8532a8de53152aa902834d7dd012a464ad000
Reviewed-on: http://gerrit.openafs.org/3815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: remove unused vars from cm_server.c
Jeffrey Altman [Tue, 4 Jan 2011 16:18:25 +0000 (11:18 -0500)]
Windows: remove unused vars from cm_server.c

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

Change-Id: Ie0afcd7a98520b06830ef919377630a7e9526036
Reviewed-on: http://gerrit.openafs.org/3814
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: permit clean when switching platforms
Jeffrey Altman [Tue, 4 Jan 2011 02:07:10 +0000 (21:07 -0500)]
Windows: permit clean when switching platforms

When switching between i386 and amd64 in the same build tree
the "clean" make directive would fail due to NTLang.bat not
having been built in the new platform's destination directory.
Force NTLang.bat to be built as a dependency of cleanup and
delete it at the end along with the version files.

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

Change-Id: Ia215c34f06976dee588292fccb7396a49ab98035
Reviewed-on: http://gerrit.openafs.org/3813
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoAdd "brief" option to rxgen
Simon Wilkinson [Sun, 14 Feb 2010 10:01:14 +0000 (10:01 +0000)]
Add "brief" option to rxgen

Add a new -b option to rxgen that turns on "brief" output. This makes a
number of changes to the data definitions produced by rxgen so they can
be more easily used by the calling code.

The changes are:
   *) Use the new struct rx_opaque structure for all opaque data
      definitions, rather than defining each as a unique structure.
      This permits moving opaque data between rxgen structures to be
      performed by simple assignment.
   *) Use anonymous structures for internal definitions. Currently
      rxgen also uses the field name as the structure name, which
      prevents the use of a field name more than once within a
      source file.
   *) Don't embed the structure name within the names of the elements
      within the structure. This significantly reduces the length of
      assignment code, and makes for more readable callers.

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

Change-Id: I03adce371f17c8865b469b9b5cb94209395261c2
Reviewed-on: http://gerrit.openafs.org/3812
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: MIT license applies to parsemode()
Vincent Archer [Thu, 30 Dec 2010 16:34:28 +0000 (11:34 -0500)]
Windows: MIT license applies to parsemode()

Vincent Archer grants permission to OpenAFS to re-license
his MINIX contributions under the MIT license.  A copy of the
e-mail granting permission is located in OpenAFS RT issue 128805.

FIXES 128805

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

Change-Id: I4ccd8e976185b98536e061a20be43805db619a4a
Reviewed-on: http://gerrit.openafs.org/3811
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: buf_CleanAsync scp->fid == bp->fid
Jeffrey Altman [Wed, 29 Dec 2010 16:35:17 +0000 (11:35 -0500)]
Windows: buf_CleanAsync scp->fid == bp->fid

If buf_CleanAsync or buf_CleanAsyncLocked are called
with a non-NULL cm_scache_t parameter, that status object's
fid must be the same as the associated cm_buf_t object.
If not, the wrong locks will be held.

If the cm_scache_t parameter is NULL and cm_FindSCache()
returns NULL, it means that the cm_scache_t object associated
with the bp->fid has been flushed from the cache.  cm_GetSCache()
must therefore be called to allocate a new status object for the
FID.  If the status object cannot be allocated, then any dirty
data stored in the buffer will be discarded.

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

Change-Id: I41b190d15bff93be656c6f844a740cce9812ae04
Reviewed-on: http://gerrit.openafs.org/3810
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: fs checkserver skip multi-homed up server
Jeffrey Altman [Tue, 28 Dec 2010 19:39:47 +0000 (14:39 -0500)]
Windows: fs checkserver skip multi-homed up server

Multi-homed file servers can be detected by comparing the
uuid for the cm_server_t entries.  If a server has at least
one up interface, do not list it as being down in the "fs checkserver"
response list.

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

Change-Id: Idc6ae445bc9fad467dede51d5885646bb610c0ef
Reviewed-on: http://gerrit.openafs.org/3809
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: fs checkservers should list vldb as well
Jeffrey Altman [Thu, 23 Dec 2010 04:23:48 +0000 (23:23 -0500)]
Windows: fs checkservers should list vldb as well

The Windows fs checkservers has only listed offline
file servers.  Include vldb as well to match the Unix
cache manager.

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

Change-Id: Ic8053f7307ee937add5e0d5b9e35c03cf8ccb302
Reviewed-on: http://gerrit.openafs.org/3808
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovos: do not mix memory allocation methods
Jeffrey Altman [Tue, 28 Dec 2010 00:34:14 +0000 (19:34 -0500)]
vos: do not mix memory allocation methods

ListVLDB mixed memory allocated with xdr_alloc() and memory
allocated with malloc().  This is not safe to do since it is
possible on some platforms for xdr_alloc() to allocated memory
using a method other than the malloc() linked to the vos
executable.

Instead of stealing the xdr_alloc()'d buffer, allocate a new
buffer and copy the contents.

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

Change-Id: I64f43459a212ceb1b4f89e45a9827fc7b981ff6e
Reviewed-on: http://gerrit.openafs.org/3807
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: separate parsemode from fs into own file
Jeffrey Altman [Fri, 24 Dec 2010 18:36:51 +0000 (13:36 -0500)]
Windows: separate parsemode from fs into own file

Separate parsemode() from fs.c into parsemode.c.

Restructure the function prototypes and the fs.h header
to permit building fs.exe from multiple source files.

Reviewed-on: http://gerrit.openafs.org/3591
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 683747b9c4b3d9d77fb8c68df09a59807d027a42)

Change-Id: I3ed5f647631bdd6983a53f4e6a2193aaddf37e0f
Reviewed-on: http://gerrit.openafs.org/3805
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: fs chmod and display mode in fs examine
Jeffrey Altman [Sat, 18 Dec 2010 23:39:07 +0000 (18:39 -0500)]
Windows: fs chmod and display mode in fs examine

Make use of the new pioctl VIOC_GETUNIXMODE and VIOC_SETUNIXMODE
operations to display the current mode in fs examine and permit
setting the mode with "fs chmod".   The mode string parsing makes
use of Vincent Archer's code from Minix.  The required copyright
statement and license is attached to parsemode().

afsconfig-windows.h gains definitions for various mode symbols
that are not defined by Visual Studio runtime headers.

(cherry picked from commit afef1712f28a1c83cfb732d1c4fde7faec4811fc)
Reviewed-on: http://gerrit.openafs.org/3546
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Change-Id: Iaaa70fbef86524df82bc04754276836fff643357
Reviewed-on: http://gerrit.openafs.org/3804
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoafsd: Do not check for /afs if -nomount
Andrew Deason [Mon, 31 Jan 2011 17:18:39 +0000 (11:18 -0600)]
afsd: Do not check for /afs if -nomount

If -nomount was passed, we don't try to mount /afs. So, there is no
reason to require its existence.

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

Change-Id: I58f4a600fe976703412b76d7aeba1e316e08d05b
Reviewed-on: http://gerrit.openafs.org/3877
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: clear mountPointStringp on status change
Jeffrey Altman [Mon, 20 Dec 2010 14:59:43 +0000 (09:59 -0500)]
Windows: clear mountPointStringp on status change

If the data version of the cm_scache_t changes, we must clear
the mountPointString.  Otherwise, if the object is a mountpoint
or symlink, cm_HandleLink() will not attempt to build the new
target string.   The Windows CM never updates the contents of
a mountpoint or symlink.  It always destroys the old and creates
a new one.  However, the Unix CM simply updates the link data.
Apparently, the Windows clients have never noticed.

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

Change-Id: Icabba0b9bb6a1484d3ee3bc21dc6a39343e5491c
Reviewed-on: http://gerrit.openafs.org/3803
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agoWindows: Add VIOC_GETUNIXMODE and VIOC_SETUNIXMODE
Jeffrey Altman [Sat, 18 Dec 2010 23:36:18 +0000 (18:36 -0500)]
Windows: Add VIOC_GETUNIXMODE and VIOC_SETUNIXMODE

Add pioctls to get and set the UNIX mode bits for an
object in AFS.

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

Change-Id: Id80cb41732a6daffa2f03a4313ef3cb9f94b87ea
Reviewed-on: http://gerrit.openafs.org/3802
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: log error code for smb lan thread fail
Jeffrey Altman [Sun, 12 Dec 2010 04:28:02 +0000 (23:28 -0500)]
Windows: log error code for smb lan thread fail

When creation of the smb_LanAdapterChangeThread fails
log the error code as part of the panic message.

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

Change-Id: Ibeb735922101dd89c998746f06f9c56354533506
Reviewed-on: http://gerrit.openafs.org/3801
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: PerformanceTuningInterval Merge error
Jeffrey Altman [Sat, 11 Dec 2010 12:19:54 +0000 (06:19 -0600)]
Windows: PerformanceTuningInterval Merge error

Due to a merge error, if RankServerInterval was set via the
registry, its value would also be used for the
PerformanceTuningInterval.  Fix it.

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

Change-Id: I7ed0ffbffc88c25e6b586d927c8422711d2bd7b8
Reviewed-on: http://gerrit.openafs.org/3800
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: Avoid logging harmless LEAVE_OFF failures
Andrew Deason [Wed, 8 Dec 2010 20:57:13 +0000 (14:57 -0600)]
DAFS: Avoid logging harmless LEAVE_OFF failures

The DAFS volserver can create temporary destroyMe volumes, which it
then tells the fileserver to keep offline with an FSYNC_VOL_LEAVE_OFF
message. When the fileserver doesn't know that the volume exists,
currently it responds with SYNC_DENIED, which causes the volserver to
log the error with a "negative response on circuit FSSYNC" message.

These are harmless, though, since leaving a volume offline that the
fileserver does not know about is a no-op. So return the SYNC_FAILED
code instead, which does not get logged, and is more consistent with
some other FSYNC handlers like FSYNC_VOL_DONE.

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

Change-Id: Ib3956cf1035b8d9dbcc985877304837a52f9d760
Reviewed-on: http://gerrit.openafs.org/3799
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: Fix VOL_QUERY_VOP error codes
Andrew Deason [Wed, 8 Dec 2010 18:41:44 +0000 (12:41 -0600)]
DAFS: Fix VOL_QUERY_VOP error codes

Volumes in the VOL_STATE_DELETED state effectively do not exist. So,
when receiving an FSYNC_VOL_QUERY_VOP request for a volume, report
FSYNC_UNKNOWN_VOLID for a volume in the VOL_STATE_DELETED state.
Similarly, if the volume exists but on a different partition, we
should return the FSYNC_WRONG_PART reason code.

This allows volumes to be usable by the volume server in some corner
cases. For example, when a volume X exists on partitions A and B, and
the volserver deletes X on B. The fileserver then puts volume X in the
DELETED state, allowing checkouts over fsync, but FSYNC_VOL_QUERY_VOP
reports that no vop exists.

With this change, FSYNC_VOL_QUERY_VOP will instead report that the
volume does not exist, and so FSYNC_VerifyCheckout can succeed for
such volumes.

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

Change-Id: I37e2740af4ad257398325007a1d1e1e4ba3bae45
Reviewed-on: http://gerrit.openafs.org/3798
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFix AUD_HOST callers
Andrew Deason [Wed, 8 Dec 2010 17:40:24 +0000 (11:40 -0600)]
Fix AUD_HOST callers

Servers using the AUD_HOST audit message should give the host IP in
network-byte order, as that is how the auditing code interprets it.
Fix the users of AUD_HOST that do not do so.

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

Change-Id: I5d8b8059101b147583f006bcdd4abd301721be62
Reviewed-on: http://gerrit.openafs.org/3797
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agotvolser: Link libafsrpc after libusd
Andrew Deason [Tue, 7 Dec 2010 19:49:47 +0000 (13:49 -0600)]
tvolser: Link libafsrpc after libusd

libusd can contain a reference to AssertionFailed, which is in
libafsrpc. So link libafsrpc after libusd, so it gets resolved when
building e.g. vos.

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

Change-Id: I1a4325364e650fb82600e0c2c6ec64fd42912b23
Reviewed-on: http://gerrit.openafs.org/3796
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: make FSYNC_VOL_QUERY_VOP DAFS-only
Derrick Brashear [Wed, 8 Dec 2010 02:08:51 +0000 (21:08 -0500)]
DAFS: make FSYNC_VOL_QUERY_VOP DAFS-only

all the support code handles this only for DAFS. the
case statement should treat as unknown if it is.

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

Change-Id: I74bf87d251663404e830f30fcbf47275b1aa468a
Reviewed-on: http://gerrit.openafs.org/3795
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoDAFS: fix ifdef
Derrick Brashear [Wed, 8 Dec 2010 01:43:55 +0000 (20:43 -0500)]
DAFS: fix ifdef

there's no DEMAND_ATTACH_ENV ifdef. don't use it.

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

Change-Id: Ib032930c53b8025e82819e0f82e994b5bdf6c5ba
Reviewed-on: http://gerrit.openafs.org/3794
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: test for path in afs before symlink test
Jeffrey Altman [Tue, 7 Dec 2010 05:02:33 +0000 (00:02 -0500)]
Windows: test for path in afs before symlink test

Check that the path is in afs before testing to see
if it is a symlink

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

Change-Id: I34191b8b67277f5cc8421323a1293c8ebd60c213
Reviewed-on: http://gerrit.openafs.org/3793
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovol_split: Recover from stream open failure
Andrew Deason [Mon, 6 Dec 2010 22:11:24 +0000 (16:11 -0600)]
vol_split: Recover from stream open failure

Make sure we go through the error recovery code when we can't create a
stream, instead of just returning without cleaning up.

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

Change-Id: Iff1053a2ed1789f2a5047a59b8df4fad94e9062c
Reviewed-on: http://gerrit.openafs.org/3792
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: fix checked UNICODE build of talocale
Stefan Kueng [Sun, 5 Dec 2010 17:48:56 +0000 (18:48 +0100)]
Windows: fix checked UNICODE build of talocale

src/WINNT/talocale failed to build/link for checked builds. Fix it.

Reviewed-on: http://gerrit.openafs.org/3446
Tested-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit a433f750ad7f0a3c0adbf4c5d6221b7517c0eedb)

Change-Id: Ie7e2e7778efd0c6d9724f1eb65adf8942141a47e
Reviewed-on: http://gerrit.openafs.org/3791
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: Build afs_shl_ext.dll with talocaleU.lib
Jeffrey Altman [Sat, 4 Dec 2010 23:03:21 +0000 (18:03 -0500)]
Windows: Build afs_shl_ext.dll with talocaleU.lib

Use the Unicode version of talocale to properly read
resource strings.

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

Change-Id: I38b4b45e6868283a7f59071f6326389dd569ea2d
Reviewed-on: http://gerrit.openafs.org/3790
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: install afs_shl_ext icon files
Jeffrey Altman [Sat, 4 Dec 2010 23:02:38 +0000 (18:02 -0500)]
Windows: install afs_shl_ext icon files

mount.ico and link.ico to dest\root.client\usr\vice\etc

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

Change-Id: I3ab7f121a937769e899dc8d7c604fc23f07ada1e
Reviewed-on: http://gerrit.openafs.org/3789
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: build a UNICODE version of talocale.lib
Jeffrey Altman [Sat, 4 Dec 2010 22:59:36 +0000 (17:59 -0500)]
Windows: build a UNICODE version of talocale.lib

Add src/WINNT/talocale_unicode that builds a UNICODE version
of talocale, talocaleU.lib

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

Change-Id: Ie298784afdbc4329b97fecea73135b4fd173a866
Reviewed-on: http://gerrit.openafs.org/3788
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: fix UNICODE build for talocale
Jeffrey Altman [Sat, 4 Dec 2010 22:56:44 +0000 (17:56 -0500)]
Windows: fix UNICODE build for talocale

src/WINNT/talocale has not been built for UNICODE in a long time.
Fix it.

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

Change-Id: I2f77de3255b229bfa00437af59d11c0da5646458
Reviewed-on: http://gerrit.openafs.org/3787
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: afs_shl_ext improve overlay handlers
Stefan Kueng [Sat, 4 Dec 2010 09:56:01 +0000 (10:56 +0100)]
Windows: afs_shl_ext improve overlay handlers

Add link.ico and mount.ico Windows icon files.
Use these images as overlays instead of extracting an image
from shell32.dll which is a bad idea.  See

http://blogs.msdn.com/b/oldnewthing/archive/2005/10/26/485133.aspx
Reviewed-on: http://gerrit.openafs.org/3445
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 3ff9c24c0e2d72dcce65fc7706dcdb1cd3090965)

Change-Id: Ifa20508a1b30ebd88e4968d76d325c2e2be51039
Reviewed-on: http://gerrit.openafs.org/3786
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: afs_shl_ext Show icon mount point overlay
Stefan Kueng [Fri, 3 Dec 2010 21:58:54 +0000 (22:58 +0100)]
Windows: afs_shl_ext Show icon mount point overlay

Reviewed-on: http://gerrit.openafs.org/3444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit 92183f4ac31f20862a992b8b3d52dcbe0ebb7eb9)

Change-Id: I966cc9bbb03a5682f3227238c635fb5634502c8c
Reviewed-on: http://gerrit.openafs.org/3785
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoevalmountdata: put back colon in .:mount syntax only if we removed it
Derrick Brashear [Mon, 31 Jan 2011 20:07:45 +0000 (15:07 -0500)]
evalmountdata: put back colon in .:mount syntax only if we removed it

we looked for a set character (not NULL) at cpos before, instead
of looking for a non-NULL pointer. fix it.

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

Change-Id: I6920aa378361c1c78285b595303f32ed3194462b
Reviewed-on: http://gerrit.openafs.org/3875
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: afs_shl_ext folder bkgrnd context menu
Stefan Kueng [Fri, 3 Dec 2010 20:24:33 +0000 (21:24 +0100)]
Windows: afs_shl_ext folder bkgrnd context menu

Make the context menu handler also work for folder backgrounds
and on Win7 for library folder backgrounds

For folder backgrounds, the shell passes the PIDL of the folder
instead of a data object.  Extract the path from that PIDL. Also
extended the register function of the dll to add the required
registry keys.

Reviewed-on: http://gerrit.openafs.org/3443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Stefan Kueng <tortoisesvn@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit f8f8c0a48fbe086870a0cf35a62278c2b4ab743b)

Change-Id: If19cafed9d19ce5f6a529c64fe48a03c13cb0e03
Reviewed-on: http://gerrit.openafs.org/3784
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: Remove fallback from GetCaps to GetTime
Jeffrey Altman [Wed, 1 Dec 2010 23:47:29 +0000 (18:47 -0500)]
Windows: Remove fallback from GetCaps to GetTime

If the file server responds to RXAFS_GetCapabilities with
RXGEN_OPCODE the server is up and there is no need to fallback to
RXAFS_GetTime.  Remove the code that performs the extra work.

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

Change-Id: I2d7424e891d728b4b0589989c8a58f15594db412
Reviewed-on: http://gerrit.openafs.org/3783
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoUnix afsd: Check for mountpoint /afs first
Christof Hanke [Sun, 28 Nov 2010 12:01:12 +0000 (13:01 +0100)]
Unix afsd: Check for mountpoint /afs first

Check for the existance of the mountpoint before trying to
start.

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

Change-Id: Ic94f1701f5d1d0d080e5751093a685e89d892b1a
Reviewed-on: http://gerrit.openafs.org/3782
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agovos: Improve release recovery on timed-out trans
Andrew Deason [Thu, 9 Sep 2010 14:41:40 +0000 (09:41 -0500)]
vos: Improve release recovery on timed-out trans

When a portion of 'vos release' takes long enough that a transaction
on one or more RO sites times out, it retries to release to those
sites. However, it does not take into account the situation where the
transaction on the original RO clone has also timed out, which it
usually will have if we took a long time to get to the ForwardMulti
stage for any reason.

Add a check to see if the clone RO transaction has timed out, and if
so, recreate the transaction on it. Check if the volume appears to
have changed at all, and if it has, bail out.

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

Change-Id: I19541800fa7d1ce1c5922b9338b4b8370151fd93
Reviewed-on: http://gerrit.openafs.org/3781
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: NSIS installer requires the architecture for CL=1400
Jeffrey Altman [Fri, 26 Nov 2010 07:55:03 +0000 (02:55 -0500)]
Windows: NSIS installer requires the architecture for CL=1400

The NSIS installer at present is 32-bit only.  Production releases
of OpenAFS have always been performed using the CL=1310 compiler
so it wasn't noticed that src/WINNT/install/NSIS/NTMakefile did
not define the ARCH (architecture) for the purpose of identifying
which redistributable runtime library installer should be
integrated into the build.  For the CL=1310 compiler there are
not prebuilt installers for OpenAFS to integrate.

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

Change-Id: I38a93f34f3cd8b71ad0f33ca700162d133b11b7a
Reviewed-on: http://gerrit.openafs.org/3780
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoWindows: make use of AFSDEV_BIN and set the PATH
Jeffrey Altman [Fri, 26 Nov 2010 07:51:16 +0000 (02:51 -0500)]
Windows: make use of AFSDEV_BIN and set the PATH

ntbuild.bat defines AFSDEV_BIN which is set to the list of
directories from which executables required for the build
process will be executed.  However, this value was never used
to modify the PATH environment variable.  Make it do so.

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

Change-Id: I2a4de2258027b0a943d0f223c7493b8d33393777
Reviewed-on: http://gerrit.openafs.org/3779
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agomerge-pod: Be more compatible with older perl
Andrew Deason [Fri, 14 Jan 2011 20:00:14 +0000 (14:00 -0600)]
merge-pod: Be more compatible with older perl

merge-pod works fine with perl 5.00503, if we eliminate the 3-argument
invocation of open(). So, replace the open() calls with their
2-argument equivalent, and relax the version requirement a bit.

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

Change-Id: Ie3945eb37628ed3bd55f9cb53dd2f4d122f3b087
Reviewed-on: http://gerrit.openafs.org/3778
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoMacOS: fix SetFile call in growlagent makefile
Derrick Brashear [Tue, 25 Jan 2011 18:32:38 +0000 (13:32 -0500)]
MacOS: fix SetFile call in growlagent makefile

somehow this got corrupted earlier. fix it to use the right arg.

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

Change-Id: Iecf2c6a5c9a7df61cd2728eda3ee0a937e2f29f9
Reviewed-on: http://gerrit.openafs.org/3757
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFreeBSD: properly identify the rxk_Listener so that msleep() returns
Toby Burress [Thu, 20 Jan 2011 04:32:01 +0000 (23:32 -0500)]
FreeBSD: properly identify the rxk_Listener so that msleep() returns

afs_osi_Wakeup() was not being called with the proper argument,
causing afs_osi_Sleep() to fail forever while waiting for rxk_Listener
to wake up.

Change-Id: Ia2de70e1c3b9bcc25fbd6cb23c2d05eabb0a53a1
Reviewed-on: http://gerrit.openafs.org/3692
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry-picked from commit bc674908ca5100a0734069a019d9a31788dd52fb)
Reviewed-on: http://gerrit.openafs.org/3754
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoOpenBSD: Change code optimization setting
Antoine Verheijen [Wed, 19 Jan 2011 23:06:03 +0000 (16:06 -0700)]
OpenBSD: Change code optimization setting

Change the optimization level set when optimization is
enabled during build from the sytem default of '-O' to
'-O2' for OpenBSD systems.

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

14 years agoOpenBSD: Install no-NFS version of libafs
Antoine Verheijen [Wed, 19 Jan 2011 20:13:09 +0000 (13:13 -0700)]
OpenBSD: Install no-NFS version of libafs

The build process for OpenBSD builds the no-NFS version of
the kernel module but, at install time, the NFS version is
subseuquently built and installed while the no-NFS version
is ignored. The NFS version does not load and is not needed
in OpenBSD so this patch makes sure that the no-NFS version
is installed and used.

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

Change-Id: I7f37c2da40f2ecada7255c1d60e8b14a1f7e6f81
Reviewed-on: http://gerrit.openafs.org/3723
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoOpenBSD: Remove duplicate assignment of COMMON_INCLUDE in libafs
Antoine Verheijen [Fri, 3 Dec 2010 07:30:20 +0000 (00:30 -0700)]
OpenBSD: Remove duplicate assignment of COMMON_INCLUDE in libafs

When building libafs, the make file variable COMMON_INCLUDE is
assigned a value in two places: Makefile.common.in and
MakefileProto.OBSD.in. The assignment in the latter place is both
wrong and unnecessary. Remove it.

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

Change-Id: I08d46d7e9c288e6b81f8c9cf3a16f6e48ac3462f
Reviewed-on: http://gerrit.openafs.org/3722
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoOpenBSD: Don't call non-existent routines in osi_vfsops.c
Antoine Verheijen [Wed, 19 Jan 2011 20:43:21 +0000 (13:43 -0700)]
OpenBSD: Don't call non-existent routines in osi_vfsops.c

The OpenBSD version of osi_vfsops.c makes calls to routines
that do not exist in the system and aren't needed. In the
past, these calls were wrappered by an #ifdef for
AFS_DISCON_ENV which was never defined. That #ifdef is now
gone so this patch removes the calls to these routines,
which are remnants of the NBSD origins for this particular
code.

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

Change-Id: I8f57b0042e89dd917ee11e86709d9e6ae8ad7287
Reviewed-on: http://gerrit.openafs.org/3721
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoMove include of sys/types.h in kopenafs.c
Antoine Verheijen [Fri, 3 Dec 2010 07:26:24 +0000 (00:26 -0700)]
Move include of sys/types.h in kopenafs.c

The netinet/in.h header file requires the inclusion of sys/types.h
(or some portion thereof). Most systems include it implicitly
within netinet/in.h. Some, such as OpenBSD, do not. In kopenafs.c,
sys/types.h is included after netinet/in.h which is fine in most
cases but means that, as a result, it will not compile on OpenBSD.
Moving sys/types.h before netinet/in.h solves this problem (and
should cause no problems on any other system).

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

Change-Id: I22bad3e58896e25bae49d87dca0452e6595c7a2c
Reviewed-on: http://gerrit.openafs.org/3720
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoOpenBSD: Fix parameters in call to afs_close()
Antoine Verheijen [Wed, 19 Jan 2011 20:30:24 +0000 (13:30 -0700)]
OpenBSD: Fix parameters in call to afs_close()

OpenBSD passes an extra parameter in a call to afs_close()
in its OS-specific code. It went undetected in the past
but now causes compile headaches because of more accurate
prototypes in the header file. This patch removes the
offending extra parameter (which never actually caused any
problems because it was the last one in the parameter list).

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

Change-Id: I7d2df5fe80bd4de8c74200ada879a7bc1358e134
Reviewed-on: http://gerrit.openafs.org/3719
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoOpenBSD: Fix use of macros for AFS_KALLOC/AFS_KFREE
Antoine Verheijen [Wed, 19 Jan 2011 18:52:10 +0000 (11:52 -0700)]
OpenBSD: Fix use of macros for AFS_KALLOC/AFS_KFREE

The macro definitions for AFS_KALLOC and AFS_KFREE used by
afs_osi_alloc.c to perform OS-specific memory allocation
are only defined by the OpenBSD osi_machdep.h header file
if they already exist, which means: never. This patch fixes
this situtation and makes sure that afs_osi_alloc.c
actually uses them, eliminating a direct OS-specific call
in afs_osi_alloc.c.

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

Change-Id: I362f1b6ab808ff171cebc429eb74703c7151d026
Reviewed-on: http://gerrit.openafs.org/3718
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoOpenBSD: Remove macros definitions for afs_osi_Alloc et al.
Antoine Verheijen [Wed, 19 Jan 2011 18:20:21 +0000 (11:20 -0700)]
OpenBSD: Remove macros definitions for afs_osi_Alloc et al.

The afs_osi_Alloc, afs_osi_Free, etc. routines are now
defined in afs_osi_alloc.c so the macro definitions defined
by osi_machdep.h for OpenBSD are no longer needed and, in
fact, interfere with the compile. Remove them.

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

Change-Id: I9c5b77456472e26fc575165617d81ec6796f7c45
Reviewed-on: http://gerrit.openafs.org/3717
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoOpenBSD: No ruid/rgid in cred structure.
Antoine Verheijen [Wed, 19 Jan 2011 21:14:47 +0000 (14:14 -0700)]
OpenBSD: No ruid/rgid in cred structure.

OpenBSD does not retain ruid or rgid values in the
afs_creds_t structure (ucred). This patch, therefore,
removes any references to them in the afs.h file. Since
no attempt is made to actually use the removed code (or
macros) on OpenBSD, at least at this time, this does
not result in any real functional change.

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

Change-Id: I1a92ec8b1cb989217d114918cc590caa3f7b4455
Reviewed-on: http://gerrit.openafs.org/3716
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoRe-enable rx connection hard timeout
Rainer Toebbicke [Tue, 18 Jan 2011 13:56:17 +0000 (14:56 +0100)]
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: I514f9f434d72fdca37c088376d17bcf2cca40325
Reviewed-on: http://gerrit.openafs.org/3680
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: remove vestiges of Giant
Ben Kaduk [Fri, 14 Jan 2011 01:16:44 +0000 (20:16 -0500)]
FBSD: remove vestiges of Giant

We do not support versions of FreeBSD that used Giant to
serialize access to vnode fields, and we always use the same locking
(which really ought to be MPSAFE).  Always set the MPSAFE flags
as needed, and do not bother to call VFS_[UN]LOCK_GIANT which
will never do anything for us.

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

Change-Id: I7709c886da933023a48ae368373e31f131539d42
Reviewed-on: http://gerrit.openafs.org/3679
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoafsd: CellItems doesn't apply to memcache mode
Derrick Brashear [Wed, 12 Jan 2011 21:45:57 +0000 (16:45 -0500)]
afsd: CellItems doesn't apply to memcache mode

avoid a potential panic from passing a bogus path into the kernel for
evaluation, in memcache mode.

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

Change-Id: I570372cae294b8060fbd77ed58939129ad56dd5d
Reviewed-on: http://gerrit.openafs.org/3678
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoSOLARIS: Include sys/varargs.h for kernel stdarg
Andrew Deason [Wed, 12 Jan 2011 16:29:46 +0000 (10:29 -0600)]
SOLARIS: Include sys/varargs.h for kernel stdarg

When compiling for the kernel, pre-10 Solaris seems to want
<sys/varargs.h> instead of <stdarg.h>, as documented in the Solaris
man pages. So include <sys/varargs.h> instead of <stdarg.h> where we
need variable arguments (afs_warn.c).

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

Change-Id: I473bcaa368c739265b911e79d596193f75ff8697
Reviewed-on: http://gerrit.openafs.org/3655
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: we're 64 bit capable
Derrick Brashear [Wed, 12 Jan 2011 21:55:09 +0000 (16:55 -0500)]
FBSD: we're 64 bit capable

define AFS_64BIT_ENV as we can support 64 bit long long integers.

Change-Id: If76168275333eca1b9505c5ead75b891550363ae
Reviewed-on: http://gerrit.openafs.org/3654
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD7: Don't sleep with the glock
Ben Kaduk [Mon, 20 Dec 2010 00:33:28 +0000 (19:33 -0500)]
FBSD7: Don't sleep with the glock

On FreeBSD 7.X, vinvalbuf() can (will) sleep; this results in a panic
when the kernel is configured with WITNESS and we hold the glock around
it.
Drop the glock in this case.

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

Change-Id: I3b22c12a20b33ca0e4df5a66c2edfc4167000a1c
Reviewed-on: http://gerrit.openafs.org/3650
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoBring FBSD 7.X client back to life
Ben Kaduk [Sun, 19 Dec 2010 04:52:44 +0000 (23:52 -0500)]
Bring FBSD 7.X client back to life

Having been untested for quite some time, we had several
places that needed more conditionals to compile on FreeBSD 7.

Now we compile and start on 7.3-RELEASE, but have locking issues
under actual use.

It seems that we are also incompatible with the Heimdal 0.6.3 in
the base system -- aklog is unable to actually obtain the needed
credential when compiled against that kerberos implementation;
using MIT krb5 1.6.3 from ports works without incident.

FIXES 128612

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

Change-Id: I148dbb0c5d8485d6f8fecae7a2d59e07a1a4d02b
Reviewed-on: http://gerrit.openafs.org/3649
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: switch to rx_Readv
Marc Dionne [Wed, 24 Nov 2010 00:08:24 +0000 (19:08 -0500)]
Cache bypass: switch to rx_Readv

Tests show that cache bypass doesn't scale very well past a few
concurrent processes, with a lot of lock contention in the RX
layer.  Switching the implementation to the iovec based rx_Readv
alleviates much of this.

Also take advantage of the fact that the upper layer readpages
only sends down contiguous lists of pages, and issue larger read
requests and populate the pagecache pages from the iovecs we
get back.  The loop logic is changed significantly to accomodate
the new pattern.

Read throughput is improved by about 30-40% for some parallel read
benchmarks I use.  Along with some other tweaks, it can allow the
throughput to be more than doubled.

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

Change-Id: Ie8801404c370f64b0075169d63cf790c71bf2537
Reviewed-on: http://gerrit.openafs.org/3647
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: Only compile bypass code for the Linux kernel
Marc Dionne [Tue, 23 Nov 2010 23:39:33 +0000 (18:39 -0500)]
Cache bypass: Only compile bypass code for the Linux kernel

Only compile the afs_bypasscache.c code if AFS_LINUX24_ENV is set,
since it's currently the only case where the code is actually used.
Only sections that caused problems for UKERNEL were previously
ifdef'ed.

Besides making the code cleaner, the main effect of this change
is to prevent compiling most of the bypass code for UKERNEL where
it isn't currently used.

If support for bypass is added for other platforms eventually, the
code here would need to be reworked anyway, ideally abstracting out
and moving any OS specific bits into the platform subdirectories.

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

Change-Id: I042a30ac2a5e8156a233a0ff0f46aa5cd4fcd675
Reviewed-on: http://gerrit.openafs.org/3646
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: remove ifdefs under src/afs/LINUX
Marc Dionne [Tue, 23 Nov 2010 23:21:16 +0000 (18:21 -0500)]
Cache bypass: remove ifdefs under src/afs/LINUX

Compile cache bypass code unconditionally under src/afs/LINUX
since it is now always enabled.  Also remove syslog messages
about a "cache bypass patched module" when loading and unloading
the module.

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

Change-Id: I57c44352f11ca7f68f6c3644345a7d48da8c1bf9
Reviewed-on: http://gerrit.openafs.org/3645
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: release and unlock pages when we get 0-length reply
Marc Dionne [Sun, 7 Nov 2010 20:06:16 +0000 (15:06 -0500)]
Cache bypass: release and unlock pages when we get 0-length reply

In some cases, such as reading past the end of file as known to the
server, fetchdata will get a 0 length reply.  Deal gracefully by
unlocking and releasing any pages reserved by readpages.  Failure
to do so here leads to deadlocks later as we can exit with some pages
still locked.

Reviewed-on: http://gerrit.openafs.org/3283
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e4250dc64eb26b5da1480e9f5bd58d016f81847f)

Change-Id: I54dc4ef040b816596cf48edf866976943220d988
Reviewed-on: http://gerrit.openafs.org/3644
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: adjust read size for non-contiguous readpages
Marc Dionne [Sun, 7 Nov 2010 18:35:36 +0000 (13:35 -0500)]
Cache bypass: adjust read size for non-contiguous readpages

The bypass code's readpages does deal with a non-contiguous list
of pages, but it doesn't adjust the size of the read it requests
from the background daemon accordingly.  As a result we'll ask the
server for pages we were not asked to read.

Reviewed-on: http://gerrit.openafs.org/3282
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0b6b2b3cab09eacf9b03638d8770c83aeb0b8fea)

Change-Id: Ic7241fb27bd177eb7279292804def753f9120407
Reviewed-on: http://gerrit.openafs.org/3643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: make readpage deal with reads at end of file
Marc Dionne [Sun, 7 Nov 2010 18:14:55 +0000 (13:14 -0500)]
Cache bypass: make readpage deal with reads at end of file

When a file's size is an exact multiple of the page size, the vfs
will issue a readpage for an extra page at the end, for which there
is no data.  Deal with it here instead of letting it trickle down
to the background daemon, which will issue an unnecessary read to the
server, and maybe get confused because there is no data.

Reviewed-on: http://gerrit.openafs.org/3281
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8ec31f26770ef1e85fb3a6005467f0e2d3ce1715)

Change-Id: Ib47a8cc62611c6e7c904898990b38ae48d8478e3
Reviewed-on: http://gerrit.openafs.org/3642
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: Remove AFS_KMAP_ATOMIC
Marc Dionne [Tue, 23 Nov 2010 22:50:25 +0000 (17:50 -0500)]
Cache bypass: Remove AFS_KMAP_ATOMIC

Since AFS_KMAP_ATOMIC is defined unconditionally, remove the ifdefs
and the code for the !AFS_KMAP_ATOMIC case.  We probably don't want
to support this feature on a kernel old enough not to have kmap_atomic.
This should exist on all 2.6 and even 2.4 linux kernels.

This simplifies the code for maintenance and later changes.

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

Change-Id: I6d2970f9b8811e145e2a03105c64cbd6714c0c5a
Reviewed-on: http://gerrit.openafs.org/3641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: fix use of incorrect "states"
Marc Dionne [Tue, 11 Jan 2011 02:31:18 +0000 (21:31 -0500)]
Cache bypass: fix use of incorrect "states"

Test and set the correct field for cache bypass flags.  There was
some confusion between cachingStates and the states associated with
vcache entries in a few places.

Reviewed-on: http://gerrit.openafs.org/3637
Reviewed-by: Matt Benjamin <matt@linuxbox.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 8c541079573274d726180d3d9679c6a26cda84ea)

Change-Id: Ibaae9a766ef01cf4c68995c2bef454bae5d03b38
Reviewed-on: http://gerrit.openafs.org/3640
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoCache bypass: Fix oops in bypass transition functions
Marc Dionne [Fri, 5 Nov 2010 00:49:41 +0000 (20:49 -0400)]
Cache bypass: Fix oops in bypass transition functions

The FCSBypass flag might change between the time we check it before
entering afs_TransitionToCaching or afs_TransitionToBypass and when
we check it again within the functions.

Instead of panicing, just exit if someone beat us to it.  Also move
the checks within the write lock region to make sure the code
doesn't get run multiple times.

Reviewed-on: http://gerrit.openafs.org/3266
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f2c6ae300a211460c24c87752cf9400b9e61ee1f)

Change-Id: I3b7ad3f9672975a87dbe337256d42166fc638b34
Reviewed-on: http://gerrit.openafs.org/3639
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoZero rx_multi_lock before initializing it
Ben Kaduk [Mon, 20 Dec 2010 00:29:17 +0000 (19:29 -0500)]
Zero rx_multi_lock before initializing it

FreeBSD's kernel debugging facilities will panic if it detects
an attempt to re-initialize an already-initialized lock, as detected
through some particular bits being nonzero.  Zero everything out
before starting, to prevent this panic.

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

Change-Id: I7e78989c313269388808c26d521f4075c0749cd4
Reviewed-on: http://gerrit.openafs.org/3638
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoprovide more verbose logging when VGetVolumeByVp_r fails
Tom Keiser [Wed, 13 Oct 2010 05:16:25 +0000 (01:16 -0400)]
provide more verbose logging when VGetVolumeByVp_r fails

FSYNC_com_VolOff() commits sepuku when VGetVolumeByVp_r() fails to return
a heavyweight ref to the volume.  This small patch provides more detailed
debugging information so we have a better idea why VGetVolumeByVp_r failed.

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

Change-Id: Ieebbf65b1764304f0b8e38bb32f0e4f61c332932
Reviewed-on: http://gerrit.openafs.org/3620
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: StopListener glocking fixup
Ben Kaduk [Sun, 19 Dec 2010 05:06:13 +0000 (00:06 -0500)]
FBSD: StopListener glocking fixup

afs_osi_Sleep requires the glock (so that it can sleep on it); we
dropped the glock earlier in osi_StopListener because soshutdown and
soclose can sleep, but we must (unconditionally!) acquire it for our
loop waiting on rxk_ListenerPid.

Change-Id: Ibea3da2c5d18a2609989b547a1c587c25e3f07ff
Reviewed-on: http://gerrit.openafs.org/3549
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 28032bc1c1aaa4c25e94025a8fa9e2b4e8131ce3)
Reviewed-on: http://gerrit.openafs.org/3633

14 years agovos: free ubulkentries with xdr_free
Jeffrey Altman [Fri, 24 Dec 2010 15:06:05 +0000 (10:06 -0500)]
vos: free ubulkentries with xdr_free

Instead of using free() to free the ubulkentries data structure
use xdr_free().

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

Change-Id: I9af8aee92e0e187923ccd952a5487ea419446720
Reviewed-on: http://gerrit.openafs.org/3626
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovos release: Avoid full dump on all sites
Andrew Deason [Thu, 11 Nov 2010 20:45:04 +0000 (14:45 -0600)]
vos release: Avoid full dump on all sites

Commit 9fed169b1c5c823fd96cea94daf712b2cf06c901 attempts to remove any
remote RO site that has RO_DONTUSE set. However, we set RO_DONTUSE on
all sites earlier in the release process if this is a full release,
resulting in all sites getting a full dump.

Correct this by remembering in 'origflags' what flags each site has
before we messed with the vldb entry.

Thanks to Mike Meffie.

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

Change-Id: I5a14c490dba7e1ad815856ccb3f90e210e09f50d
Reviewed-on: http://gerrit.openafs.org/3624
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
14 years agovolser: Fix broken bulk conversion
Simon Wilkinson [Sun, 26 Dec 2010 14:14:38 +0000 (14:14 +0000)]
volser: Fix broken bulk conversion

The converstions between the original, N and U bulk list return
values were all broken in various ways:

1/ Shifting from malloc to xdr_alloc() (in 4f1efdc8b73ed)
   subtly changed the behaviour when handling an empty list. The
   correct XDR representation of an empty list is {0, NULL}, not
   {0, &memZero}. Fix the code so that if the source list is empty,
   an empty destination list is returned.
2/ The destination list length was never being filled in. This means
   that xdr_free() could not be safely used on this list, as the wrong
   length would be passed to the allocator. Fill in the destination
   list length as part of the conversion.
3/ xdr_free(...) is a no-op when called with an empty list - there's
   no need to check before calling it. Remove these checks to improve
   the code's readability.
4/ xdr_free(...) should only be called when the RPC returned
   sucessfully. The stub is responsible for freeing data should the call
   fail mid way through unmarshalling.
5/ Where an RPC returns the number of entries independently of the
   length of a counted array, it is unsafe to use that length to
   iterate the array without checking that it is within the array
   bounds. Instead, just use the array length when performing
   conversions.

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

Change-Id: I1d3ec3929a8974d571e9b3712e53db4fceab4879
Reviewed-on: http://gerrit.openafs.org/3635
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agovos: Abstract out bulk list conversion
Simon Wilkinson [Sun, 26 Dec 2010 14:00:42 +0000 (14:00 +0000)]
vos: Abstract out bulk list conversion

Pull the various segments of code that do bulk list conversion into
their own functions. This is purely code reorganisation at this point,
fixes for these functions will follow in subsequent patches.

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

Change-Id: Ib6b32fe942f5083e18f32404156a42cd82bf5c5a
Reviewed-on: http://gerrit.openafs.org/3634
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: band-aid vnode locking in lookup
Ben Kaduk [Sun, 24 Oct 2010 04:29:07 +0000 (00:29 -0400)]
FBSD: band-aid vnode locking in lookup

The lock order requires that we acquire vnode locks from the root
towards the leaf.  When looking up "..", this requires that we
unlock the directory before locking the child, otherwise we
are susceptible to deadlock.
This is only a band-aid, as afs_vop_lookup should be rewritten.

Change-Id: I594f31ba05c3847e5d83d89748266d24547bf97b
Reviewed-on: http://gerrit.openafs.org/3035
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/3632
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoFBSD: close race in afs_root
Ben Kaduk [Sat, 6 Nov 2010 04:02:31 +0000 (00:02 -0400)]
FBSD: close race in afs_root

Previously, we called afs_PutVCache(afs_globalVp) directly.  This
is unsafe because PutVCache acquires locks which can sleep, losing
the serialization of the GLOCK.  In rare circumstances, this can
result in two threads simultaneously making that call, and the
second one would panic in vputx() with a negative refcount.
Close the race by using a local variable for the afs_PutVCache()
calls, applying the change to afs_globalVp before dropping the GLOCK.
While here, fix up other race conditions.

Change-Id: I4733489d50d3459172ee2eb021190d013f68018a
Reviewed-on: http://gerrit.openafs.org/3275
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-on: http://gerrit.openafs.org/3631
Tested-by: Derrick Brashear <shadow@dementia.org>
14 years agoUse afs_foff_t for file offsets
Andrew Deason [Wed, 10 Nov 2010 15:11:47 +0000 (09:11 -0600)]
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: I6f950fd23eba9e00470e424ae49ee6ce9d7ca6f4
Reviewed-on: http://gerrit.openafs.org/3618
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>