openafs.git
13 years agovol: make namei_ListAFSSubDirs deal with multiple/bad linktables
Tom Keiser [Thu, 14 Oct 2010 05:24:03 +0000]
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.

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

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

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

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

13 years agoCache bypass: make readpage deal with reads at end of file
Marc Dionne [Sun, 7 Nov 2010 18:14:55 +0000]
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.

Change-Id: If86ed785c4e9d50edb1a960142f726fa869c50fc
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>

13 years agovolser: Do not FSYNC_VOL_DONE temporary volumes
Andrew Deason [Thu, 30 Sep 2010 16:34:59 +0000]
volser: Do not FSYNC_VOL_DONE temporary volumes

Currently, the volserver just looks at the destroyMe field in a volume
header to see if it should tell the fileserver a volume has been
deleted (FSYNC_VOL_DONE opcode). However, temporary volumes created by
the volserver (such as new volumes or clones) have destroyMe set, but
are obviously not deleted, and so the fileserver should just be told
FSYNC_VOL_LEAVE_OFF about these volumes instead.

With commit bb9caf9822a53ad07cd3a5d6cea7f6b7eeeedd59, FSYNC_VOL_DONE
and FSYNC_VOL_LEAVE_OFF actually do different things, so this does
make a difference.

Note that this commit slightly changes the meaning of the
vp->needsPutBack field. Now it must be set to VOL_PUTBACK_DELETE to
tell the fileserver that the volume has been deleted, and set to
VOL_PUTBACK if it just needs to be given back to the fileserver.

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

13 years agoCache bypass: adjust read size for non-contiguous readpages
Marc Dionne [Sun, 7 Nov 2010 18:35:36 +0000]
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.

Change-Id: I5468a4a68f4f415961298144f5bb581faeda540a
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>

13 years agorxperf: use parallel connections
Jeffrey Altman [Mon, 8 Nov 2010 16:07:14 +0000]
rxperf: use parallel connections

When the number of threads exceeds RX_MAXCALLS allocate additional
rx connection objects.

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

13 years agoRX: rxi_PrepareSendPacket drops call lock; WaitforTQ required
Simon Wilkinson [Sat, 6 Nov 2010 19:18:14 +0000]
RX: rxi_PrepareSendPacket drops call lock; WaitforTQ required

Since rxi_PrepareSendPacket drops the call->lock during
processing the caller must perform a rxi_WaitforTQ prior
to manipulating the transmit queue.

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

13 years agovol: Do not give back not-checked-out vols
Andrew Deason [Fri, 5 Nov 2010 21:48:28 +0000]
vol: Do not give back not-checked-out vols

VAttachVolumeByName_r has logic to give back a volume over FSSYNC if
we checked out a volume but failed to attach it for whatever reason.
However, the logic used for determining if the volume was checked out
or not is a bit inaccurate (even moreso than the comments imply),
potentially causing us to VOL_ON volumes that don't exist at all.

Instead of trying to guess based on various conditions whether or not
we checked out the volume, keep track of a variable that is only set
when we actually checkout the volume from the fileserver. Then only
give back the volume if it is set.

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

13 years agoCache bypass: release and unlock pages when we get 0-length reply
Marc Dionne [Sun, 7 Nov 2010 20:06:16 +0000]
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.

Change-Id: Ic9e496c8c64d5e94f2cf9976d160ef5873f27249
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>

13 years agorx: Reorganise includes
Simon Wilkinson [Fri, 1 Oct 2010 08:36:06 +0000]
rx: Reorganise includes

RX files were including the same header set in three different places,
once for user-land builds, once for kernel builds and once for ukernel.
The duplication was a bit pointless, and really frustrating when adding
new headers. So, reorganise the includes so that we only list headers
that are used in all three builds in one location.

Also take the opportunity to indent the #ifdefs so that it is clear
what is going on, and to remove some more of AFS_OSF_ENV and
AFS_AUX_ENV from kernel builds.

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

13 years agoWindows: fix keystroke delay in waitkey
Michael Meffie [Fri, 5 Nov 2010 12:27:37 +0000]
Windows: fix keystroke delay in waitkey

Fix the keystroke delay in the pthreaded wait for key
function.

Change-Id: I79293ceca57a418d23b0a211f875c17b805f9391
Reviewed-on: http://gerrit.openafs.org/3268
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>

13 years agoavoid private stdio fields in waitkey
Michael Meffie [Thu, 4 Nov 2010 13:26:25 +0000]
avoid private stdio fields in waitkey

Use the stdio_ext functions provided by solaris and glibc
instead of directly accessing private stdio FILE structure
members. This is needed for 64-bit solaris builds and is more
portable in general since the FILE structure is meant to be
opaque.  Remove the duplicated code in the pthreaded butc
package.

Change-Id: Idbefa88e2563bb117322e818b1300b324fc3626d
Reviewed-on: http://gerrit.openafs.org/3257
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>

