rx uses the afs syscall to get network info in userspace. fix things to
pass a useful set of args in
Change-Id: I541f90d43ff79ba7a026832403d485b7738a53b8
Reviewed-on: http://gerrit.openafs.org/1379
Reviewed-by: Chaz Chandler
Tested-by: Chaz Chandler
Reviewed-by: Derrick Brashear <shadow@dementia.org>
don't be willing to wait more than about an rx timeout period for afsdb
retries.
Change-Id: Idca642ff7abe6b9233c7501b0f06fd353567bb04
Reviewed-on: http://gerrit.openafs.org/1407
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
for rfc 4787, do a minimal impact nat ping. this uses an rx
"version request" reply debug packet, which will simply be discarded by the
receiver, to keep the port mapping open.
Change-Id: Ic2180bfa5c467e33c72e3f19d62488bd6a2dc61a
Reviewed-on: http://gerrit.openafs.org/1393
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Make ObtainSalvageLock use the VLockFile API, to consolidate
platform-specific locking code, and to make it possible to acquire a
shared lock on the salvage lock file. Create the ObtainSharedSalvageLock
function to acquire such a lock.
Change-Id: Ieadd77ac8d4030b31c48fff1c98712a6c95f93ad
Reviewed-on: http://gerrit.openafs.org/1347
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
previously only "just enough" of the background daemon request object was
exposed. expose the rest of the generic pointers
Change-Id: Ifcadf53675598bc102208700ff34a768474174ec
Reviewed-on: http://gerrit.openafs.org/1384
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
we can't prototype call_syscall fully yet, but at least hush some warnings
Change-Id: I4e5f77037700f82ebfa87bd4fee4f52a59e3479a
Reviewed-on: http://gerrit.openafs.org/1385
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
because of how the ioctl based syscall works, passing back a real
return value should be done this way, as it is for the other other
afs syscall subcalls. matters for userspace handlers.
Change-Id: I894b4bd633ce4823b1ce906861251fcbb3949af2
Reviewed-on: http://gerrit.openafs.org/1381
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
if someone else stats it before we finish, make sure we clean up after
ourselves properly
Change-Id: I4a7257a403cccb02a114c60f5bb340dba6bb16cb
Reviewed-on: http://gerrit.openafs.org/1399
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Initialize all RXAFS_InlineBulkStatus return parameters in case portions
remain unset on FetchStatus failures. Also ensure VolSync info is set even if
the first FetchStatus fails.
Change-Id: I8c502d25ef1362675fed2871dbd8c3c4e76af55b
Reviewed-on: http://gerrit.openafs.org/1396
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
if /afs/.:mount/cell:volume:vnode is passed in, don't pass the :vnode
into the volume id lookup
Change-Id: If877b467cd37f06dcb090c34560bf76f8e4b0d10
Reviewed-on: http://gerrit.openafs.org/1383
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
we haven't built on irix 6.4 in a while. likewise, no efs anymore.
just remove the extra code
Change-Id: I559f4bca5bf52f9a0344472ccf60b93751282a2b
Reviewed-on: http://gerrit.openafs.org/1380
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
if the XFS function takes a dcache_id_t, pass that and not its child
Change-Id: Ic68ae440be0df05320fe0a0b24e2ffa8e4de45b9
Reviewed-on: http://gerrit.openafs.org/1378
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
when initglock hit freebsd it was broken. fix it. make it obvious that such is
being done
Change-Id: Iac716302061be91a43f168c9a1fe56cdbbb4227d
Reviewed-on: http://gerrit.openafs.org/1391
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
change 6ec1846164, avoid leaking stat info,
appears to have side effects on at least macos, crashing the system
coreservicesd. revoke the change until the exact behavior we want is
better understood.
Change-Id: I2a270750f9cef5ac6ecf1144d86988f030f78efe
Reviewed-on: http://gerrit.openafs.org/1388
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The VLockFile API does not require DAFS functionality, so make it
available to non-DAFS code, as well.
Change-Id: I3d9bebb5d4034f0af739ccee37f64e2254be38cb
Reviewed-on: http://gerrit.openafs.org/1346
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Zero is a valid file descriptor; initialize lockfile fd to INVALID_FD
instead, so we know it's invalid.
Change-Id: Iacb549ec4ed821763d20cb0e4f25882b4151bf3a
Reviewed-on: http://gerrit.openafs.org/1345
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When we fail to acquire a lock in _VLockFd, do not close the fd if we
fail to acquire the lock for any reason, since VLockFile does that for
us already. There also may be other locks on that file, and we clearly
do not want to release them when just one lock fails. VLockFile takes
care of the necessary refcounting and fd closing, so don't do it in
_VLockFd too.
Change-Id: I65f27837dad033e0e84faf4aa0fb71ff26feda83
Reviewed-on: http://gerrit.openafs.org/1344
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
acl_Internalize and acl_Externalize used the global pruclient
use the ones we use elsewhere in viced FetchAcl/StoreAcl also
Change-Id: Ia2b8d29035ed48a6aab8c9df243c9082bfacd201
Reviewed-on: http://gerrit.openafs.org/1314
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
xdr_mem.c wasn't including limits.h on IRIX when KERNEL was declared, so i
INT_MAX was undefined. this adds limits.h to sysincludes.h so it's included
for all other places where it might be needed.
Change-Id: I718f5bf4dc5d82e2ce74ecc30ab3bf5492b82e29
Reviewed-on: http://gerrit.openafs.org/1377
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
In 2.6.33, <linux/autoconf.h> is moving to <generated/autoconf.h>.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Change-Id: Ib97031728b89cf8e17581f3c425216ae4b5538ec
Reviewed-on: http://gerrit.openafs.org/1351
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
<linux/autoconf.h> is automatically included by kbuild; you aren’t
supposed to include it directly. That breaks in 2.6.33 because
<linux/autoconf.h> is moving to <generated/autoconf.h>.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Change-Id: I56c90dfe90ef72408620793fcd4e927ea3d8f468
Reviewed-on: http://gerrit.openafs.org/1350
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
As of commit 49b7bbdd3b, l_len is no
longer 1 less than it should be. Update afs_lockctl to expect this.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Change-Id: I3fb7665457d489e56564b14933795084a0958d6f
Reviewed-on: http://gerrit.openafs.org/1353
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
An overflow bug in commit 49b7bbdd3b
caused whole-file locks to be treated as byte-range locks, which fail
to be propagated to other machines.
Fix this by setting l_len = 0 for locks that range to the end of the
file.
FIXES 126561
Change-Id: Ie2dc9d04f33559c73b3b86b64152c549b785f8ad
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/1352
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The code for examining all of the headers on a vice partition now exists
in two places: the VGC scanner, and the salvager. Create the
VWalkVolumeHeaders function that contains the common logic so it's in
one place, and take a couple of function callbacks for the differences.
Change-Id: I12c71b3344ffbd0b22ddf5418f9ff0509734f42b
Reviewed-on: http://gerrit.openafs.org/1264
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Previously GetSomeSpace_r would never find an 'ideal' host for which to
clear callbacks, since lih0_r and lih1_r required a non-NULL rock to do
anything. Remove the requirement for the passed-in host rock to be
non-NULL, and make lih*_r more threadsafe, by passing in a parameter
struct for the rock.
Also attempt to make the GSS_r code a bit more clear with some
descriptive variable names and such.
FIXES 126451
Change-Id: Id754f4fa4b830896c5b03fc7ba0906950991a3b7
Reviewed-on: http://gerrit.openafs.org/1317
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When h_TossStuff_r h_NBLock_r's a host, it is not only possible for
someone else to grab a hold on the host, but in theory it's also
possible for someone to hold a host, release it, and for the host to be
deleted again (assuming some callers hold HOSTDELETED hosts, which they
should not be doing).
To make this safety check a bit more robust, hold the host in
h_TossStuff_r before h_NBLock_r'ing, to ensure that it does not go away
while we're waiting for H_LOCK.
Change-Id: I018a611143d6dccba79cc627803cce74aa830c77
Reviewed-on: http://gerrit.openafs.org/1330
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
fs_stateSave can call ShutDownAndCore(PANIC) if it detects host list
corruption. Right now this will deadlock the shutdown thread, since
we're still holding a read lock on the FS state when we do so, and
ShutDownAndCore will attempt to acquire a write lock. Do two things to
make this a bit better:
-- Unlock the FS state before calling fs_stateSave, sine we're no
longer looking at the FS state (the 'state' in fs_stateSave refers to
the host list and callback lists, not the state locked by
FS_STATE_*LOCK)
-- If ShutDownAndCore detects that it was called inside of
ShutDownAndCore, skip shutting down the volume and host packages, since
they have already been shut down
Change-Id: I24a994ff85a6d866a5800b777c0cf5ab2ba466e4
Reviewed-on: http://gerrit.openafs.org/1362
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
A few places h_Hold_r a host and later drop and reacquire H_LOCK without
checking if the hostFlags contains HOSTDELETED. This can cause a race
with h_TossStuff_r where we later reference a host that is about to be
freed or already has been freed.
Add checks for HOSTDELETED in these places, and skip over the deleted
hosts.
FIXES 126454
Change-Id: I5a61831f5afdbc908b82e4cf63cf14a34a36e275
Reviewed-on: http://gerrit.openafs.org/1305
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Ide1e5aca7c2c4a4af3f62bc07821db694f2f9999 added safety checks for a few
traversals through hostList, including the traversal in h_Enumerate_r.
Unfortunately, h_Enumerate_r may not hold H_LOCK over its entire
traversal (h_Release_r can drop and reacquire it), so the value of
hostCount is not guaranteed to stay the same.
A host may be deleted during the loop, or right near the end, decreasing
hostCount to below our current running 'count' of hosts, triggering the
panic unnecessarily.
Also, we break out of the loop if the H_ENUMERATE_ISSET_BAIL test
succeeds, making the panic also incorrectly trigger then.
So instead, remember the value of hostCount, and ensure that we've
actually exceeded that count in the post-loop check.
Change-Id: I7c13bbf111b592df6860e5852807fa463c3ebd7e
Reviewed-on: http://gerrit.openafs.org/1304
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
h_TossStuff_r checks if a host is held or locked by another thread
before trying to delete the host. Unfortunately, it checks if it is
locked before checking if it is held, and the lock check drops H_LOCK.
Thus, another thread could hold the host while we don't have H_LOCK, and
we could delete a host that is being held.
Although it is a bug if any thread holds a host that is being deleted,
some instances of this still exist, so make the check more robust.
Reverse the order of the tests, so we detect if someone held the host
while the lock check dropped H_LOCK.
Also log when this happens, as it indicates a bug occurring.
FIXES 126454
Change-Id: I8fa972c430e63fc46ca4fadcc3429173ac91a947
Reviewed-on: http://gerrit.openafs.org/1312
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
don't pass a null pointer to FindVolume in case one shows up
Change-Id: I76258d8f8ca18c536e3faa776df3e06005fe2bc2
Reviewed-on: http://gerrit.openafs.org/1360
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
allowing failover is nonsensical, there's nothing to fail to. keep trying to
write. if we want to change this, we need to handle it better than just this.
Change-Id: Ibed4c63182f44ed9e659895e4868b4192d004688
Reviewed-on: http://gerrit.openafs.org/1355
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
One small step towards a valgrind-tolerant universe: ih_synced
indicates that an inode should be synced which better be deterministic.
Change-Id: Id6a09a07c6f90c59445b82fdceeba3c905cbae7e
Reviewed-on: http://gerrit.openafs.org/1343
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Rename dprintf to afs_dprintf to avoid potential conflict with
system headers on some platforms.
Change-Id: I2aef6a55c00ddf8a312531cc1203b3baaca4cd73
Reviewed-on: http://gerrit.openafs.org/1342
Tested-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The 'name' element of the backing_dev_info structure is new in
2.6.32 - add yet another configure test, and #ifdef to protect our
setting of it.
Change-Id: I0a3e411e571e05771619381bf621d299482c695b
Reviewed-on: http://gerrit.openafs.org/1341
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Make some changes to the Unix build system so that object directory
builds work again. In particular, change the way that we call
xcodebuild on Darwin, so that source and binary can live in different
places.
Change-Id: Ib2ab6182deaf7f344603cb5618707d3f212a5b86
Reviewed-on: http://gerrit.openafs.org/1339
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Some platforms such as OpenBSD require including stdint.h before you can
use intptr_t. So, include stdint.h (if it is available) whenever we use
intptr_t.
Change-Id: I6da005755752e8d52f62e78d15103b19a951e50a
Reviewed-on: http://gerrit.openafs.org/1336
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
we haven't had a 10.2 machine to build on in quite a while...
might as well pull it, it probably doesn't work anymore
Change-Id: Iad809e83dadb0e7fa8c61b3f37f574a571042fc8
Reviewed-on: http://gerrit.openafs.org/1335
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
The salvager makes use of a couple of temporary files to store some
information while doing a salvage. Instead of referring to these files
by path name everywhere, pass around file handles instead. That way we
can unlink the files immediately, and they will be deleted on close.
This removes one of the roadblocks to allowing multiple salvages on the
same partition to occur at once (since otherwise other salvagers would
remove the temporary files on startup), and also makes it much less
likely that old temporary files will be left lying around in the first
place.
Change-Id: Idfc696c2c75e21db717c720bd950af6e2766b9aa
Reviewed-on: http://gerrit.openafs.org/1263
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
When salvaging a volume (with DAFS or not), it is required to read the
volume headers of all volumes on the partition, so we know what volumes
are in the same volume group as the salvaged volume. Currently with
DAFS, this requirement can make demand-salvages very slow, since each
demand-salvage must read each volume header on the partition.
So, instead of having each demand-salvage read the volume headers
itself, have a demand-salvage request the required volume group
hierarchy information from the fileserver. The fileserver will scan the
partition's volume headers, and will keep the hierarchy cached in
memory. Any modifications to this hierarchy from volume
creation/deletion will update this volume group cache (VGC) via FSSYNC
commands.
This results in a dramatic salvaging speedup when many demand-salvages
are requested, and eliminates the cases where DAFS salvaging can be
significantly slower than non-DAFS salvaging.
FIXES 124488
Change-Id: Ie9ae655593ad8a90ca6ad8f63e6b6e799f283988
Reviewed-on: http://gerrit.openafs.org/880
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Add an API for acquiring and releasing file-level locks. This abstracts
away the platform-specific aspects of file locking, and also makes the
locking work when several threads attempt to acquire a lock within the
same process.
This commit just adds the functions and datatypes; nothing actually uses
them. The users will be added in (hopefully nearby) future commits.
Change-Id: I6bffb6a7dd47ffb5c8a9942b16cd5ef6bc7eb62e
Reviewed-on: http://gerrit.openafs.org/1237
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
Pull the token management operations (get, set and compare tokens) out
into their own functions. Again, this is purely a refactoring exercise -
no behaviour changes are anticipated as a result of this change.
Change-Id: I9c64a319fcaa2edeb492c7822f9bae64c91cc20c
Reviewed-on: http://gerrit.openafs.org/1326
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
This change refactors all of the rxkad specific token acquisition code
out of the common auth_cell loop, and into a number of functions of its
own. There should be no functional changes.
Change-Id: I61314588ba4db6b85db03314d4524322f74c9230
Reviewed-on: http://gerrit.openafs.org/1325
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>