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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
_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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>