13 years agoDAFS: Do not let VScheduleSalvage_r free vp
Andrew Deason [Fri, 5 Nov 2010 19:34:05 +0000]
DAFS: Do not let VScheduleSalvage_r free vp

In VScheduleSalvage_r, we were calling VCancelReservation_r, which has
the possibility of free'ing vp. Since we still use vp after doing this
(and since we're already inside VCancelReservation_r to begin with),
we must not free vp. Instead, just decrement nWaiters without
triggering any of the dtor code in VCancelReservation_r. This is safe
as long as all VScheduleSalvage_r callers ensure that they check to
free the vp if necessary, which they all do.

Thanks to Derrick Brashear.

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

13 years agomerge ntops and namei
Derrick Brashear [Thu, 28 Oct 2010 05:03:49 +0000]
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.

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

13 years agoRedHat: Remove potpourri.h from RedHat SPEC file manifest
Jonathan Billings [Fri, 5 Nov 2010 13:38:43 +0000]
RedHat:  Remove potpourri.h from RedHat SPEC file manifest

potpourri.h is no longer needed, so it should be removed from the
list of files to be installed.  The missing file was causing the
RPM package build process to fail.

a reverse-cherry-pick of fb7e276efdf1c68144c8d210582c0b66ab1ab081
Reviewed-on: http://gerrit.openafs.org/3267
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

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

13 years agoCache bypass: Fix oops in bypass transition functions
Marc Dionne [Fri, 5 Nov 2010 00:49:41 +0000]
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.

Change-Id: I4319896e522d0681c548299d2bd547e71998cc88
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>

13 years agoRX: Fix old rx_stats incrementors
Andrew Deason [Thu, 4 Nov 2010 17:07:17 +0000]
RX: Fix old rx_stats incrementors

A couple of places were still trying to increment rx_stats members by
just ++'ing them. Update them to use rx_atomic_inc.

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

13 years agokrb5_free_string takes a krb5_context
Andrew Deason [Thu, 4 Nov 2010 16:46:10 +0000]
krb5_free_string takes a krb5_context

Give krb5_free_string a krb5_context, not just the string to free.

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

13 years agotsm: Make explicit rules for stem-changing targets
Andrew Deason [Thu, 4 Nov 2010 16:37:31 +0000]
tsm: Make explicit rules for stem-changing targets

If the stem changes for generating a .o from a .c file,
implicit/suffix rules will not apply. That is, if we specify the
dependencies for 'bar.o' in a Makefile as so:

bar.o: foo.c

This will not match an implicit .c.o rule, since the filename stem
changes. We must add an explicit AFS_CCRULE invocation to make the
rule do anything.

This fixes this problem for the src/tsm41 directory. It may exist
elsewhere, but it's difficult to find unless the build breaks.

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

13 years agoUKERNEL: f_fsid is a struct on AIX
Andrew Deason [Thu, 4 Nov 2010 15:57:30 +0000]
UKERNEL: f_fsid is a struct on AIX

The statvfs f_fsid member is a struct with two fields on AIX when
_ALL_SOURCE is defined (which we define to get various extensions). So
in the AIX case, use it as such a struct instead of a single integer.

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

13 years agoafsd: Pass cacheMountDir to aix_vmount
Andrew Deason [Thu, 4 Nov 2010 15:33:17 +0000]
afsd: Pass cacheMountDir to aix_vmount

cacheMountDir is no longer global, so aix_vmount() needs it passed as
an argument. Do so.

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

13 years agoUse termios.h for winsize test where available
Andrew Deason [Thu, 4 Nov 2010 15:30:31 +0000]
Use termios.h for winsize test where available

The configure test for 'winsize' existence was using sys/termios.h,
but some platforms (AIX) have termios.h but no sys/termios.h. So, use
termios.h instead where available.

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

13 years agovolser: add missing Makefile dependencies
Marc Dionne [Tue, 2 Nov 2010 22:14:07 +0000]
volser: add missing Makefile dependencies

Add some missing dependencies in the volser Makefile to prevent
trying to compile while a header file is still being generated.

This caused parallel make errors on some slower systems.

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

13 years agoLinux: 2.6.37 - replace get_sb with mount
Marc Dionne [Wed, 3 Nov 2010 00:54:20 +0000]
Linux: 2.6.37 - replace get_sb with mount

With kernel 2.6.37 the new entry point for mounting a filesystem
is the mount() operation instead of get_sb().

Replace afs_get_sb with afs_mount if the new operation is
available, and use mount_nodev instead of get_sb_nodev.

Note that this is not strictly required for 2.6.37 since the old
interfaces are still around, but we might as well switch now.

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

13 years agoMake osi_fetchstore.c protocol independent
Hartmut Reuter [Tue, 2 Nov 2010 11:15:42 +0000]
Make osi_fetchstore.c protocol independent

For future use of OSD and vicep-access osi_fetchstore.c should not depend on
the rx-fileserver-protocol but call instead the routines pointed to by ops.

Some code beautyfication in afs_fetchstore.c to use nBytes instead of code.

New global variable afs_protocols in afs_fetchstore.c which will be used
in RXOSD/VICEP-ACCESS programs in the future.

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

13 years agoDocs: Specify where the Windows mini dump file is written
Rod Widdowson [Fri, 29 Oct 2010 13:21:37 +0000]
Docs: Specify where the Windows mini dump file is written

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

13 years agorx mutex inversion fix
Derrick Brashear [Tue, 2 Nov 2010 18:47:35 +0000]
rx mutex inversion fix

as discovered by Benjamin Kaduk, we were usually holding rx_refcnt_mutex
but briefly, and here we held it longer, and thus around acquiring freepktQ
mutex. undo it by simply setting STATE_RESET sooner as newcall does.

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

13 years agoWindows: Do not leak cm_volume_t objects from the LRU queue
Jeffrey Altman [Tue, 2 Nov 2010 20:16:20 +0000]
Windows: Do not leak cm_volume_t objects from the LRU queue

During cm_volume_t object recycling the object is removed
from the LRU to ensure that a single object is not recycled
by multiple threads at the same time.  Before cm_FindVolumeByName()
exits the object must be re-inserted into the LRU if it is not
present.

LICENSE MIT

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

13 years agovol: attach2 must always return with VOL_LOCK held
Jeffrey Altman [Thu, 28 Oct 2010 04:37:03 +0000]
vol: attach2 must always return with VOL_LOCK held

attach2() is required to return with the VOL_LOCK held
even though it is called without it.  This must be true
for error conditions as well.  Not all error paths are
obtaining the VOL_LOCK before returning.  Add out paths for
lock held and lock unheld error cases.

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

13 years agoafs: minor cleanup for LINUX struct vcache
Chas Williams (CONTRACTOR) [Sat, 30 Oct 2010 22:10:34 +0000]
afs: minor cleanup for LINUX struct vcache

mapcnt is no longer used in either linux client and should be removed
to save a little space/sanity.

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

13 years agoDAFS: Fix demand-salvages of attached volumes
Andrew Deason [Fri, 2 Jul 2010 21:57:42 +0000]
DAFS: Fix demand-salvages of attached volumes

Currently, when an error is encountered for an attached volume, we
call VRequestSalvage_r, which makes the volume go into the
VOL_STATE_SALVAGING state. This state implies that the volume is
offline, however, which is not necessarily the case if we're calling
VRequestSalvage_r from, for example, VAllocVnode_r or VUpdateVolume_r.

So now, make a new state called VOL_STATE_SALVAGE_REQ to indicate when
a salvage has been requested but the volume is not offline yet (and
thus is not yet ready to give to the salvager). If VCheckSalvage finds
a volume in this state, it offlines the volume first. The FSSYNC
VOL_OFF handler now checks for this state, and if we're giving the
volume to the salvager, we wait for the volume to exit that state.

VRequestSalvage_r also gains a new flag, VOL_SALVAGE_NO_OFFLINE. This
is to ensure that the existing salvaging code paths for unattached
volumes does not change (for when VRequesetSalvage_r is called from
attach2). If this flag is passed, we do what we used to do, which is
just salvage the volume without offlining it.

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

13 years agoCleanup VOffline log message for non-DAFS
Andrew Deason [Mon, 1 Nov 2010 20:34:26 +0000]
Cleanup VOffline log message for non-DAFS

Commit fd592c7674d4aa44dda90998b54d7b56947f6ed8 fixed the 'Volume X
(Y) is now offline' message for DAFS, but the same problem persists
for non-DAFS. Fix the non-DAFS case.

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

13 years agoQSG: DAFS uses dasalvager
Andrew Deason [Mon, 1 Nov 2010 22:30:20 +0000]
QSG: DAFS uses dasalvager

For DAFS, you want to use 'dasalvager' not 'salvager'. One place was
still referencing 'salvager' in a DAFS example, so fix it.

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

13 years agocheck for error_message
Derrick Brashear [Mon, 1 Nov 2010 01:58:37 +0000]
check for error_message

IRIX apparently has enough krb5 to try building aklog, but no
error_message. ok. so let's cope

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

13 years agokill off afs/debug.h
Derrick Brashear [Fri, 29 Oct 2010 17:47:17 +0000]
kill off afs/debug.h

as reported by Marc Dionne, debug.h was still redefinining assert()

yeah, let's be done with that.

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

13 years agoAdd libroken as its own library
Simon Wilkinson [Fri, 29 Oct 2010 11:10:16 +0000]
Add libroken as its own library

Include libroken as a library in its own right, so that the whole
of the code can benefit from it. This change purely adds libroken
for the Unix build system. It doesn't replace those pieces of
libroken in hcrypto or util, or enable it for Windows.

There is also the option of using a system-install libroken, if one is
found at configure time.
  *) If --with-libroken=yes, or is not supplied than a system library
     will be used if suitable. Otherwise, we'll use the internal
     libroken
  *) If --with-libroken=/path/to/installation then the libroken at
     that path will be used. If there is no libroken there, or it
     is not suitable, an error will be returned
  *) If --with-libroken=internal then the internal libroken is used,
     regardless of what is present on the system.

