Andrew Deason [Wed, 27 Apr 2011 19:23:43 +0000 (14:23 -0500)]
viced: Avoid ref leak on origin callback break
When breaking a callback, sometimes we send a callback to the host
that performed the callback-inducing operation. When we do this,
currently BreakCallBack gives the origin host structure to
MultiBreakCallBack_r, which avoids releasing that host after the
callback is broken.
However, BreakCallBack obtains a reference to every host to which it
delivers a callback, even if it is the origin host, so a reference is
leaked. Fix this by not ever passing a host to MultiBreakCallBack_r,
and just have MultiBreakCallBack_r release a reference for every host
to which it delivers a callback break.
Andrew Deason [Wed, 27 Apr 2011 18:51:23 +0000 (13:51 -0500)]
viced: Transfer host ref in h_FindClient_r
In h_FindClient_r, we can change which client structure we're dealing
with if we find a different client struct in the Rx conn-specific
data. We adjust the refcounts for the client structures themselves,
but not the associated hosts. While the host structures should be the
same most of the time, we are not guaranteed that, so adjust their
refcounts as well.
Andrew Deason [Sat, 23 Apr 2011 21:52:30 +0000 (16:52 -0500)]
viced: Release all hosts in h_Enumerate*
h_Enumerate and h_Enumerate_r were not releasing all of the holds they
obtained when the callback function caused the enumeration to bail
early. Correct them so all host holds are released.
Andrew Deason [Sat, 23 Apr 2011 21:44:41 +0000 (16:44 -0500)]
viced: Print a warning when using a deleted client
We should never get a deleted client back from GetClient. Log a
message if we do, to explain why access may suddenly appear to fail,
and assist in determining why.
Note that we still try to service the request, since the accessing
user may still have enough access to do whatever was requested.
Jeffrey Altman [Sun, 1 May 2011 04:11:13 +0000 (00:11 -0400)]
Windows: Fix caching of non-existing vols
In cm_UpdateVolumeLocation() the conditional that would
trigger the immediate return of CM_ERROR_NOSUCHVOLUME
was backwards which prevented the caching from working.
cm_CheckOfflineVolumes() is called by the daemon thread
to reset the status of offline volumes. Non-existing
volumes are by definition offline and cannot be brought
online. Therefore, the cm_CheckOfflineVolumes() function
should skip volumes with the CM_VOLUMEFLAG_NOEXIST flag
set.
Ben Kaduk [Sun, 19 Dec 2010 04:52:43 +0000 (23:52 -0500)]
Rename libcom_err to libafscom_err
We no longer provide a compatible libcom_err, and in fact
we renamed the symbols in our libcom_err several years ago
to reflect this fact.
When we build on a system where KRB5_LIBS includes
-lkrb5 -lcom_err , the new Unix build system will pick up
our libcom_err (as $(AFS_LDFLAGS) is the first argument in
AFS_LDRULE and pulls in a linker search path for our libcom_err)
which does not provide all the needed symbols for libkrb5.
Fully rename our libcom_err away to avoid these conflicts.
Marc Dionne [Wed, 30 Mar 2011 22:32:04 +0000 (18:32 -0400)]
Linux: Fix fallout from path_lookup commit
Fix a few issues with the recent commit to deal withg the removal
of path_lookup, spotted on RHEL 5:
- the configure tests needs fs.h to be included before namei.h, to
get the definition of struct inode
- we need to avoid the use of struct path unless its needed; on
older kernels the structure doesn't exist
Andrew Deason [Sat, 23 Apr 2011 21:25:00 +0000 (16:25 -0500)]
viced: Fix host enumeration flags
Do not give uninitialized flags values to h_Enumerate callback
functions. In fact, do not give a flags value to h_Enumerate or
h_Enumerate_r callback functions at all, since they are not actually
used.
Fix host enumeration callback functions to just return 0 or the
relevant flags, instead of basing the return value off of the given
flags value. Update MultiBreakVolumeCallBack_r to use the correct
return values, since it currently tries to use the old meanings of the
host enumeration return values.
If the Kerberos v5 library cannot be loaded (pkrb5_init_context
equal to NULL) return a reasonable error code instead of
returning success and doing nothing.
Windows: NPLogonNotify provide password in all cases
When calling KFW_AFS_get_cred() from NPLogonNotify()
always provide the user password. Do not count on a
credential cache existing from a previous call.
Andrew Deason [Fri, 15 Apr 2011 16:18:37 +0000 (11:18 -0500)]
AIX51: Fix PAGs
On AIX 5.1 and later, we set a process' PAG by using the AIX PAG
mechanism (and not by group ids), but we were determining what PAG a
process was in by the group list. Instead use the PAG identifier.
This effectively reverts 277c37f48c8126ba9cb986ffc7361fcb98e2bbf2, but
it puts the kcred_getpag call in a different place that makes more
sense in the current PAG code organization.
Simon Wilkinson [Thu, 21 Apr 2011 15:07:05 +0000 (16:07 +0100)]
Linux: Restrict # of cbrs we allocate at once
With commit a309e274632993c5aeec04c6e090f5ac95837a40, we changed the
number of CBRs that we allocate in a chunk from 300 to 1024. However,
this change takes the amount of memory requried to allocate a chunk
of CBRs above PAGE_SIZE on Linux. This changes the allocator that we
use from kmalloc to vmalloc. Whilst we can, and do, prevent kmalloc
from flushing filesystem pages when we invoke it, we don't have a
similar level of control over vmalloc. 1.6 only: limit it back to 300
elsewhere.
In one reported case, clients deadlock whilst attempting to allocate
this memory, in a call stack that looks something like:
Simon Wilkinson [Mon, 25 Apr 2011 12:56:38 +0000 (13:56 +0100)]
Windows: Remove duplicate file
The 'Streamfiles.txt' file had been committed with both that name,
and an all lower case name. This makes git very sad on systems with
case insensitive filenames.
In cm_ReadMountPoint and cm_HandleLink the variable 'thyper'
represets the 'offset' at which cm_GetData should fetch data.
Rename 'thyper' to 'offset' and fix a coding error caused by
misinterpreting the variable purpose.
cm_GetData() drops the cm_scache_t rw lock which permits other
threads to access the data while it is in an inconsistent state.
Avoid the race by using a stack allocated temporary buffer to
receive the data from cm_GetData(). Only copy the data into
the mountPointStringp buffer under the rwlock.
Andrew Deason [Thu, 21 Apr 2011 19:24:45 +0000 (14:24 -0500)]
aklog: Return token when performing 524 conversion
We weren't actually returning a token and username from
rxkad_get_converted_token. Do so.
This is a 1.6-specific change. This issue was fixed on master when
aklog was changed to use the new SetTokenEx family of pioctls in
commit 53837416cbed3ba4d11f63015e1f13800519f2ed.
Andrew Deason [Tue, 12 Apr 2011 21:30:55 +0000 (16:30 -0500)]
libafs: Do not specify an Rx busy channel error
Do not specify an error for Rx busy channels in libafs, so we do not
get notified of busy channel notifications. The current code just
specifies RX_CALL_TIMEOUT for the busy channel error, which has
problems (in particular, for RXAFS calls that are not wrapped in an
afs_Analyze loop). So, disable this behavior.
This is a 1.6-specific change. The master branch will instead get
fixes for this functionality, and it will get turned on in 1.6 again
as appropriate.
OpenBSD: Complete implementation of afs_osi_TimedSleep
The OpenBSD version of afs_osi_TimedSleep() is missing the required
afs_event structure and afs_getevent routine. This update adds them
(by borrowing a copy of the code from the FreeBSD implementation).
Marc Dionne [Sun, 27 Mar 2011 15:20:17 +0000 (11:20 -0400)]
Linux: 2.6.39: deal with BKL removal
For 2.6 kernels the OpenAFS code is already BKL free, but the
corresponding header file smp_lock.h is still included in various
places. This header no longer exists, so remove all occurrences
outside of LINUX24.
Andrew Deason [Fri, 25 Mar 2011 20:54:01 +0000 (15:54 -0500)]
viced: REALLYCLOSE origfdP after CoW
In StoreData_RXStyle, we save a pointer to the original FdHandle_t if
we need to CopyOnWrite the target vnode, for the purposes of possibly
copying additional data later on.
After the CopyOnWrite call, this points to an inode that is not in the
current volume, and is thus less likely to be accessed. In CopyOnWrite
itself, the original file handle is FDH_REALLYCLOSE'd because of this,
so the handle does not remain in the cache. Do the same in
StoreData_RXStyle, so origfdP is always FDH_REALLYCLOSE'd after we
have called CopyOnWrite.
Ben Kaduk [Fri, 17 Dec 2010 06:16:30 +0000 (01:16 -0500)]
new files for FreeBSD packaging at 1.6.0pre3
Packaging for use with FreeBSD's Ports Collection.
The directory layout is flattened, and a couple of files that do not
make sense here are not included.
The afsd rc script lives in packaging/ as it is not runnable in
its committed form, it requires variable substitution that occurs
at install-time from the Ports Collection.
Ben Kaduk [Mon, 22 Nov 2010 04:32:37 +0000 (23:32 -0500)]
Remove outdated rc file for afsd on FBSD
The semantics of rc scripts have changed drastically since this
was written. It will need to be rewritten from scratch; the
new version will live in src/packaging/FreeBSD as afsd.in, as it
is included with the port packaging in that form.
Jeffrey Altman [Wed, 16 Mar 2011 06:17:38 +0000 (02:17 -0400)]
Windows: avoid recursive cm_CheckOfflineVolume
Add a new cm_req_t flag CM_REQ_OFFLINE_VOL_CHK which is used
to prevent cm_Analyze() from performing recursive
cm_CheckOfflineVolume operations that will exhaust the stack.
Andrew Deason [Wed, 23 Mar 2011 16:07:03 +0000 (11:07 -0500)]
DAFS: Do not VDeregisterVolOp_r while exclusive
We should wait for a volume to transition out of an exclusive state
before calling VDeregisterVolOp_r on a volume, since some code may be
examining the vol op outside of VOL_LOCK in an exclusive state. We
should be doing this anyway before performing volume state checks,
since we may be trying to e.g. attach the volume at the same time.
Reviewed-on: http://gerrit.openafs.org/4287 Tested-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit d4ebebd0c3f89b65e93f0da6d53665271e6d2a61)
Russ Allbery [Thu, 24 Mar 2011 19:56:56 +0000 (12:56 -0700)]
Correctly document the AFS client setuid defaults
AFS no longer honors setuid status by default. Update the admin
guide documentation appropriately and add a warning recommending
against enabling setuid status given the limitations of the current
AFS protocol.
Reformat this section of the admin guide to make it easier to
maintain.
Simon Wilkinson [Wed, 23 Mar 2011 15:35:35 +0000 (15:35 +0000)]
rpm: Build srpms without %dist in their name
On RHEL6, %dist is set for all RPMS and SRPMS built on the system. This
leads to makesrpm.pl building SRPMS with .el6 in their release. As we
endeavour to use the same SRPM on all of our Fedora platforms, this is
less than ideal, so change makesrpm.pl to squash the setting of %dist
before building the RPM.
Reviewed-on: http://gerrit.openafs.org/4285 Reviewed-by: Alexander Ivan Redinger <aredinger@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b0921071dd1b4d460d406985bba9619561444055)
Andrew Deason [Fri, 11 Mar 2011 00:37:44 +0000 (18:37 -0600)]
vol: Correct VolumeNumber for large volume IDs
VolumeNumber was using atoi to convert a volume header name to a
volume ID. This can return just -1 for volume IDs larger than 2^31-1,
though, so use strtoul instead.
Andrew Deason [Wed, 16 Mar 2011 19:44:56 +0000 (14:44 -0500)]
salvager: Fix volume parsing on 64-bit
When an unsigned long is wider than an afs_uint32, comparing the
afs_uint32 vid to ULONG_MAX is always going to be false (which the
compiler can warn us about). Fix this by storing to an unsigned long,
and converting to a volume id after ensuring that the result is not
too large.
Andrew Deason [Thu, 17 Mar 2011 15:43:23 +0000 (10:43 -0500)]
viced: Actually print client CPS
Client CPS was not getting output on SIGXCPU like the rest of the
client information, since the conditional in the CPS loop was never
true. Fix this so we traverse the CPS entries correctly.
Reviewed-on: http://gerrit.openafs.org/4256 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5df51a82947f0ff60d57f551c5faa136ad7f6e0f)
DAFS: allow salvager to detect whether FSYNC server is DAFS
in order to enable the right commands and print the right errors,
query for DAFS-only FSYNC op.
doesn't use bozo InstanceInfo as it's possible you can run fileserver
outside of bos.
Simon Wilkinson [Thu, 17 Mar 2011 19:28:23 +0000 (19:28 +0000)]
rpms: Make makesrpm.pl cater for new rpm names
Starting from 1.6.0, our specfile no longer adds a stray '1.' to the
start of the release field. makesrpm.pl was failing to deal with
these new-style names and therefore not actually making an rpm.
Fix this by conditionalising on the OpenAFS version when selecting
which rpm to copy.
Reviewed-on: http://gerrit.openafs.org/4258 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit af854b4e2f19e5f1a83b686e99ca3dd6122af942)
Simon Wilkinson [Sun, 20 Mar 2011 21:13:09 +0000 (21:13 +0000)]
util: Fix exec_alt
exec_alt was failing its tests on Mac OS X (but passing them on Linux).
It turns out that this is because it was failing to NULL terminate the
string that it creates in construct_alt(), which copies in the
characters from argv0, prefix and suffix, but never copies in a trailing
NULL.
Amend the code so that the trailing NULL from suffix is used to
terminate the string.
Reviewed-on: http://gerrit.openafs.org/4267 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8c418408016ff8d6be9f85c4666a49954f61dbd0)
Andrew Deason [Thu, 30 Sep 2010 17:39:22 +0000 (12:39 -0500)]
viced: Allow checkout of VOL_STATE_DELETED volumes
The fileserver allows nonexistent volumes to be checked out. Since
VOL_STATE_DELETED volumes conceptually do not exist, we should also
allow them to be checked out.
Reviewed-on: http://gerrit.openafs.org/2873 Reviewed-by: Tom Keiser <tkeiser@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 88fc9ada4cfaee354199480916d139400ee0ef5b)
Jeffrey Altman [Thu, 18 Nov 2010 02:42:00 +0000 (21:42 -0500)]
Windows: Add CODESIGN_OTHER option to make signtool rules
Some organizations may need to pass additional parameters to
signtool.exe. Add the optional CODESIGN_OTHER value to permit
arbitrary additional parameters to be specified.
Simon Wilkinson [Tue, 15 Mar 2011 00:45:45 +0000 (00:45 +0000)]
Linux: Fix return codes from setpag
Linux is a real stickler when it comes to error codes. Functions
which return positive error codes into the kernel tend to have
unfortunate effects. Because all AFS errors tend to be positive,
most of our kernel entry points negate errors before passing them
back to their caller.
This causes problems when internal functions themselves return
negative error codes. This was the case with the keyring functions,
which ended up returning a negative code to setpag(), this handed
that code ultimately up to the ioctl handler, which negated it (so
turning it positive) before throwing it up to the kernel.
The kernel sees this positive value as being a successful return,
and so passes it direct to userland, rather than assigning it to
errno. This led to the setpag() userspace function never being
aware of keyring errors that had occurred in the kernel.
Fix all this by making sure that all errors from the keyring code
are made positive before being passed upwards in the kernel module.
Reviewed-on: http://gerrit.openafs.org/4223 Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3d92852ba99bc7591515992dfea3436d93c23b85)
Sadly, this change fixed setpag(), but broke all of the pioctls. The
problem is actually a little more nuanced than we at first thought.
What's happening is yet another case of Linux's special handling of
negative return values. When an ioctl handler returns a negative
return code to the kernel, it does errno = -code, and sets the
return code to -1. If you pass it a postive return code, however,
it just returns that straight to the application.
The pioctl code gets this right. However, the setpag code doesn't,
and so tries to return postive values, which is why ioctl appears
to be returning the error code in the return value, not in the
errno.
Reviewed-on: http://gerrit.openafs.org/4222 Tested-by: BuildBot <buildbot@rampaginggeek.com> Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit ff2933a122ddf9421ebcacdc7e4ec5f44333f894)
Jeffrey Altman [Wed, 2 Mar 2011 19:06:48 +0000 (14:06 -0500)]
Windows: avoid use of cm_buf for MPs and Symlinks
In the Windows cache manager, the symlink and mount point
target strings are stored in the cm_scache_t mountPointString
and are not accessed out of the cm_buf_t for offset zero
except when populating the mountPointString. As a result,
every mountpoint and symlink object that is read into the cache
wastes a cm_buf_t which could otherwise be used to store
additional file or directory data.
Add cm_GetData() function which is similar to cm_GetBuffer()
except that it reads data from the file server into an arbitray
memory location instead of a cm_buf_t object. Use cm_GetData()
to read directly into the cm_scache_t object.
In addition, further optimize the communication with the
file server by using cm_GetData() to perform a RXAFS_FetchData
RPC to obtain both the target string and the status information
instead of RXAFS_FetchStatus which only returns the status
information in cases where there are no outstanding callback
registrations on the object. RXAFS_FetchStatus is still used
when a callback is active in order to obtain access permissions
for new users.
Simon Wilkinson [Sun, 13 Mar 2011 14:45:04 +0000 (14:45 +0000)]
pt_util: Initialise empty database correctly
Commit dc8f18d6f5003712bc9ef989363137a84953df07 broke pt_util's
initialisation of empty databases. This is because Initdb was changed
to call Initdb_check through the ubik_CheckCache wrapper. However, that
wrapper was defined as a no-op in pt_util's ubik-shim.
Modify pt_util's ubik_CheckCache so that it always calls into the
wrapper routine - this mimics the old behaviour.
Add a trival test for pt_util - check that we can build the database,
using the example from the manpage, and then that the built database
matches what we expect.
Andrew Deason [Tue, 7 Dec 2010 16:50:31 +0000 (10:50 -0600)]
SOLARIS: Free vcache mappings on shutdown
Right before shutdown, go through all of our vcaches and flush them,
freeing any pages associated with the vcaches. If we don't do this,
pages associated with our vcaches may still be around after we
shutdown and the module is unloaded, causing a panic when the kernel
tries to deference the page's vnode.
Abstract out afs_freevfs() following the gafs_foo/afs_foo convention
from the vnode ops, since we're calling this in two different places.
Derrick Brashear [Thu, 17 Feb 2011 05:04:06 +0000 (00:04 -0500)]
linux: defer vcache evictions when sleep would be needed
because we're only willing to loop 100 times worth of "sleeps",
on a machine with heavy vcache demands we can end up just growing
the list huge. in the first pass, just clean up as many entries which
do not require sleeping as needed. if we need more entries, make
a second pass.
Reviewed-on: http://gerrit.openafs.org/3971 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3105c7ff0b4ae9c372dc4c1424f63b7f259dcda1)
Jeffrey Altman [Wed, 9 Mar 2011 12:51:02 +0000 (07:51 -0500)]
Windows: handle rx busy call channel
Register an error code for rx busy call channel detection.
Force a retry whenever CM_RX_BUSY_CALL_CHANNEL is received
by cm_Analyze(). Log the event to both the internal trace
log and the Windows Event Log along with the server address.
Andrew Deason [Mon, 7 Mar 2011 17:08:26 +0000 (11:08 -0600)]
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.
Bump shlibafsrpc minor version to 5 instead of 3, so we don't collide
with the shlibafsrpc versions on the master branch.
Andrew Deason [Fri, 25 Feb 2011 22:58:30 +0000 (16:58 -0600)]
vol: Check for blank vnode in VAllocVnode_r
When we alloc a vnode in VAllocVnode_r, we look up that vnode in the
vnode cache, to see if a vnode struct already exists for it. If it
doesn't, we check the vnode index to ensure that the vnode actually is
not in use (among other things). However, we do not perform the same
check for a vnode already in the cache. Add this check, to make sure
that we don't allocate an already-used vnode number, even if the
bitmap is screwed up.
Reviewed-on: http://gerrit.openafs.org/4060 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 974e95302a312c03cd735c0fdaa67fb02d254e26)
Andrew Deason [Fri, 25 Feb 2011 22:01:32 +0000 (16:01 -0600)]
DAFS: VnLock after VnWaitQuiescent in VAllocVnode
In VAllocVnode, we write-lock the newly-allocated vnode. In DAFS,
however, we need to VnWaitQuiescent_r before VnLock'ing, since VnLock
in DAFS just sets the writer tid/pid. So, in VAllocVnode, move the
VnLock call to after we wait for quiescence, so we don't stomp over
the vnode when someone else has it write-locked.
Reviewed-on: http://gerrit.openafs.org/4059 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit b41575d176c2d485d55aed8780bfab9db4b7587d)
Andrew Deason [Fri, 25 Feb 2011 20:43:09 +0000 (14:43 -0600)]
DAFS: Wait for exclusive ops in VFreeBitMapEntry_r
VAllocBitmapEntry_r puts the volume in an exclusive state and drops
VOL_LOCK when traversing the volume bitmap and updating the bitmap.
So, VFreeBitMapEntry_r must ensure the volume is not in an exclusive
state, to make sure that VAllocBitmapEntry_r is not updating the
bitmap at the same time. Do so, by waiting for the volume to come out
of exclusive state at the beginning of VFreeBitMapEntry_r.
Andrew Deason [Wed, 2 Mar 2011 20:11:43 +0000 (14:11 -0600)]
vol-salvage: VOL_DONE deleted volumes
When the salvager deletes a volume (because it is an invalid RO clone,
or because there is no data associated with the volume), we should
inform the fileserver that the volume is gone. Otherwise, the volume
in the fileserver can get put into an error state (in DAFS) when it
tries to attach the volume, preventing anything from creating or using
that volume.
Andrew Deason [Wed, 2 Mar 2011 21:39:51 +0000 (15:39 -0600)]
DAFS: Clear salvage stats on VOL_DONE
When we VOL_DONE a volume, the volume has been deleted, so the salvage
stats/information are no longer relevant. Clear them out, so we don't
think the volume is still salvaging.
Andrew Deason [Wed, 2 Mar 2011 21:02:40 +0000 (15:02 -0600)]
DAFS: Allow LEAVE_OFF for DELETED volumes
When a volume is VOL_STATE_DELETED, it effectively does not exist to
other programs over FSSYNC. So, do not prevent someone from issuing a
FSYNC_VOL_LEAVE_OFF for a VOL_STATE_DELETED volume.
Andrew Deason [Wed, 2 Mar 2011 20:10:33 +0000 (14:10 -0600)]
vol-salvage: calloc volume summary structs
Calloc volume summary structs instead of malloc'ing them, in
vol-salvage.c. This way, new fields added to struct VolumeSummary will
be known to be zeroed by default, without needing to update all of the
allocating callers.
Reviewed-on: http://gerrit.openafs.org/4117 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 bb25fc6418bac937b31476754a09199636c24211)
Andrew Deason [Wed, 29 Sep 2010 16:48:44 +0000 (11:48 -0500)]
salvager: Do not break cbks when salvaging parts
When salvaging whole partitions / whole servers, the fileserver is
assumed to not be running. So only break callbacks if we are salvaging
a single volume. If we are salvaging a whole partition, do not tell
the fileserver to break callbacks on changed volumes, since the
fileserver will not be around and we will just hang.
Andrew Deason [Thu, 24 Jun 2010 20:45:05 +0000 (15:45 -0500)]
vol-salvage: Move global vars into SalvInfo struct
Reduce the number of globals used in the salvager code, by making
functions pass around a 'salvinfo' structure that contains the
information regarding a particular salvage.
Commit 335ccb40 introduced positional I/O support for the fileserver,
but didn't handle the largefile versions of preadv and pwritev. As a
result, the fileserver cannot handle files of more than 2Gb in size.
Fix this by using preadv64 and pwritev64 where O_LARGEFILE is defined,
in the same way as for all other I/O primitives.
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-on: http://gerrit.openafs.org/4152 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit bbf406da30428a22b4a6d28a7d36dbb786013cfa)
Simon Wilkinson [Sun, 6 Mar 2011 16:06:36 +0000 (16:06 +0000)]
Disable vectored positional IO if no 64bit support
In order to support vectored positional I/O, and large files, we
need there to be an implementation of preadv64 and pwritev64. If
this isn't present, then just disable HAVE_PIOV.
The ucontext header is only included in lwp.h for platforms that use
ucontext as a means for context-switching in LWP. The preempt module
needs the ucontext header for signal handling on some platforms (at
least Solaris). So, ucontext.h may not be included by lwp.h on these
platforms, if that platform does not use ucontext for LWP
context-switching. So we need to explicitly include ucontext.h in
preempt.c.
Simon Wilkinson [Sun, 26 Dec 2010 14:54:43 +0000 (14:54 +0000)]
Don't trust # of entries from ListAttributes
ListAttributes returns the number of entries in its array as an RPC
argument. But, we can't trust this, as it could be manipulated and
end up pointing past the end of the returned array (which is counted,
so the entries argument is actually pointless).
Add bounds checking to the functions which use this value to prevent
this problem.
The conversion to uvldbentry produced too many negative side
effects. Revisit support for multi-homed servers when vos
is executed from a machine that can only see a random subset
of the addresses assigned to the server in the future.
Andrew Deason [Fri, 4 Mar 2011 17:35:06 +0000 (11:35 -0600)]
viced: Set HWHO_INPROGRESS in CheckHost_r
When we are probing a host in CheckHost_r, set the HWHO_INPROGRESS
flag on the host, so other threads know that the host is locked while
we are waiting for a probe response, and the h_threadquota mechanism
can work correctly.