Andrew Deason [Mon, 7 Mar 2011 17:08:26 +0000]
RX: Avoid timing out non-kernel busy channels
When we encounter a "busy" call channel (indicated by receiving
RX_PACKET_TYPE_BUSY packets), we can error out a call with
RX_CALL_TIMEOUT to try and get the application code to retry the call.
However, many RX applications are not aware of this, and will just
fail with an error upon receiving a single busy packet.
So instead, make this behavior optional, and only do it if the
application tells us what specific error it expects to receive when a
busy call channel is detected. Enable this behavior for the Unix cache
manager, as it can cope with receiving an RX_CALL_TIMEOUT error in
this scenario.
(cherry picked from commit
eddcee3ad518dff9fbfda790640c5bfd2e97ef5a)
Reviewed-on: http://gerrit.openafs.org/4159
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: I3938e79ab009f14f5421a4a45e2a099276c49f24
Reviewed-on: http://gerrit.openafs.org/6611
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Thu, 12 Jan 2012 21:48:54 +0000]
libafs: add replicated connection pool
keep pool of connections to use for replicated volumes,
so we can have a separate idle time setting
(cherry picked from commit
cd1f72649650404581cfcdcf3beeeaf2bb960bd6)
Reviewed-on: http://gerrit.openafs.org/6546
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Change-Id: I056ba28d11313c9925df63869e0c55a1a4f132da
Reviewed-on: http://gerrit.openafs.org/6610
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Fri, 13 Jan 2012 18:43:16 +0000]
vol: remove SYNC fatal_error processing
Currently SYNC clients will "disable" themselves on certain error
patterns. For example, if the server end closes its file descriptor
too many times, or takes too long and then closes the fd, the SYNC
client will return an error and set fatal_error. On any subsequent
SYNC requests, the request will immediately fail without contacting
the server, often making SYNC client programs effectively useless
until they are restarted.
There isn't really any reason to cause future requests to fail.
Transient problems in the fileserver can easily make this situation
possible (e.g. a fileserver can crash but still take several minutes
to close the SYNC fd while the core is written to disk), and so while
we may return an error for a specific problematic request, future
requests may be fine.
So, just remove everything related to fatal_error, so future SYNC
requests can continue to be attempted. Adjust some log messages to
reflect the new behavior.
Reviewed-on: http://gerrit.openafs.org/6548
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
40bf6dee2409197f7494c3d09bf2dea7c248d185)
Change-Id: I0f7a1792afd1ace3beabe238107d0a5069ccbb44
Reviewed-on: http://gerrit.openafs.org/6609
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Marc Dionne [Wed, 18 Jan 2012 01:19:54 +0000]
rx: Correctly test for end of call queue
The intention of this condition is to check if the current call
being considered is the last one on the queue, but the test is
incorrect. A null next pointer indicates a removed item, not
the end of the queue.
Use the queue_IsLast macro instead to correctly determine that
this is the last item in the queue and that a call has to be
selected, either the current one or a previously seen good choice.
This can cause calls to get permanently stuck in the call queue
and never get assigned to a thread, even when all threads are
idle.
Reviewed-on: http://gerrit.openafs.org/6564
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
6ad3d646e62801cb81a3c9efeac320daa44936e1)
Change-Id: Ic9d0ff51c79115960ebb4634fc35a5e9da21c380
Reviewed-on: http://gerrit.openafs.org/6570
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Marc Dionne [Wed, 18 Jan 2012 15:25:03 +0000]
Linux: use standard macro for set_nlink configure test
A generic macro exists to test for functions in the kernel, use
it for set_nlink.
Reviewed-on: http://gerrit.openafs.org/6566
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
64bd0b728ca95ba7bb4f1fdd909386fde3ce81e1)
Change-Id: I93d169bec8f476d5e692f7f5a7fe31002af7ce1e
Reviewed-on: http://gerrit.openafs.org/6569
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 11 Jan 2012 15:00:35 +0000]
vol: Fix VCreateVolume special inode cleanup
In order to dec the relevant special inodes, we need to know the
parent vol id in addition to the vol id itself. Use the appropriate
volume IDs when IH_DEC'ing special inodes after we fail to create the
volume, so we don't leave behind special inodes.
(cherry picked from commit
627cfb1d4e7b32b4342c59b162a36ba9beb8a066)
Reviewed-on: http://gerrit.openafs.org/6529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Change-Id: I9f40f170cd6a0fffe2e17fc199af99e087066902
Reviewed-on: http://gerrit.openafs.org/6550
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 11 Jan 2012 15:28:56 +0000]
DAFS: Fix SYNC_FAILED VScheduleSalvage_r log
SYNC_FAILED is not an unknown protocol code, so stop saying it is.
Reviewed-on: http://gerrit.openafs.org/6530
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
fda2fe8538e00baddcd7fcf2c669162634b9d14e)
Change-Id: Ibd70b9f95031baf4955d503d7eb8b5f3a50febf7
Reviewed-on: http://gerrit.openafs.org/6549
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Fri, 6 Jan 2012 11:53:46 +0000]
rx: add and export a public keepalive toggle
make enabling and disabling keepalives a public function.
export the function
(cherry picked from commit
2a31f35936698c504c863702ebb675ac9dfe47e1)
Reviewed-on: http://gerrit.openafs.org/6517
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Change-Id: If7bd2b72980dd92771614a6d73a04441222a8314
Reviewed-on: http://gerrit.openafs.org/6522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Fri, 6 Jan 2012 11:33:22 +0000]
afs: put back conn if not using in checkserver loop
we get a conn, check it for eligibility, and if not,
just abandon it. "oops"
(cherry picked from commit
26fc0cda94c24a1c5f0bef109bca920456c25265)
Change-Id: I8e4f762b5170f07d6abc3508e88f001ca147c3a7
Reviewed-on: http://gerrit.openafs.org/6521
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Sun, 8 Jan 2012 16:31:39 +0000]
Make libjafs buildable again
libjafs is surprisingly close to being buildable. Fix a few misc
things which have bitrotted over the years so it is possible to
actually build:
- Add -I$SRC/config to the cflags, so we can include afsconfig.h
- Remove references to the nonexistant rxkstats.o
- Do not link with UAFS' AFS_component_version_number.o, since this
gives us duplicate version number symbols
- Include afs_vosAdmin.h in Group.c, to satisfy some missing symbols
Reviewed-on: http://gerrit.openafs.org/6524
Reviewed-by: Steven Jenkins <steven@synaptian.com>
Tested-by: Steven Jenkins <steven@synaptian.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
967d7201ee5c27db6d75d5efafcad9458e2b5167)
Change-Id: I0cb510e3f115c2c35f06cf9cbddaf31835704eea
Reviewed-on: http://gerrit.openafs.org/6527
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Marc Dionne [Fri, 6 Jan 2012 22:22:35 +0000]
libuafs: only rebuild h directory when needed
A few changes to allow a "make all ; sudo make install ; make all..."
workflow to work without manually removing files in between.
Make the rebuilding of the h directory dependent on the source
files scanned to build it. This prevents it from being rebuilt
for every "make install".
While we're here, use -f when removing linktest for the clean target.
This allows "make clean" to remove it without prompting when the user
doesn't have write access to the file, as is the case when make install
rebuilds it as root.
Reviewed-on: http://gerrit.openafs.org/6519
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
2caf0778ddeb6eeb854360cac20c6b3f0894f3eb)
Change-Id: Id4ccad953669538072b834a6aa49b8beaeeeed35
Reviewed-on: http://gerrit.openafs.org/6526
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Wed, 4 Jan 2012 20:04:41 +0000]
afs: discard cached state when we are unsure of validity
in the event we got a network error, we don't know if the server
completed (or will complete) our operation. we can assume nothing.
a more complicated version of this could attempt to verify that the
state is what we expect it to be, but in extended callbacks universe
this is potentially easier to solve anyway. for now, return the
error to the caller, and mark the vcache unstat'd.
(cherry picked from commit
c2fc7e0f66621fc97f5b4dc389d379260638315c)
Change-Id: Ic38cf16e47664e6f36ad614735b42d3f4e5a6ce2
Reviewed-on: http://gerrit.openafs.org/6520
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Fri, 18 Nov 2011 16:25:08 +0000]
DAFS: Atomically re-hash vnode in VGetFreeVnode_r
VGetFreeVnode_r pulls a vnode off of the vnode LRU, and removes the
vnode from the vnode hash table. In DAFS, we may drop the volume glock
immediately afterwards in order to close the ihandle for the old vnode
structure.
While we have the glock dropped, another thread may try to
VLookupVnode for the new vnode we are creating, find that it is not
hashed, and call VGetFreeVnode_r itself. This can result in two
threads having two separate copies of the same vnode, which bypasses
any mutual exclusion ensured by per-vnode locks, since they will lock
their own version of the vnode. This can result in a variety of
different problems where two threads try to write to the same vnode at
the same time. One example is calling CopyOnWrite on the same file in
parallel, which can cause link undercounts, writes to the wrong vnode
tag, and other CoW-related errors.
To prevent all this, make VGetFreeVnode_r atomically remove the old
vnode structure from the relevant hashes, and add it to the new hashes
before dropping the glock. This ensures that any other thread trying
to load the same vnode will see the new vnode in the hash table,
though it will not yet be valid until the vnode is loaded.
Note that this only solves this race for DAFS. For non-DAFS, the vol
glock is held over the ihandle close, so this race does not exist.
The comments around the callers of VGetFreeVnode_r indicate that
similar extant races exist here for non-DAFS, but they are unsolvable
without significant DAFS-like changes to the vnode package.
Reviewed-on: http://gerrit.openafs.org/6385
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
8e15e16c9e6a5768f31976cc21b48d5bb10617b7)
Change-Id: I915d18c4252b698f39fdf65793311a39381096b4
Reviewed-on: http://gerrit.openafs.org/6495
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Tue, 27 Dec 2011 02:22:08 +0000]
afs: Grab a reference to setp in afs_icl_Event4
We can drop GLOCK in several places in afs_icl_Event4 and the
afs_icl_AppendRecord callee. To ensure that the given afs_icl_set does
not get freed while we have GLOCK dropped, grab a reference to the
set.
Thanks to Ryan C. Underwood for reporting an issue triggered by this.
Reviewed-on: http://gerrit.openafs.org/6431
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
7461fa11939556d3b6f3ea38da7ff65607805579)
Change-Id: I7a33cf96d2031dd1798f7598918396eb8fbde611
Reviewed-on: http://gerrit.openafs.org/6494
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Michael Meffie [Fri, 12 Aug 2011 18:29:48 +0000]
xstat: cm xstat time values are 32 bit
The kernel space cm xstat time structures are implemented as 32
bit values in memory and on the wire. Define the client side
xstat userspace structures as 32 bit time values as well to avoid
size mismatches on systems with native 64 bit time values.
Reviewed-on: http://gerrit.openafs.org/5237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
130144850c6d05bc69e06257a5d7219eb98697d8)
Change-Id: I8726efdd7123e9a1e0e4536bf2766c441964475d
Reviewed-on: http://gerrit.openafs.org/6386
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Tue, 3 Jan 2012 20:57:14 +0000]
afs: increase idledead time
it's actually important this be more than the rx call dead time
so timing out server callbacks to clients don't result in us idle deading
a call to the server when callbacks need to be broken
FIXES 130327
Reviewed-on: http://gerrit.openafs.org/6497
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
0f4da13137612a9b0c0c3b57aa939d6661fb67f8)
Change-Id: I181d89c36175be93ed59226b401d48903fb5f584
Reviewed-on: http://gerrit.openafs.org/6518
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Geoffrey Thomas [Sun, 1 Jan 2012 00:51:29 +0000]
linux: fsync on a directory should return 0, not EINVAL
Directory writes are synchronous, so this is fine. There's a
mostly-convenient function in fs/libfs.c that returns 0 that we can use
to do what we want ("mostly" because it was renamed in 2.6.35).
FIXES 130425
Reviewed-on: http://gerrit.openafs.org/6491
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
267934d0e6910c8d8166a6e78f93c1bab40857b8)
Change-Id: Iaeb8a699673b6144c186b470f6d877fb54f1e319
Reviewed-on: http://gerrit.openafs.org/6493
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Geoffrey Thomas [Sun, 11 Dec 2011 10:06:24 +0000]
rpm: Don't attempt to restart on upgrade when using systemd
systemd is actually rather capable of leaving the OpenAFS client in an
incredibly broken state, thanks to its willingness to track services and
kill their processes. We should not attempt to restart the client on
upgrade, whether a normal upgrade or a migration from SysV initscripts.
In the former case, it's fine (and correct) for the old AFS to keep
running; in the latter case, the unit file is capable of correctly
shutting down an initscript-launched client. The same is true for the
OpenAFS server.
This brings the packaging in line with the SysV initscript code in the
specfile, which does not attempt to restart the service, as well as with
e.g. Debian's packaging, which uses --no-restart-on-upgrade.
While we're here, clean up a redundant BuildRequires on systemd-units.
Reviewed-on: http://gerrit.openafs.org/6247
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
dee93ff1d114da711df345e06b5e1a682c877315)
Change-Id: I4ecf3b2f307a81549e0bd568ab5e4585a2ef1f2d
Reviewed-on: http://gerrit.openafs.org/6492
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Thu, 9 Jun 2011 03:50:27 +0000]
libafs: memset dirHeader->hashTable
Clear dirHeader->hashTable via memset instead of via a loop. This is
more efficient, and avoids the loop getting optimized into an unusable
_memset call on recent versions of Solaris Studio when building for
the kernel.
Thanks to Jeff Blaine for reporting the issue with Solaris Studio.
Reviewed-on: http://gerrit.openafs.org/4829
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
f091ace32e3045da396d577055dafd67888ff7ea)
Change-Id: Ia098730c3e83429ce4f886b1427159d13eff4c4e
Reviewed-on: http://gerrit.openafs.org/6414
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Mon, 19 Dec 2011 22:11:31 +0000]
Include afsconfig.h before anything else
afsconfig.h can define various preprocessor symbols that can affect
how system headers behave. For example, the presence of the
_POSIX_PTHREAD_SEMANTICS symbol changes the number of arguments to
getpwnam_r on at least Solaris 8. So, we must include afsconfig.h
before including anything else, to ensure consistency.
FIXES 130413
Reviewed-on: http://gerrit.openafs.org/6387
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit
37f537a21db6d560dd16a53ff5e0d2f0456d4c48)
Change-Id: I64970fd06af9a13d91acaf03b80a2baf224754ff
Reviewed-on: http://gerrit.openafs.org/6388
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Andrew Deason [Sun, 18 Dec 2011 21:20:42 +0000]
aklog: Add replacement setenv/unsetenv
aklog makes use of the setenv and unsetenv functions, which do not
exist (at least) on HP-UX earlier than around 11i v3, and do not exist
on Solaris earlier than Solaris 10. Add replacement functions for
setenv and unsetenv when they are not present. Note that these
implementations are copied from libroken, and setenv was modified to
not use asprintf.
This is 1.6-specific. On the master branch, libroken takes care of
these for us. On the master branch, setenv and unsetenv from libroken
were added in
70e8451acd0426024c152073e53bc6606e0189e1.
Change-Id: I35546f1add7f4f87c6ffc484059057825887499f
Reviewed-on: http://gerrit.openafs.org/6376
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Fri, 4 Nov 2011 20:29:17 +0000]
make openafs 1.6.1pre1
prerelease for 1.6.1
Change-Id: Ia54b5c304791ebfc33b7043af9ea3688442e4b81
Reviewed-on: http://gerrit.openafs.org/5809
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 14 Dec 2011 20:42:08 +0000]
afs: Clear VHardMount on ResetVolumeInfo
afs_Analyze sets VHardMount on a volume struct when a hard-mount
scenario is encountered, and clears it after sleeping. However, if the
volume struct has VRecheck set, or if it's not in memory, afs_Analyze
cannot retrieve the volume struct in order to clear VHardMount again.
For the VRecheck case, this can results in VHardMount never getting
cleared, and so hard-mount messages for the volume seem to disappear.
So, clear VHardMount when we set VRecheck so this does not occur.
For the case where the volume struct is not in memory, this is not a
problem, since when we allocate a volume struct again, the VHardMount
state will not be retained.
Reviewed-on: http://gerrit.openafs.org/6335
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
f469be407789e696c0b9e9a431b4879798a00e2a)
Change-Id: If13769445f20336dfba9755f3af0a1499ce16a6d
Reviewed-on: http://gerrit.openafs.org/6348
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 20 Jul 2011 21:50:52 +0000]
libafs: Rate-limit hard-mount waiting messages
Limit how often we log "hard-mount waiting for XXX" messages. Without
this, it is possible for a client with hard-mounts enabled to spam the
kernel log rather excessively (in extreme cases this can even panic
the machine on at least some Linux).
To keep things simple, just log approximately one message per volume
per hard-mount interval.
Reviewed-on: http://gerrit.openafs.org/5060
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
530b5ecac51cc7ce61ccddd50868c632c4a47298)
Change-Id: I566aa3d411ff100ccc6afa9a5273fb84e6172dd0
Reviewed-on: http://gerrit.openafs.org/6347
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 20 Jul 2011 20:33:41 +0000]
libafs: Remove unused volume "states" flags
VResort and VMoreReps are not referenced anywhere in the tree, so
remove their definitions.
Reviewed-on: http://gerrit.openafs.org/5059
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
6cae7c554e917a26b197167e177bd3eb22bce71a)
Change-Id: I0a282dac3a9e31bff4ff37c61275cc7c08456cad
Reviewed-on: http://gerrit.openafs.org/6346
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 4 May 2011 17:34:20 +0000]
libafs: Avoid using changing unixuser ticket data
PSetTokens was afs_osi_Alloc'ing after afs_osi_Free'ing the previous
token data. This can sleep, causing tu->stp to be pointing to garbage
while we wait to alloc. Additionally, rxkad_NewClientSecurityObject
can sleep while waiting to alloc memory, and so the given tu->stp
pointer given to it by afs_ConnBySA may be invalid by the time it
actually uses the data.
To fix this, we could implement unixuser locking to ensure mutual
exclusion of these events. However, this implements a more
conservative change for the 1.4 and 1.6 branches. In PSetTokens we
alloc the new memory before we change anything, and in afs_ConnBySA we
make copies of the ticket data before giving it to rxkad. With these
changes, the glock gives us enough serialization to avoid issues with
tu->stp changing underneath us.
This change is specific to 1.4 and 1.6. On the master branch, this
issue is fixed by implementing unixuser locks in change
Idd66d72f716b7e7dc08faa31ae43e9a23639bae3.
Reviewed-on: http://gerrit.openafs.org/4649
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
1465946bb6863430bf0efebd024d394549a8775f)
Change-Id: Icab5176bf685c408447f0f32ad65c5b003299d3d
Reviewed-on: http://gerrit.openafs.org/6345
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Mon, 25 Apr 2011 18:58:34 +0000]
pam: Fix password torching const-ness
In some code branches, the PAM code "torches" a password by zeroing
it. However, it does this through a const pointer which we otherwise
know is not actually const. Make sure we get better type checking by
doing this through a non-const pointer.
Reviewed-on: http://gerrit.openafs.org/4554
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
5cd4282758317b24d2f63408ab4c62551bbebc03)
Change-Id: I94b22a31884dc9b184ec094e5cca4b6b0098cb15
Reviewed-on: http://gerrit.openafs.org/6295
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Marc Dionne [Sat, 16 Apr 2011 15:22:54 +0000]
pam: Clear up PAM_CONST related warnings on Linux
Commit
78d1f8d8 expanded the use of PAM_CONST and introduced many
new warnings on Linux where pam expects "const" arguments.
This clears up the warnings by doing the following:
- Cast "user" to char * when kalling ka* functions
- Change the signature of pam_afs_prompt and pam_afs_printf to use
PAM_CONST
- Use a separate non-const password pointer for pam_afs_prompt
Reviewed-on: http://gerrit.openafs.org/4487
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
3ea39166d64d2e66cddef015734c2f91548423af)
Change-Id: I16179a1c8b9d0e53c90b54733d1c5130f1d23153
Reviewed-on: http://gerrit.openafs.org/6293
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Stephan Wiesand [Sun, 17 Apr 2011 22:37:36 +0000]
make afsdump_scan get ACLs right
This makes afsdump_scan get the ACLs right on little endian systems.
It also corrects and slightly beautifies some output (indentation,
cut&paste error for negative ACL label).
Reviewed-on: http://gerrit.openafs.org/4494
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
1105d63ddf5a32b9381ff47e8101c3f141366fa6)
Change-Id: Iec0fa5bc9673bdce616611f422d74e55b0aa90f1
Reviewed-on: http://gerrit.openafs.org/6292
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Mon, 19 Sep 2011 15:05:59 +0000]
ntohs ubik header size
The 'size' field in the ubik header is only 16-bits wide, so we should
be using ntohs to read it, not ntohl. The database checking utilities
for the prdb and kadb were still using ntohl (vldb was fixed by
591f9b6de9ab3dc5c17ad41af0241527f7f04b31).
Reviewed-on: http://gerrit.openafs.org/5466
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
e69714739f64475d71633fd4cb3523bc1ae143bb)
Change-Id: Id4f677cddcedba3008d349bcf9740168129f8496
Reviewed-on: http://gerrit.openafs.org/6314
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Michael Meffie [Fri, 16 Sep 2011 15:23:18 +0000]
solaris: libafs depends on fs/ufs
The solaris afs module depends on symbols exported by fs/ufs.
Set this dependency in the afs module so the kernel loader
will automatically load the fs/ufs driver if is not already
loaded, such on zfs only systems.
Reviewed-on: http://gerrit.openafs.org/5456
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
0cb10104f5af73614e6b7673d3711ddbc3f3a866)
Change-Id: Ifcb5e2725bbd2de44218109aac9c20439dadf41e
Reviewed-on: http://gerrit.openafs.org/6315
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Tue, 13 Dec 2011 17:19:48 +0000]
vos: fix code to not triple-negate
!!! is !. just write it that way.
Reviewed-on: http://gerrit.openafs.org/6252
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
44045af35a6ae44880655115685e0755d6a0c828)
Change-Id: I646387f30c178ad512decd507925408183f83894
Reviewed-on: http://gerrit.openafs.org/6329
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Michael Meffie [Tue, 22 Nov 2011 00:12:56 +0000]
vol: log error reason on header read failure
Log the error reason instead of just VSALVAGE when
ReadHeader() fails.
Reviewed-on: http://gerrit.openafs.org/6108
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
0d0a8288c1cdd05bbf5717ac45638cf6760ee7a8)
Change-Id: Ie49c9ee3ea23873f8d71c80fda45b763bcd8e466
Reviewed-on: http://gerrit.openafs.org/6328
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Wed, 14 Dec 2011 04:49:38 +0000]
libafs: disable mtu discovery
we need to rework this to use lack of soft acks instead of this
method, which is too fragile
Reviewed-on: http://gerrit.openafs.org/6256
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
4d76b19b600aad461ee1231eeadb9b7a27b7f117)
Change-Id: Iba3f3d9d475959f99759db9e81c05c300aa6cd02
Reviewed-on: http://gerrit.openafs.org/6327
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Wed, 14 Dec 2011 04:20:01 +0000]
libafs: only do pings for default conn with root uid
instead of doing it for potentially every unauth user, just do it for
root.
Reviewed-on: http://gerrit.openafs.org/6255
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
78885611ac8aa6602a4a1f42379c9d78ef226100)
Change-Id: Id54f6608b8807289242d094f48e394f0341782da
Reviewed-on: http://gerrit.openafs.org/6326
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Fri, 2 Dec 2011 20:36:59 +0000]
salvager: Create link table with volume group id
The link table needs to be created with the VG id or RW vol id, not
the non-RW vol id. Unlike other special inodes, this goes for both the
'parent' and 'volume' volume ids, not just the 'parent' id, since
there is only one link table per VG.
Without this, the salvager can generate invalid linktable special
inodes if it encounters a VG with no inodes for the RW vol.
Reviewed-on: http://gerrit.openafs.org/6179
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
ae227049fca2519e1f5ae1e8b68efbff10ebb665)
Change-Id: Ia8089cae6cb5ab97ef9d4ea306f3c48bead59914
Reviewed-on: http://gerrit.openafs.org/6325
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 30 Nov 2011 23:41:53 +0000]
DAFS: Ensure logging on attach2 errors
The attach2 error path transitions a volume to VOL_STATE_ERROR, in
case whatever got us to that error path did not already put the volume
in an appropriate state. Log when we do this, to make sure we do not
end up with a volume in VOL_STATE_ERROR state silently.
Reviewed-on: http://gerrit.openafs.org/6168
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
53230846a202a50f6c3a61b38d62ccba8876f89d)
Change-Id: I4dbe5c6f8be8820620e7a68c7f42b426211dbb82
Reviewed-on: http://gerrit.openafs.org/6324
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 30 Nov 2011 23:35:56 +0000]
DAFS: Avoid unnecessary preattach on FSYNC_VOL_ON
FSYNC_VOL_ON/FSYNC_VOL_ATTACH can be called to "online" a volume that
was actually kept online for the duration of the volume operation.
Avoid calling VPreAttachVolumeByVp_r for such a volume if it's already
attached, in order to avoid an unnecessary log message and to save a
tiny bit of processing.
Reviewed-on: http://gerrit.openafs.org/6167
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
d5d2d00a47cf53054bd18d7404be26bea34cba6f)
Change-Id: I2a7f4b214176570e787978dbe0aa2eb8dc57730f
Reviewed-on: http://gerrit.openafs.org/6323
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 30 Nov 2011 23:21:32 +0000]
DAFS: Log more for VPreAttachVolumeByVp odd states
When we encounter "odd" states in VPreAttachVolumeByVp_r, say what the
actual state we encountered was, along with the attach flags, so we
have a better idea of what's going on.
Reviewed-on: http://gerrit.openafs.org/6166
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
4fd8347e842af61681c1718e456500b92c5b6ea9)
Change-Id: If1c6fdba7b097a4bfb9e8e3e972ee56dee43bf2d
Reviewed-on: http://gerrit.openafs.org/6322
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 30 Nov 2011 23:08:57 +0000]
DAFS: Ensure GetVolume errors on ERROR volumes
In GetVolume, after we call VAttachVolumeByVp_r, there is no explicit
check to see if vp is in VOL_STATE_ERROR state. Make sure we don't try
to use such a volume, or blindly transition the volume away from that
state.
Reviewed-on: http://gerrit.openafs.org/6165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
f59312c0aee1a5376b29262efc6e6ea71264305a)
Change-Id: Ibdd5cb5c475409918cdad1e73e2d7ed4ef57bd13
Reviewed-on: http://gerrit.openafs.org/6321
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 30 Nov 2011 20:36:06 +0000]
DAFS: Do not transition to ERROR on trivial errors
attach2 can result in many different errors; some indicate that the
volume is in an inconsistent state, but many others just indicate that
the volume cannot be attached for benign reasons (such as VNOVOL if
the volume doesn't exist, or VOFFLINE if the volume is being used by a
volume utility). Currently, for DAFS, attach2 transitions the relevant
volume to the VOL_STATE_ERROR state for almost all errors encountered,
even the benign ones. Instead, skip the error state transition for
error handling paths that do not reflect a "broken" volume.
Reviewed-on: http://gerrit.openafs.org/6164
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
5fc2365f5dff7f193781093ecb886b4c7391d5a3)
Change-Id: Ia3d732781c98fcda4db7b41cd744db860781594f
Reviewed-on: http://gerrit.openafs.org/6320
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Thu, 1 Dec 2011 17:20:41 +0000]
SOLARIS: Define BSD_COMP for non-UKERNEL on 5.11
We were defining BSD_COMP twice for UKERNEL. Move one of the #define's
up to the !UKERNEL section.
Reviewed-on: http://gerrit.openafs.org/6162
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
0ee7fcc0a49494ad66778012b7808f80ee3af8d3)
Change-Id: I683e1be2141c0cecac3f60ac4928d3e84a96bef8
Reviewed-on: http://gerrit.openafs.org/6319
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Tue, 15 Nov 2011 17:53:12 +0000]
vlserver: Avoid atoi for vol ids
Reviewed-on: http://gerrit.openafs.org/6050
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit
d113c0eb8ac4717cafd7747a78c5aa3b649b8e68)
Change-Id: If965a7442262048048be9eca3e643c01d7b5c277
Reviewed-on: http://gerrit.openafs.org/6318
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Marc Dionne [Sat, 22 Oct 2011 13:32:33 +0000]
cache bypass: don't define iovecp for UKERNEL
iovecp is defined but not used for UKERNEL. Define it conditionally
to avoid gcc warnings and --enable-checking failure.
Reviewed-on: http://gerrit.openafs.org/5650
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
547d94edd3affb5f377cd1b3db39c46ca0cf5aec)
Change-Id: I700b82173b5c2435a716aaf10541e1583f2655f5
Reviewed-on: http://gerrit.openafs.org/6316
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Thu, 15 Sep 2011 17:48:31 +0000]
rx: arrange for Finalize to really stop running calls
previously rxi_ServerProc would happily error a call once
rx_tranquil was set, but keep calling ExecuteRequest.
Reorder code so kernel shutdown attempts are processed first;
then arrange if we are tranquil to not process the call further.
Issue discovered by Chaskiel Grundman.
Reviewed-on: http://gerrit.openafs.org/5447
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
6196abf3c864f8cc6ab1efc6e5625a5cc68158bd)
Change-Id: I00fad117ee8386fc29cd2423aa9fb7d89af55160
Reviewed-on: http://gerrit.openafs.org/6313
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Todd Lewis [Sun, 11 Sep 2011 11:42:47 +0000]
RPM: Fix dkms support on Fedora 15
Newer dkms no longer uses or supplies a $kernelver_array variable;
instead it uses $kernelver. The attached patch uses both, one of
which will be empty, so the test will do the Right Thing regardless
of your dkms version.
Further, the "mv" command at the end of the MAKE[0]= line needs
lots of back-slashes on each of its parms. We need three to make it
all the way to the final dkms.conf file -- so that's six -- plus one
more to escape the '$'; that's seven in all.
In case there's any question (and with all the back-slashes involved,
there should be) about the intent here, the whole point of this
patch is to make the final dkms.conf MAKE[0]= line look like this
(module line breaks:
MAKE[0]="KMODNAME=openafs.ko; DSTKMOD=\".\"; [ \"\`echo
\"${kernelver_array[0]}${kernelver[0]}\" | sed -e
's/^\([0-9]*\.[0-9]*\)\..*/\1/'\`\" = \"2.4\" ] && KMODNAME=\"libafs-*\"
&& DSTKMOD=openafs.o; ./configure
--with-linux-kernel-headers=${kernel_source_dir}
--with-linux-kernel-packaging; make; mv src/libafs/MODLOAD-*/\\\$KMODNAME
\\\$DSTKMOD"
This is what was required to get "dkms build ..." to work on Fedora 15,
and as near as I can tell it shouldn't break 2.4 or other builds.
FIXES 130211
Reviewed-on: http://gerrit.openafs.org/5393
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
8e0aaae076f4cccfd2d6ed81ede4e355235b578e)
Change-Id: I47b0e24a0cbbd8402d5dd902e7e2af59ca1c30b7
Reviewed-on: http://gerrit.openafs.org/6312
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Fri, 2 Sep 2011 17:35:24 +0000]
aklog: strlen(NULL) doesn't work
strlen(filepath) when !filepath isnt going to work very well. i believe
this to be the intent of the author of the original patch.
Reviewed-on: http://gerrit.openafs.org/5328
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
c3e82ee98bf66058636f11d7a98d3bebe3bac955)
Change-Id: I89911d2da314059db633c00c69c9c9ec2050bb86
Reviewed-on: http://gerrit.openafs.org/6311
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Mon, 29 Aug 2011 18:07:01 +0000]
ihandle: OPEN fdPs are not counted in ihP refcount
Just add a comment explaining that an OPEN FdHandle_t does not count
against the ref count for its parent IHandle_t. Recently I've seen
some confusion about this when discussing ihandle internals, and this
should make this abundantly clear.
Reviewed-on: http://gerrit.openafs.org/5317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
0f4dfaed6b25ae4282298cc2ba4908ce9f36f043)
Change-Id: Icd0d5b368ccc679967e14b2460f47c814598c797
Reviewed-on: http://gerrit.openafs.org/6310
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Tue, 23 Aug 2011 04:20:37 +0000]
xserver lock order violation
individual volume locks are pretty far down, well after afs_xserver.
afs_SetupVolume (with tv->lock)-> InstallUVolumeEntry-> afs_GetServer.
Install*Volume is careful to protect against recursing into the volume
lock via ResetVolumeInfo. Unfortunately, GetServer acquires xserver,
and then if it needs to call GetCapabilities, it drops and reacquires
xserver.
turns out the volume locks weren't protecting much. they also aren't
grabbed before xvolume is dropped. fine, so, restructure to do all the
work, then merge the result.
Reviewed-on: http://gerrit.openafs.org/5303
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
16dff61e148ce6893a68dda6e05e84f96fa753ac)
Change-Id: I7ca73fe9cf76e9a47cdccfc6cf0e9188fce9f5a6
Reviewed-on: http://gerrit.openafs.org/6309
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Mon, 22 Aug 2011 18:56:03 +0000]
xvcb lock order violation
afs_FlushVCBs(1) = xvcb, xserver (in that order)
afs_GetServer = xserver, xsrvAddr, (call afs_RemoveSrvAddr which calls
afs_FlushServer, which gets xvcb)
"nope". do a little dance to get xvcb, searching for a struct server to reuse
again if we had to block.
if you're curious:
Lock afs_xserver status: (reader_waitingwriter_waiting, write_locked(pid:1589 at:36), 3 waiters)
Lock afs_xvcb status: (none_waiting, write_locked(pid:0 at:273))
Lock afs_xsrvAddr status: (none_waiting, write_locked(pid:1589 at:116))
Reviewed-on: http://gerrit.openafs.org/5294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
12fa5b859b857aaf0ab6975ebac0d4867d0ae0ff)
Change-Id: Ifee367fef4da44bcfd92cea6d26612977d6653a1
Reviewed-on: http://gerrit.openafs.org/6308
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Thu, 25 Aug 2011 00:40:38 +0000]
aklog: work around lion kerberos disaster
fine, so, instead of needing weak crypto enabled, use krb5 config
paths trick and ship a config to deal.
Reviewed-on: http://gerrit.openafs.org/5310
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
33bb5218ba8d6c5b5c5c4839fd31824ca90c062b)
Change-Id: I91a8a02638cadf6f55814763b16cc50d3c7334c5
Reviewed-on: http://gerrit.openafs.org/6307
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 24 Aug 2011 17:30:00 +0000]
ihandle: Actually assert active fdPs are not AVAIL
FdHandle_t's that are on the linked list for an associated IHandle_t
should not be in the state FD_HANDLE_AVAIL. For the non-PIO case, we
assert that this is the case in ih_open (since we assert that if the
FdHandle_t is not in INUSE state, then it must be in OPEN state).
However, for the PIO case, we were just skipping over any FdHandle_t's
that were in the AVAIL state. These should never exist while on that
linked list, so assert for the PIO case, as well.
In the absence of bugs, there is no functional change here, but it
perhaps makes the ih_open loop easier to understand.
Reviewed-on: http://gerrit.openafs.org/5307
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
6d79cfb36165c33dd1fd9c4d7ca8436d9a78f7ff)
Change-Id: If9e74f6120b007368128aead8787d715a1b1f093
Reviewed-on: http://gerrit.openafs.org/6306
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Matt Benjamin [Wed, 24 Aug 2011 20:23:37 +0000]
LINUX vcache lock ordering in afs_linux_readdir
Normalize shared and exclusive lock operations. Take the lock
exclusive immediately, since the code assumes a write lock if
the vcache state is in flux or the entry is being fetched, releasing
-write- rather than shared, since we do not hold a shared lock.
Reviewed-on: http://gerrit.openafs.org/5309
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
fa97579a08cdf23fcff3c50a5845d72a785feeaf)
Change-Id: I282913fead10791751ebaf3c7c6b33e3fbd9a1f7
Reviewed-on: http://gerrit.openafs.org/6305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Garrett Wollman [Sun, 7 Aug 2011 03:36:14 +0000]
butc: initialize startTime before it is used
In some unusual error situations, startTime may be used uninitialized.
Move the initialization up above the first such error condition.
(None of the intervening code can take measurably long to execute
so this should not make any difference in the non-error case.)
Found-by: clang static analyzer
Reviewed-on: http://gerrit.openafs.org/5165
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
34cc26a1b11bc8cf8f91996a019ac4b7d21dccd8)
Change-Id: I70e08b61fbc33857da88224a0577330a0d68d9a7
Reviewed-on: http://gerrit.openafs.org/6304
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 8 Jun 2011 18:19:59 +0000]
afsd: Fail gracefully on mtab open failure
On Linux and IRIX, fail gracefully when we fail to open /etc/mtab,
instead of segfaulting. Move strdup'ing cacheMountDir until after
opening /etc/mtab, to simplify the error handling.
Reviewed-on: http://gerrit.openafs.org/4825
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
b1f0bb472e237f5a6f88449db44f030c08a5a324)
Change-Id: Id12f6190eac15593dd32fd46db354e169d19dc2f
Reviewed-on: http://gerrit.openafs.org/6303
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Simon Wilkinson [Tue, 31 May 2011 07:28:51 +0000]
vos: Don't leak/overflow bulkaddrs
The vos listaddrs command repeatedly reuses a bulkaddrs array. It
zeros it once (without freeing the allocated memory), and then
repeatedly uses it without zeroing in a loop. This means that the XDR
library assumes that a sufficiently large block is already allocated,
doesn't reallocate for the incoming data, or check limits.
This means that if the first call to VL_GetAddrsU returns a set of
addresses smaller than subsequent calls, we'll write past the end
of the array, causing memory corruption.
Fix this by freeing the arrays correctly with each pass of the call.
Reviewed-on: http://gerrit.openafs.org/4756
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
b6add117ad210665a811213fe17a30fabbda3a3c)
Change-Id: Ic3ae8f506e87d18fdc121ff21221f61c359e38aa
Reviewed-on: http://gerrit.openafs.org/6302
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Michael Meffie [Fri, 20 May 2011 18:44:39 +0000]
volinfo: fix size totals when saving inodes
Fix the volume size calculation when volinfo is invoked with
both -sizeOnly and -saveinodes at the same time.
Reviewed-on: http://gerrit.openafs.org/4691
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
ababc1ba4412ae94b29f8ba0832eac087a024af2)
Change-Id: I371a983078c12e09474051ba71f63cdeb57c3631
Reviewed-on: http://gerrit.openafs.org/6301
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Mon, 16 May 2011 18:45:49 +0000]
libafs: Always use anonymous VL connections
afs_NewVolumeByName was using the areq given by the caller for
afs_SetupVolume, which may represent authenticated credentials. Give
afs_SetupVolume &treq instead, which will be anonymous, so we don't
have to deal with rxkad for VL lookups.
Reviewed-on: http://gerrit.openafs.org/4666
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
4a82c0cc4167b729108813965bd39bf86ea15e6b)
Change-Id: Ic10e85b925176719c6c5dc708a1d1a315409d295
Reviewed-on: http://gerrit.openafs.org/6300
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Mon, 16 May 2011 20:16:30 +0000]
viced: Don't VTakeOffline_r without glock
We don't have the volume glock, so don't call _r functions.
Reviewed-on: http://gerrit.openafs.org/4669
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
ef0ac2fbb026385f2306189230c2cff8706dff06)
Change-Id: I3d7c2ca8a514d50c01d4830640e806cefac32af1
Reviewed-on: http://gerrit.openafs.org/6299
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Mon, 16 May 2011 20:02:14 +0000]
viced: Check vnode length on Rename and Link
Commit
2578555d7e08131bf2fe4cdd0aa4b32567a76eb2 added vnode length
checks when we create or remove vnodes, but not during Rename and Link
operations (when vnodes are neither created nor destroyed). Add the
check in Rename and Link.
Reviewed-on: http://gerrit.openafs.org/4668
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
6df5547a7b93af74bc49ec8d4678aafd646dda1b)
Change-Id: I795407a143a56f26c0679b929763ebdc9c633e7a
Reviewed-on: http://gerrit.openafs.org/6298
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 27 Apr 2011 20:36:44 +0000]
viced: Do not try to reuse deleted client
When h_FindClient_r encounters a deleted client structure, it does not
try to find a different client structure to use. Force it to use a new
client structure by setting client to NULL when it detects a deleted
client.
This arguably reverts part of
4e55e30f5b2c149b350b6d6875793adf722fdc21, but the code paths in
h_FindClient_r are very different now, so that commit is probably not
too relevant.
Reviewed-on: http://gerrit.openafs.org/4582
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
b2c6a850738437256626e0dfe743a09224879ad4)
Change-Id: I5e3a12ee79847a915edeec732946b43270a35697
Reviewed-on: http://gerrit.openafs.org/6296
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Mon, 25 Apr 2011 18:53:52 +0000]
pam: Password is const in setcred
afs_setcred.c gets the "password" pointer from pam_get_data, which
always gives a const pointer (unlike pam_get_item used in afs_auth.c
&c, which sometimes gives a const or not-const pointer, depending on
the PAM implementation).
So, declare password const, to get better type checking.
Reviewed-on: http://gerrit.openafs.org/4553
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
94a9b2afd82b6729ddceb7ef736ddeb039e0ae1b)
Change-Id: I3171babfbdf29e7aa543a17f7dd543deedc9b30c
Reviewed-on: http://gerrit.openafs.org/6294
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 13 Apr 2011 15:52:50 +0000]
pam: Use PAM_CONST more often
Some callers of pam_get_item et al were just casting their argument to
a const void **. Some PAM implementations (Linux) want a const void**,
but others (Solaris) do not. Use the PAM_CONST symbol already defined
by autoconf to declare or cast the relevant variable const or not as
appropriate.
Reviewed-on: http://gerrit.openafs.org/4470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
78d1f8d88334f711eaaf6555d3a962a504d3e80e)
Change-Id: I831fa52c238a6cf7ef211e8198815c4420ae7dce
Reviewed-on: http://gerrit.openafs.org/6291
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 13 Apr 2011 16:10:52 +0000]
pam: Check for null upwd from getpwnam_r
The POSIX getpwnam_r can yield a NULL struct passwd pointer even when
the returned error code is 0 (in particular, when the requested entry
is not found). Just add a check for a null upwd to make sure we don't
dereference a NULL pointer.
Reviewed-on: http://gerrit.openafs.org/4469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
fbb4c6115b9af9c52ee06fa9c979a3f4195ad342)
Change-Id: I9a8bccba7b6ecbce393ea149270e5c61ebadd05c
Reviewed-on: http://gerrit.openafs.org/6290
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 13 Apr 2011 16:08:09 +0000]
pam: Use POSIX getpwnam_r on Solaris
_POSIX_PTHREAD_SEMANTICS is now always defined for Solaris, which
means we get a POSIX-conforming getpwnam_r, which takes 5 arguments.
So, add Solaris to the list of platforms that use a POSIX getpwnam_r.
Reviewed-on: http://gerrit.openafs.org/4468
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
a7d4fbd36a120b16caaddcd9d1c7f550cb14aae5)
Change-Id: I2ce885da5018b250052852cb70c70eaecd521cc5
Reviewed-on: http://gerrit.openafs.org/6289
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Fri, 15 Apr 2011 12:02:22 +0000]
kernel upcall rx env should shut down event daemon
also shut down event daemon in upcall environment
Reviewed-on: http://gerrit.openafs.org/4473
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
f4776f0a4d51472ee6f2406174b074c03213f7da)
Change-Id: I7b362e0e0d1ac5f028718b522e56101f2bed297e
Reviewed-on: http://gerrit.openafs.org/6288
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Fri, 8 Apr 2011 18:00:15 +0000]
DAFS: Request salvage on detach for volser
When the volserver notices that a volume needs salvaging, mark
V_needsSalvaged. So when we VDetachVolume the volume, we can then just
request the salvage in the volume package.
Fix the VolClone salvaging code to do this as well, instead of using
the vol-private VRequestSalvage_r interface.
Reviewed-on: http://gerrit.openafs.org/4452
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
de0c72bf7c7d284f4d15d99c79b39e0c97f1a122)
Change-Id: Id6f86368386a5e113a00aa0a496649d69875d283
Reviewed-on: http://gerrit.openafs.org/6286
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Thu, 7 Apr 2011 17:36:19 +0000]
volser: Avoid assert on ViceCreateRoot failure
If IH_CREATE fails in ViceCreateRoot, it may just be due to an on-disk
inconsistency. So, don't assert, but just return an error and detach
the volume.
Reviewed-on: http://gerrit.openafs.org/4444
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
399655e3df3bf30d7878dec70402fc0021cae752)
Change-Id: Icbc934bfe59f6468771f37e5721341dae49ba460
Reviewed-on: http://gerrit.openafs.org/6285
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Thu, 7 Apr 2011 18:51:14 +0000]
DAFS: Do not give back vol to viced after salvage
If we VRequestSalvage_r a volume successfully, and we are not the
fileserver, we will tell the fileserver to salvage a volume. So, we do
not need to give back the volume afterwards, since telling the
fileserver that a volume needs a salvage effectively gives it back (so
the salvager can take it).
So, clear needsPutBack so we don't try to also give back the volume,
and avoid the fileserver yelling at us for trying to give back a
volume that is checked out by someone else (or is not checked out at
all).
Reviewed-on: http://gerrit.openafs.org/4445
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
316b0421a27a4a76298f60ecd62b1236c971e512)
Change-Id: I432abb4d65a738e0e1936a7ff2fff2eccf45834a
Reviewed-on: http://gerrit.openafs.org/6284
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 6 Apr 2011 21:56:22 +0000]
afsd: Trim trailing slashes on Linux mntent
When we write a mount entry on Linux when mounting /afs, trim trailing
slashes on the mount path. Otherwise, the umount utility can get
slightly confused, and leave the /afs mount entry in /etc/mtab after
it's been unmounted.
For full correctness we should probably completely canonicalize the
path like the mount utility does, but it's unlikely that anyone will
provide significantly weird paths for cacheMountDir, so don't bother.
Reviewed-on: http://gerrit.openafs.org/4442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
325443e6178f9dcdba7326bdb675447ac72bd540)
Change-Id: I9832fad8a43278c5eb618e4148c71f8a9ef81e87
Reviewed-on: http://gerrit.openafs.org/6283
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Marc Dionne [Wed, 6 Apr 2011 01:30:20 +0000]
ubik: don't rely on timeout value after select()
The value of timeout after a select() call should be considered
undefined; relying on its value is not portable.
Since IOMGR_Select doesn't modify the timeout it is given, the
intention of the code seems to be to wait for gradually increasing
timeout values, starting at 50ms. At least under Linux, the
timeout gets set to 0 by select() if it waited for the full specified
time, resulting in a much shorter maximum possible wait period.
Initialize the timeout value for each loop according to the existing
logic, to get consistent behaviour between the lwp and pthreaded code.
Reviewed-on: http://gerrit.openafs.org/4441
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
0b510fe30afb34202342364e96bd9030052e1567)
Change-Id: I24eb4d4b1f758f33e3517671cb576ff23e641fb3
Reviewed-on: http://gerrit.openafs.org/6282
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Simon Wilkinson [Mon, 4 Apr 2011 10:02:17 +0000]
Irix: Supress some more warnings in kernel builds
Suppress the following warnings in kernel builds:
*) The function "blah" was declared but never referenced (1174)
*) The indicated trailing comma is non-standard (1201)
*) The parameter "blah" was never referenced (3201)
*) implicit conversion of a 64-bit integral type to a smaller
integral type (3968)
Reviewed-on: http://gerrit.openafs.org/4419
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit
353857e7685c9acfcf7474fabe57c928c70c778f)
Change-Id: I4a5b85ffc56a801e19a181f8d2661eba9c975dcc
Reviewed-on: http://gerrit.openafs.org/6281
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Marc Dionne [Sat, 2 Apr 2011 13:03:55 +0000]
fsprobe: Fix usage message
Fix the usage message to display the correct command name.
Reviewed-on: http://gerrit.openafs.org/4398
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
a0389f5592c25afb19befb5bf62833a0b0bc59cc)
Change-Id: I6105eff9f4cfae56d85df40589bd4b175aa760d0
Reviewed-on: http://gerrit.openafs.org/6280
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Marc Dionne [Sat, 2 Apr 2011 12:40:15 +0000]
fsprobe: call RXAFS_GetTime directly
Call RXAFS_GetTime directly instead of using ubik_Call which is
not prototyped and has logic that we don't need/want here since
we're targeting a specific server.
Reviewed-on: http://gerrit.openafs.org/4397
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
ef105dcc4932da804750dea0c922d5814fc5bf15)
Change-Id: If4e430a55d36725f2cf8e5bf04a036062480cfac
Reviewed-on: http://gerrit.openafs.org/6279
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Simon Wilkinson [Fri, 1 Apr 2011 15:37:32 +0000]
Linux: Fix USE_UCONTEXT detection
On Linux, afs/param.h determines whether to use the ucontext()
function based on the glibc version. However, the glibc version
macros aren't available until a C library header has been included.
There have been a couple of attempts to fix this. The first included
afs_sysnames.h before the C library check, but this wasn't sufficient
to pull in a header for all builds. The second included stdio.h before
including afs/param.h in process.c.
Whilst the second approach works, it has the drawback that it breaks
our convention that afsconfig.h and afs/param.h must always be the first
includes in a file. More seriously, it means that the behaviour of
afs/param.h is different depending on where it appears in the include
order - which is especially dangerous for 3rd party user.
So, this patch tries to resolve all of this by explicitly including
features.h before doing the glibc version checks. The only danger I
can see here is that Linux platforms without glibc may lack a
features.h, but I suspect we have trouble building on such platforms
in any case.
Reviewed-on: http://gerrit.openafs.org/4389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
f5f0ce525a63264098cd0625769d642fe6f106ba)
Change-Id: Ia94487f35ad0fc3143faafd2fa12a6c71d40f116
Reviewed-on: http://gerrit.openafs.org/6278
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Jeffrey Altman [Sat, 5 Mar 2011 19:29:38 +0000]
vol: remove warning on use of DFlushVolume
Include the afs/dir.h header on Windows to avoid
warnings caused by the missing prototype.
Reviewed-on: http://gerrit.openafs.org/4148
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
(cherry picked from commit
d69da816c6e961ef5e22df289ad5667cd8568b4c)
Change-Id: I1f128f676a6d099b2d9534e28c6302de78b0ff2d
Reviewed-on: http://gerrit.openafs.org/6273
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Tue, 23 Nov 2010 03:23:02 +0000]
vol: Move VOL_CV_TIMEDWAIT to volume_inline.h
Some platforms will give errors for the vol package glock not being
defined in VOL_CV_TIMEDWAIT, since some utilities include volume.h
(with pthreaded ubik enabled) but do not have the vol glock. This
isn't a problem for the other CV_WAIT (et al) macros, since, being
macros, they are not expanded if never referenced. Since
VOL_CV_TIMEDWAIT is a static inline function, however, and at least
some platforms try to compile/link it even if it's not referenced.
So, move it to volume_inline.h, which is only used by the volume
package itself, where we will have the vol glock.
Reviewed-on: http://gerrit.openafs.org/3363
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
e4059c1b812410bd96481cc60c86c67f8733b66f)
Change-Id: Ic1d6286bb148f202b8da010edf48fff93a5a48fb
Reviewed-on: http://gerrit.openafs.org/6268
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Andrew Deason [Tue, 29 Mar 2011 17:28:46 +0000]
vol: Add timeouts to SYNC server select() calls
Normally *SYNC server processes wait indefinitely for activity to
occur on one of the SYNC sockets. On some Linux kernels, there exists
a race condition where data can come in on a socket, but the select()
call continues to wait. To ensure that we do not hang forever in such
a scenario, add a timeout to the select() call, which will ensure we
notice the new data within 10 seconds. Raise the timeout on non-Linux
to reduce impact elsewhere.
The Linux kernel bug is tracked in
<https://bugzilla.redhat.com/show_bug.cgi?id=494404>, though that bug
report may not represent all affected kernels.
Reviewed-on: http://gerrit.openafs.org/4377
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
920a00e075b679f59e31b9fcbe7f5db15e345a95)
Change-Id: Iae4035bc952b66f88843d51ff341b0576f15163d
Reviewed-on: http://gerrit.openafs.org/6276
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 23 Mar 2011 20:19:03 +0000]
namei: Log ListViceInodes write failures
If we fail to write to the inodeFile given by ListViceInodes, we
should log the failure. Otherwise, no indication is given as to what
failed, when a salvage gathers the inode list.
Reviewed-on: http://gerrit.openafs.org/4294
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
22149d82d465f5defbe329b3f9b3c5040a6293e9)
Change-Id: I7fb56f0af99bb040e64cf54bf05e01306a609326
Reviewed-on: http://gerrit.openafs.org/6275
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Tue, 15 Mar 2011 03:36:45 +0000]
macos: dont want bind 8 compat on leopard
we removed it for i386, kill it for ppc also.
Reviewed-on: http://gerrit.openafs.org/4229
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
4a72ebfe324874dd405d18561baf5eaacb007950)
Change-Id: I9e625f79c047b61fc3675e6732eaa7d2dd34214f
Reviewed-on: http://gerrit.openafs.org/6274
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Mon, 10 Jan 2011 18:11:22 +0000]
LINUX: afs_linux_put_link is void
The put_link callback doesn't return a value, so declare it as such.
Reviewed-on: http://gerrit.openafs.org/3636
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
336256c7a0e7d54495a070895c9d8c2057168839)
Change-Id: I5985316ea37f572039267ea117dfeae55ea96bc0
Reviewed-on: http://gerrit.openafs.org/6271
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Thu, 23 Dec 2010 18:20:42 +0000]
DAFS: listvol + unsalvagable volumes = intolerable delay
a non- inService volume (or more) plus vos listvol equals pain.
return Salvaging instead of waiting for it in the listvol case.
Reviewed-on: http://gerrit.openafs.org/3588
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
affc978be7ba3c36c9b7a6a94fb5e907beebed99)
Change-Id: If871ce0cdd3593250f22d74de184f92b046b5f6e
Reviewed-on: http://gerrit.openafs.org/6270
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Fri, 3 Dec 2010 23:20:54 +0000]
LINUX: Reduce stack depth on recursive symlink res
Instead of calling vfs_follow_link inside afs_linux_follow_link
ourselves, we can just resolve the next step of the symlink resolution
and set the result in nd_set_link(), freeing the string in
.put_link().
For kernels without a usable symlink text cache, this reduces call
depth when resolving a path containing many symlinks by two frames per
layer of indirection, allowing for more deeply-nested symlink paths to
be usable.
Reviewed-on: http://gerrit.openafs.org/3433
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
2ce159fbf474b96ecd2a4224751d4655230bba51)
Change-Id: Idb91c2bb1a10b60d125dccbc98731ace63d4add8
Reviewed-on: http://gerrit.openafs.org/6269
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Felix Frank [Fri, 12 Nov 2010 23:10:31 +0000]
rxgen: add *TranslateOpcode functions to XDR code
Administrative commands and server binaries can benefit from the
ability to translate RPC OpCode numbers to proper function names.
For this purpose, rxgen now emits the function
char *PKGTranslateOpCode(int)
where PKG is replaced by the respective package prefix.
The function is generated in the exact same way that ExecuteRequest is.
This way, the right optimization (array storage vs. generated case
statement) according to the respective sparseness of OpCodes in the
different RX packages is maintained.
Reviewed-on: http://gerrit.openafs.org/3305
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
5c77a6ca2460c3e79125a614037824db35480905)
Change-Id: I23d7af2dd07e02255783de0523fce58dbe46d31e
Reviewed-on: http://gerrit.openafs.org/6267
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Fri, 29 Oct 2010 16:14:49 +0000]
vol: Add interfaces for registering RX calls
Add VGetVolumeWithCall and VPutVolumeWithCall, to associate RX calls
with volume heavyweight references. Also add the interrupt_rxcall
field to the volume package options structure.
This also adds the VIsGoingOffline function, so a caller can tell when
a volume is going offline.
Reviewed-on: http://gerrit.openafs.org/3215
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
33409b2c849d7fae3b10b3202bb15e338ae5b982)
Change-Id: Ib50a17b3479453bbbaef571711ede7115b17318e
Reviewed-on: http://gerrit.openafs.org/6265
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Wed, 27 Oct 2010 22:34:40 +0000]
vol: Add VGetVolumeTimed
Replace the VGetVolumeNoWait interface with the more general
VGetVolumeTimed interface, which allows for waiting for offlining
volume for arbitrary amounts of time (instead of just "waiting
forever" or "not waiting at all"). Also add VOL_CV_TIMEDWAIT and
VTimedWaitStateChange_r as necessary to implement this.
Reviewed-on: http://gerrit.openafs.org/3214
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
db6ee95864a8fc5f33b7e95c19c8ff5058d37e92)
Change-Id: I6c7b3a0b9fe174ebffeb03153dda1c4705d7dac5
Reviewed-on: http://gerrit.openafs.org/6264
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Simon Wilkinson [Sat, 11 Sep 2010 11:51:52 +0000]
rx: Call rxgen_consts.h by its proper name
rxgen_consts.h is actually in the afs/ directory. Include it from
their, rather than requiring that every user have $(TOP_INCDIR)/afs
in their search path.
Reviewed-on: http://gerrit.openafs.org/2750
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
34df5da39871ae5231048a416f191784c5c2d127)
Change-Id: I915cf9d975efbb7c73c1e57750227421362648c8
Reviewed-on: http://gerrit.openafs.org/6263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Fri, 10 Sep 2010 16:17:40 +0000]
udebug: Always show tidCounter
If the queried site doesn't have an active write transaction,
currently udebug doesn't show the tidCounter. The tidCounter can still
be useful to know (especially since some sites will become buggy when
tidCounter rolls over), so always show it.
This adds the "The last trans I handled was" message to udebug.
Reviewed-on: http://gerrit.openafs.org/2730
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
51806bd21af5bcc70c27cda5787ae853fa3f495e)
Change-Id: I861804c4381a75626c5259a4896642f0e4064b7d
Reviewed-on: http://gerrit.openafs.org/6262
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Ken Dreyer [Mon, 31 Oct 2011 14:27:16 +0000]
doc: limitations of addsite on different partitions
A user on the openafs-info mailing list noted that the Admin Guide is
unclear about creating read-only replicas on different partitions on
the same fileserver. Clarify the rules here.
Reviewed-on: http://gerrit.openafs.org/5745
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
c59c07132ef17589ad3466ded418c1370539b7af)
Change-Id: I68898c21e2c1aa7d6828b475dff4c1cb6d14327c
Reviewed-on: http://gerrit.openafs.org/6317
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Thu, 20 May 2010 20:22:11 +0000]
ubik: add interface for reading during write locks
Add ubik_BeginTransReadAnyWrite, which allows for reading from the
database, even while there is a conflicting ubik write lock. Reads are
still blocked while the local database is updating due to a write
transaction commit.
Reviewed-on: http://gerrit.openafs.org/2592
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
fd7f7469bdbde24320c3ac8b4f7015d495b47bff)
Change-Id: I46cf35beeea6dc997976ea2c33e45c1a5f4904df
Reviewed-on: http://gerrit.openafs.org/6261
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Tue, 22 Jun 2010 19:36:42 +0000]
ubik: Fix buffers for reading-during-writes
If we are reading while a write transaction is in progress, we can
encounter a buffer that is dirty if we're on the same site as the
writer. Ignore these buffers for readers, since they contain
uncommitted changes. Then, when the writer commits, invalidate the
resultant duplicate buffer, if one exists.
Reviewed-on: http://gerrit.openafs.org/2231
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
570236dd55e79e8886b45f19cef59ec3fa9d53f6)
Change-Id: If83e077b99a77339377a36f1d1bac9182ef26e4f
Reviewed-on: http://gerrit.openafs.org/6260
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Tue, 22 Jun 2010 18:24:27 +0000]
ubik: Abstract buffer matching and pass trans ptrs
Abstract the code for matching buffers in DRead, and pass around
ubik_trans pointers instead of ubik_dbase pointers. This changes no
behavior, but makes changing ubik buffer code a bit easier.
Reviewed-on: http://gerrit.openafs.org/2230
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
5c7297a6c76777aec6209aa191b067ddc73b1a87)
Change-Id: I6cc673d965b5e06361fff8ea259ba552446e3213
Reviewed-on: http://gerrit.openafs.org/6259
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Derrick Brashear [Fri, 1 Apr 2011 16:17:13 +0000]
macos: no more startupitems
if we're upgrading, a "cruft" startupitems script should just
be nuked.
FIXES 129601
Reviewed-on: http://gerrit.openafs.org/4387
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
841c8022e3978fffe1357f339d948e93c9db9d52)
Change-Id: Ibe2dde067df1fe22da1bb09039d07ebbc178af08
Reviewed-on: http://gerrit.openafs.org/6277
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Ken Dreyer [Mon, 11 Apr 2011 21:24:41 +0000]
fix manpage for udebug -servers
The proper option to udebug is "-server", not "-servers". Fix the manpage to line up with the binary.
Reviewed-on: http://gerrit.openafs.org/4457
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
d5ded9afa1764016977a17ef9346dc979bf70ca0)
Change-Id: I66bea4923717a6b7df5fbefa1dd93d469d96be3c
Reviewed-on: http://gerrit.openafs.org/6287
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Andrew Deason [Fri, 15 Apr 2011 19:18:57 +0000]
doc: Add aklog_dynamic_auth manpage
Add a manpage for the aklog_dynamic_auth LAM module.
Reviewed-on: http://gerrit.openafs.org/4485
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
24ddd06a0dc19ad7c0b2a2847d41a5ea69665b15)
Change-Id: Ib5f7463b75ee8d58ecc6b725f629fd7600c64792
Reviewed-on: http://gerrit.openafs.org/6297
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Jeffrey Altman [Mon, 5 Dec 2011 04:15:13 +0000]
afs: prevent nat pings on destroyed connections
If the connection is no longer in use, reset the nat keep alive
timer to 0 seconds.
Reviewed-on: http://gerrit.openafs.org/6230
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
7a93c827f353e2ad695d8019ab789b02a3596f2e)
Change-Id: I019bdce7a8f9f0123786b46d0563f42f7b26c14b
Reviewed-on: http://gerrit.openafs.org/6232
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Ben Kaduk [Sat, 3 Dec 2011 19:37:09 +0000]
FBSD: switch afsi_SetServerIPRank implementation
Upstream has removed the ia_net{,mask} elements from
struct in_ifaddr, so we can no longer use them directly.
Switch to passing an rx_ifaddr_t (i.e. struct ifaddr*) in instead,
as that uses a slightly different codepath which still works
for our purposes.
We compile the kernel module with -Werror, so storing a pointer
(memcpy return value) in an int is forbidden, hence the conditional
declaration of 't'.
Reviewed-on: http://gerrit.openafs.org/6203
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
1ef8dc3dfbddcbe5610c276afc627c9fcfe30a65)
Change-Id: Icb338331c879dc4cbd69ae565b115de000e8d3d0
Reviewed-on: http://gerrit.openafs.org/6235
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Ben Kaduk [Sun, 13 Nov 2011 18:12:50 +0000]
FBSD: cleanup dvp locking for ISDOTDOT
This is a more correct version of
c2ed2577f9c16df3088158fb593d7aab6e8690d0, which was reverted since
it caused build issues on some versions and kernel panics on others.
We do want to always unlock dvp before calling over the network
in the ISDOTDOT case, but be sure to use the proper spelling
for this operation (as the syntax has changed between FreeBSD versions).
This requires not unlocking dvp right after the afs_lookup() call if
it succeeds, letting us just lock the "child" vp (which is actually
the parent starting from '/') first, and then re-lock dvp.
The error case of afs_lookup() was already handled correctly in
this logic, which is to say that it was incorrect before this change,
attempting to recursively lock dvp which causes a panic.
Reviewed-on: http://gerrit.openafs.org/6127
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit
8e14168c9c77850ce0603d56f8aa280f73cb3114)
Change-Id: I2d929875a9b008f0aa0b64bce7971932691d9956
Reviewed-on: http://gerrit.openafs.org/6234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Ben Kaduk [Sun, 23 Oct 2011 15:22:07 +0000]
FBSD: typo fix
Gerrit/5572 added conditionals on __FreeBSD_version >= 900044, which
is (approximately) when a bunch of kernel API renames happened.
(There has since been a dedicated version bump to 900045 a month
or two post-facto, but 900044 should be fine for now.)
However, 900044 is not 90004.
Reviewed-on: http://gerrit.openafs.org/5657
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit
ca8ba7e7a41e61cc943b34196872b72a190432e3)
Change-Id: Ibacd6d037590df0696b8dab8107d36bca470785a
Reviewed-on: http://gerrit.openafs.org/6233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Derrick Brashear [Wed, 30 Nov 2011 21:20:23 +0000]
remove CopyOnWrite2 and unused vars
unused static functions make grumpy compilers grumpy.
(cherry picked from commit
7a6cf450babea4e706392cb8ad83586fa7f8e558)
Change-Id: Ib40be2b9458ca799ba2b808ed86a627c40cf6ec4
Reviewed-on: http://gerrit.openafs.org/6161
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>