We deliberately do not provide installed headers for the internal
libroken. If other applications wish to make use of libroken, then
they should use the Heimdal one, rather than piggybacking on ours.

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

13 years agoImport of code from heimdal
Heimdal Developers [Sat, 30 Oct 2010 14:00:38 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
a3afa695ee3eb1ff5ad8de3e80c20d5049fce934 (switch-from-svn-to-git-1619-ga3afa69)

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

13 years agoauth: Use Kernel XDR for kernel tokens
Simon Wilkinson [Sat, 30 Oct 2010 13:53:39 +0000]
auth: Use Kernel XDR for kernel tokens

For consistency, we should use a version of token.xdr.c built with
the -k flag when we build it into our kernel modules.

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

13 years agoutil: netutils never builds in the kernel ...
Simon Wilkinson [Fri, 29 Oct 2010 18:19:48 +0000]
util: netutils never builds in the kernel ...

... so stop pretending that it does.

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

13 years agoImport of code from heimdal
Heimdal Developers [Wed, 27 Oct 2010 20:26:47 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
a3afa695ee3eb1ff5ad8de3e80c20d5049fce934 (switch-from-svn-to-git-1619-ga3afa69)

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

13 years agoImport still more files from libroken
Simon Wilkinson [Sat, 30 Oct 2010 13:58:31 +0000]
Import still more files from libroken

This time, these are files which are needed to get Windows going.

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

13 years agoLinux: remove stale prototype and references for read_super
Marc Dionne [Fri, 29 Oct 2010 20:23:07 +0000]
Linux: remove stale prototype and references for read_super

The 2.6 code doesn't have an afs_read_super, so remove the
prototype and the outdated comments that reference it.

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

13 years agoQuickstart Guide: Add some verbiage about /vicepXX/AlwaysAttach
Jason Edgecombe [Tue, 26 Oct 2010 19:00:58 +0000]
Quickstart Guide: Add some verbiage about /vicepXX/AlwaysAttach

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

13 years agorxosd: allow parallel make
Marc Dionne [Fri, 29 Oct 2010 20:09:45 +0000]
rxosd: allow parallel make

Build rules that use COMPILE_PART1 must be prefixed with +
to indicate to make that the subprocess is a make and that it
can run with parallel jobs.

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

13 years agoFix fs bypassthreshold to accept a size of -1 to disable
Phillip Moore [Tue, 19 Oct 2010 16:17:20 +0000]
Fix fs bypassthreshold to accept a size of -1 to disable

The fs bypassthreshold command assumes a value of -1 means the feature
is disabled, but the CLI refused to accept this argument, since it is
not strictly a digit (according ti isdigit()).  This patch accepts the
string -1, and makes it possible to both enable AND disable this
feature.

Change-Id: I87720b2dcfc4e9ee9f322c4841836b74440ac442
Reviewed-on: http://gerrit.openafs.org/3009
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
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>

13 years agofs getfid defaults to '.', like other path-related commands
Phillip Moore [Tue, 19 Oct 2010 15:31:47 +0000]
fs getfid defaults to '.', like other path-related commands

I noticed that all of the other commands that accept a list of paths
use the SetDotDefault() function to default to ".", when no arguments
are given.  This patch adds that call to getfid, making it more
consistent with similar commands.

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

13 years agofs getfid output changed for consistency with Windows implementation
Phillip Moore [Tue, 19 Oct 2010 15:23:46 +0000]
fs getfid output changed for consistency with Windows implementation

This patch removes the redundant volume ID from the output of fs
getfid, and replaces it with the cell name, which is what the Windows
implementation provides.

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

13 years agoMakes fs getfid error handling consistent with other fs commands
Phillip Moore [Tue, 19 Oct 2010 12:24:41 +0000]
Makes fs getfid error handling consistent with other fs commands

This patch makes the fs getfid command print errors for paths that
can't be handled correctly, instead of quietly ignoring them, and it
also returns an error code if any such paths are encountered.  This
makes the behavior consistent with other fs commands, such as
listquota, whereis, etc.

FIXES 128372

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

13 years agoQuickStart Unix: use dafs type and name for demand attach file services
Rod Widdowson [Fri, 29 Oct 2010 18:57:50 +0000]
QuickStart Unix: use dafs type and name for demand attach file services

bos create <machine name> dafs dafs [...] (not fs).

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

13 years agoFBSD: correct and simplify vcache eviction routines
Ben Kaduk [Fri, 29 Oct 2010 07:18:02 +0000]
FBSD: correct and simplify vcache eviction routines

osi_VM_FlushVCache and osi_TryEvictVCache were both attempting
to be wrappers around vgone(), with some checks before hand.
Implement the latter in terms of the former to prevent
code duplication and propagation of incorrect code.

Additionally, correct the locking around vgone().  The
vnode lock must be held, and we must also increase the vnode's
hold count so that it does not disappear out from under us.
As we need the interlock to check the usecount, keep it
locked until we lock the vnode lock, for extra protection.

As an added bonus, we no longer try to call vgonel(), which
is not an exported symbol and merely happened to work due
to the current kernel linker implementation.

Remove some stale comments.

With this change, a parallel buildworld completes on
my four-core machine.

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

13 years agoFBSD: lock interlock around v_usecount accesses
Ben Kaduk [Fri, 29 Oct 2010 16:01:04 +0000]
FBSD: lock interlock around v_usecount accesses

The FreeBSD vnode locking strategy requires that the vnode
interlock be held for all accesses to v_usecount, such as those
used by our VREFCOUNT and VREFCOUNT_GT macros.  Conveniently,
a wrapper function is provided that takes the lock around its
access of the element, vrefcnt().  Use it for our macros.

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

13 years agoRPM scripts should allow newbinary restart to restart
Derrick Brashear [Wed, 27 Oct 2010 00:13:38 +0000]
RPM scripts should allow newbinary restart to restart

add a mode where a newbinary restart can be used instead of
condrestart to induce a restart.

also, on upgrade, don't turn on the server RC script if it was
previously manually disabled.

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

13 years agoafs: clean afs_osi_Alloc() usage
Chas Williams (CONTRACTOR) [Tue, 19 Oct 2010 18:50:35 +0000]
afs: clean afs_osi_Alloc() usage

Add asserts for any failures cases not explicitly handled and remove
any casting.

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

13 years agoafs: simplify afs_osi_alloc.c
Chas Williams (CONTRACTOR) [Tue, 19 Oct 2010 16:30:02 +0000]
afs: simplify afs_osi_alloc.c

remove the osimem struct and related casts

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

13 years agoafs: afs_osi_Alloc_NoSleep() cleanup
Chas Williams (CONTRACTOR) [Tue, 19 Oct 2010 16:19:16 +0000]
afs: afs_osi_Alloc_NoSleep() cleanup

afs_osi_Alloc_NoSleep() is no longer used by the SOLARIS or IRIX
clients.  It is used by the *BSD code in rx, so just let those
platforms define/prototype it in their osi_machdep.h

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

13 years agoWhat the cache manager needs to know about rxosd
Hartmut Reuter [Tue, 26 Oct 2010 18:43:59 +0000]
What the cache manager needs to know about rxosd

this patch contains only the RPC interface to rxosd which already
contains the definition of all RPCs not just those few used in the
cache manager.

The code which calls these RPCs will follow in subesquent patches.

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

13 years agowindows: terminate multi_sz correctly
Rod Widdowson [Fri, 29 Oct 2010 17:01:13 +0000]
windows: terminate multi_sz correctly

CreateProcess requires a null-terminated list of null-terminated strings
as an environment parameter.

A missing level of indirection was causing the final null to be
missed, meaning that if bosserver ran from somewhere which had an
environment the create process would fail.

Fix the null termination.

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

13 years agoWindows: Finish converting vol apps to pthread only
Jeffrey Altman [Thu, 28 Oct 2010 05:19:17 +0000]
Windows: Finish converting vol apps to pthread only

The src/vol directory on Windows is one of the rare examples
where a single directory builds both lwp and pthreaded versions
of libraries and executables.  With this patchset the executables
are fully converted from lwp to pthread.  This requires that
afsrpc.dll include the pthread implementations of the threadname,
fasttime, and lock implementations from the LWP directory.
The inclusion within afsrpc.dll permits the dviced and
dvolser directories to avoid rebuilding those object modules.

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

13 years agowindows: native versions of ih_pread and ih_pwrite
Rod Widdowson [Wed, 27 Oct 2010 22:20:30 +0000]
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.

Change-Id: I225387a574b1301516a9313838bbcb86e9e14b8d
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>

13 years agovol: Use OSI_NULLSOCKET and not -1 to indicate invalid fssync fd
Jeffrey Altman [Thu, 28 Oct 2010 04:43:26 +0000]
vol: Use OSI_NULLSOCKET and not -1 to indicate invalid fssync fd

The FSync file descriptor is an osi_socket which has an invalid
value of OSI_NULLSOCKET which is not necessarily -1.  Be sure to
compare against OSI_NULLSOCKET and not -1 when checking an invalid
value.

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

13 years agovol: Always use INVALID_FD to indicate an invalid fd
Jeffrey Altman [Thu, 28 Oct 2010 04:40:32 +0000]
vol: Always use INVALID_FD to indicate an invalid fd

file descriptors on Windows are not ints and therefore
cannot be safely compared against -1.  Always use INVALID_FD
which is -1 on UNIX and INVALID_HANDLE_VALUE on Windows.

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

13 years agoImport: Add roken files from heimdal
Simon Wilkinson [Wed, 27 Oct 2010 20:26:19 +0000]
Import: Add roken files from heimdal

Add the necessary files to our import list such that roken can be
built as a standalone library.

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

13 years agoshlib-build: Add ignore option
Simon Wilkinson [Fri, 29 Oct 2010 11:40:31 +0000]
shlib-build: Add ignore option

Add an option to shlib-build to ignore missing symbols in the map file.
This is already the default on some platforms, but others (such as
Darwin) require that all symbols in the mapfile be present in the
objects. This is a pain for libraries such as libroken, which will
have different symbols on different platforms.

Specifying -i adds the necessary magic to Darwin's ld to relax this
check. Changes may also be necessary for other platforms, but I
don't currently have those available for testing.

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

13 years agoubik: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 17:06:26 +0000]
ubik: Set but not used variables

Fix warnings, remove unused variables and code.

Spotted by gcc 4.6

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

13 years agobucoord: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 17:39:00 +0000]
bucoord: Set but not used variables

Remove unused variables

Spotted by gcc 4.6

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

13 years agoxstat: Set but not used variables
Marc Dionne [Sat, 11 Sep 2010 17:49:49 +0000]
xstat: Set but not used variables

Remove unused variables.

Spotted by gcc 4.6

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

13 years agoFBSD: fix dumb panic when we can't pfind rxk_Listener
Ben Kaduk [Fri, 29 Oct 2010 02:45:33 +0000]
FBSD: fix dumb panic when we can't pfind rxk_Listener

The process is only returned locked if the process is found.
Don't try to unlock it if it's not found.

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

13 years agoexplain yacc build product dependency so it is not removed
Derrick Brashear [Tue, 26 Oct 2010 13:41:47 +0000]
explain yacc build product dependency so it is not removed

in order that our .c.o rule applies, force yacc source to
not be built directly into an object.

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

13 years agobucoord: parallel make fix
Marc Dionne [Wed, 27 Oct 2010 00:33:41 +0000]
bucoord: parallel make fix

Fix an instance of a Makefile rule with multiple targets.
This can cause a parallel make to fail when two instances of
compile_et compete to write the same output files.

Spotted by a build failure with a corrupt bc.h header.

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

13 years agoWindows: fix built in touch
Rod Widdowson [Thu, 28 Oct 2010 17:34:41 +0000]
Windows:  fix built in touch

Recent versions of windows add a whole bunch of attributes above
A_ARCH.  (FILE_ATTRIBUTE_NOT_CONTENT_INDEXED was what bit be but
encryption of compression would do it).

This makes ~_A_ARCH not a good choice for testing nonwritability
of a file - so files with these new attributes just get silently ignored.

Using an explicit mask is much better.  So do that.

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

13 years agowindows: preserve lasterror prior to calling free
Rod Widdowson [Wed, 27 Oct 2010 19:08:28 +0000]
windows: preserve lasterror prior to calling free

free() destroys GetLastError, so preserve it before giving back all the
buffers.  Then if the create process failed we have something sensible to
log.

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

13 years agodon't duplicate work of ctime_s
Jeffrey Altman [Wed, 27 Oct 2010 18:25:10 +0000]
don't duplicate work of ctime_s

on windows we use ctime_s for ctim'ing to a buffer. except we
allocate an extra buffer. "uh"

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

13 years agoviced don't double-print start time
Derrick Brashear [Wed, 27 Oct 2010 18:18:28 +0000]
viced don't double-print start time

side effect: remove the version which breaks on 64 bit windows

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

13 years agoImport of code from heimdal
Heimdal Developers [Sun, 24 Oct 2010 10:56:07 +0000]
Import of code from heimdal

This commit updates the code imported from heimdal to
a3afa695ee3eb1ff5ad8de3e80c20d5049fce934 (switch-from-svn-to-git-1619-ga3afa69)

Upstream changes are:

Chas Williams (CONTRACTOR) (1):
      hcrypto: struct x64 doesn't need bitfields

Love Hornquist Astrand (1):
      Switch to ULL

Simon Wilkinson (1):
      hcrypto: Flag 64bit bit constants as long long

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

13 years agoImprove commit messages for git imports
Simon Wilkinson [Sun, 24 Oct 2010 10:50:25 +0000]
Improve commit messages for git imports

Improve the quality of the commit messages produced by git import
by adding an explicit author (obtained from the $module-author file),
and by including a list of all of the upstream changes that are being
imported.

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

13 years agodown with assert, up with osi_Assert
Derrick Brashear [Mon, 18 Oct 2010 03:39:47 +0000]
down with assert, up with osi_Assert

because NDEBUG breaks things which happen inside an assert,
be done with that. instead, call osi_Assert wherever possible.
doesn't work for code which builds before rx; those cases we handle
by ensuring no operations happen inside the assert(). side effect:
move all pthread operations wrapped in asserts to MUTEX_mumble and
CV_mumble calls where those exist, so the assertions happen all in
one set of macroes.

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

13 years agoQuickstart Guide: misc. fixes
Jason Edgecombe [Wed, 27 Oct 2010 00:32:04 +0000]
Quickstart Guide: misc. fixes

  * The update server is optional
  * Only worry about fsck when using inode-based storage
  * Add a space where needed

Change-Id: Idacd220139f2b5c622831004cb38bf5f8a1dafc5
Reviewed-on: http://gerrit.openafs.org/3164
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>

13 years agokill defunct tools directory
Derrick Brashear [Tue, 26 Oct 2010 23:10:57 +0000]
kill defunct tools directory

the "old" rpm building tools are so sad as to be useless.
put them out of their misery.

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

13 years agoWindows: 1.5.78 Change Log summary
Jeffrey Altman [Tue, 26 Oct 2010 23:02:31 +0000]
Windows: 1.5.78 Change Log summary

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

13 years agoQuickstart guide: use yum install from openafs repo
Jason Edgecombe [Tue, 26 Oct 2010 19:06:28 +0000]
Quickstart guide: use yum install from openafs repo

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

13 years agoWindows: Fix math error in rx_Writev processing
Jeffrey Altman [Tue, 26 Oct 2010 03:05:00 +0000]
Windows: Fix math error in rx_Writev processing

LICENSE MIT

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

13 years agorx: Don't let timeouts force fast recovery
Simon Wilkinson [Mon, 25 Oct 2010 09:14:12 +0000]
rx: Don't let timeouts force fast recovery

The current RX implementation goes into fast recovery whenever a
timeout occurs. This is incredibly wasteful, particularly on fast
connections. So, remove this in favour of TCP style behaviour.

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

13 years agorx: Fix starting of transmit timers
Simon Wilkinson [Mon, 25 Oct 2010 19:50:29 +0000]
rx: Fix starting of transmit timers

The code used to start the transmit timer once for every set of packets
that it sends. However, these packets might be sent individually or in
clumps, with blocking for sendmsg, and on peer->lock, between each set
of packet sends. This has the effect of, even on a very stable network,
producing a high degree of variation in RTTs and timeouts. This is a
particular issue where the connection size is larger, as the number of
packets being sent individually under the one timer grows too.

Fix this by moving timer initialisation to SendList. This already takes
the peer lock, so obtain the timeout value here too. This means that
each jumbo gram, or individual packet (where jumbograms are disabled)
is sent with its own start time, and stabilises RTTs.

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

13 years agorx: Refactor transmit queue wakeup
Simon Wilkinson [Mon, 25 Oct 2010 08:52:10 +0000]
rx: Refactor transmit queue wakeup

Refactor all of the places where we wake up the transmit queue into
a common helper function.

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

13 years agorx: Fix resend accounting
Simon Wilkinson [Mon, 25 Oct 2010 08:16:09 +0000]
rx: Fix resend accounting

rxi_Start flagged itself as 'resending' whenever it flushed the
transmit queue due to a resend event. However, it would flush the
entire transmit queue at this point, rather than only transmitting
packets that require a resend. When running with large window sizes
this results an a large number of packets erroneously being marked
as resent.

Instead, let SendXmitList decide whether a packet is being
retransmitted by using the presence of a serial number. This takes
advantage of the fact that a retransmitted packet must be the only
entry in a packet list - we just flag the packet list, instead of
having to maintain counters for each individual packet.

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

13 years agorx: Use a structure for the xmit list
Simon Wilkinson [Mon, 25 Oct 2010 08:06:53 +0000]
rx: Use a structure for the xmit list

Switch to using a structure to hold the xmit list so that it's a
little bit clearer what the rxi_SendXmitList function is actually doing

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

13 years agoWindows: move debug break in afsd_notifier
Jeffrey Altman [Tue, 26 Oct 2010 02:58:51 +0000]
Windows: move debug break in afsd_notifier

move the debug break before the cache dump occurs
so that a debugger will be signalled faster when
a panic condition occurs.

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

13 years agoFBSD: band-aid vnode locking in lookup
Ben Kaduk [Sun, 24 Oct 2010 04:29:07 +0000]
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: Ie99a677978370488f8edc7128014b89abc00a56c
Reviewed-on: http://gerrit.openafs.org/3035
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

13 years agoFix build on systems with .y.o rules
Ben Kaduk [Tue, 26 Oct 2010 02:15:49 +0000]
Fix build on systems with .y.o rules

On systems with system .y.o rules (such as FreeBSD), the system
rule for making error_table.o from error_table.y can bypass
AFS_CCRULE and thus fail to pull in the necessary include paths
for compilation.  Present an explicit dependency on error_table.c
to force that file to be generated, and then our .c.o rule gets
used as desired.

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

13 years agoComplete change from dcb40c9fb8 for FBSD
Ben Kaduk [Tue, 26 Oct 2010 04:17:11 +0000]
Complete change from dcb40c9fb8 for FBSD

Many conditionals involving osi_fsplock were changed to depend
on AFS_PRIVATE_OSI_ALLOCSPACES instead of constants or other
things (like AFS_FBSD_ENV).  The condition on the initializaion
in afs_init was changed but not the declaration in afs_prototypes.h,
breaking the build on FBSD.
Use the same conditional in afs_prototypes.h, fixing the FBSD build.

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

13 years agoWindows: Add version number to event log start pending message
Jeffrey Altman [Sun, 24 Oct 2010 04:21:26 +0000]
Windows: Add version number to event log start pending message

LICENSE MIT

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

13 years agoWindows: register idle dead timeout error
Jeffrey Altman [Mon, 14 Jun 2010 13:43:31 +0000]
Windows: register idle dead timeout error

be like the unix cache manager and set an error code
so idle dead time is enforced on sending.

LICENSE MIT

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

13 years agoWindows: Backup and restore configuration across installs
Asanka C. Herath [Mon, 18 Oct 2010 08:52:34 +0000]
Windows: Backup and restore configuration across installs

The MSI installer for OpenAFS does not preserve configuration data
across installs.  This patch creates a backup of specific
configuration registry values when uninstalling OpenAFS and uses this
backup when subsequently installing OpenAFS.

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

13 years agoWindows: Make Rx PMTU discovery configurable; disable by default
Jeffrey Altman [Sat, 23 Oct 2010 19:45:36 +0000]
Windows: Make Rx PMTU discovery configurable; disable by default

Disable PMTU discovery by default.  Permit it to be enabled
with the RxPMTUDiscovery TransarcAFSDaemon\Parameter value.

LICENSE MIT

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

13 years agorx: Tidy up variables in RTT calc
Simon Wilkinson [Sat, 23 Oct 2010 14:07:42 +0000]
rx: Tidy up variables in RTT calc

We used to do rttp = &thisRtt, and then use rttp and thisRtt to
interchangably refer to the same data. This is just confusing, and
unnecessary. Replace all of the occurences of rttp with &thisRtt.

Take the opportunity to use the Clock_IsZero macro rather than doing
an explicit zero clock check.

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

13 years agorx: Fix bracing on rx_clock macro arguments
Simon Wilkinson [Sat, 23 Oct 2010 14:16:17 +0000]
rx: Fix bracing on rx_clock macro arguments

Add brackets around the arguments in the clock helper macros, so that
these can be called with more complex parameters.

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

13 years agorx: More improvments to RTT calculation
Simon Wilkinson [Sat, 23 Oct 2010 13:51:56 +0000]
rx: More improvments to RTT calculation

Move the decision about whether a packet contributes to the peer's
rount trip time into the CalculateRoundTripTime function, and improve
the criteria used.

Previously, we only computed the RTT if we had not retransmitted. This
is bad, because it means that places where we have backed off in order
to retransmit never actually lengthen the RTT, and so the RTT is kept
artificially low, and we see a large number of retransmits. Instead,
use the serial of the ACK packet to determine which transmission is
being acknowledged, and if it is the first, or the last, transmission
use the appropriate sent time to calculate the RTT.

If we have no serial in the ACK (for a delayed ack, for example), or
if the serial doesn't match (where a single acknowledgement is soft
acking a number of packets), fall back to only using the ack if the
packet has not be retransmitted.

Also, avoid multiple counting of packets which have arrived as part
of a jumbogram by only permitting the last packet in a jumbogram to
contribute to the RTT. This avoids giving the RTT of jumbograms more
weight than those of normal packets - doing so would pull down the
RTT, as it in effect favours packets which have not be retransmitted.

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

13 years agoRx: Treat rx_minPeerTimeout not as a minimum but as padding
Jeffrey Altman [Thu, 21 Oct 2010 18:13:03 +0000]
Rx: Treat rx_minPeerTimeout not as a minimum but as padding

An improved RTT and timeout calculation algorithm is being
developed but until we have it, treat rx_minPeerTimeout not as
a minimum value for the timeout but as padding to be added to
the measured RTT when computing the peer timeout value.

With this change rx does not begin to send large numbers of
resends when the RTT begins to exceed the rx_minPeerTimeout
value.  Timeout triggered resends at the moment can force rx
into fast recovery mode which in turn kills performance.  It
is better to avoid that problem for now.

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

13 years agoRx: Fix socket() handling so errors are properly detected
Jeffrey Altman [Thu, 21 Oct 2010 18:23:18 +0000]
Rx: Fix socket() handling so errors are properly detected

socket() returns an osi_socket which on Windows is an
unsigned type (HANDLE).  Therefore, tests of osi_socket < 0
will never identify when the INVALID_SOCKET value is returned.
On Windows, the OSI_NULLSOCKET is assigned to INVALID_SOCKET.
Replace all comparisons of (osi_socket < 0) with
(osi_socket == OSI_NULLSOCKET) as a means of detecting errors.

In addition, do not pass socket() the protocol value 0 when
IPPROTO_UDP is what is desired.

Finally, perror() on Windows never reports any error from Winsock.
perror() is a CRT function.  To get the real socket error
WSAGetLastError() must be called and its value be written to
stderr.

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

13 years agolinux fh_to_dentry can return err
Charles Hannum [Fri, 22 Oct 2010 18:50:56 +0000]
linux fh_to_dentry can return err

handle e.g. ESTALE from  fh_to_dentry (in this case via
d_obtain_alias and fat_fh_to_dentry) so we print a meaningful
error when we lose.

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