OpenBSD passes an extra parameter in a call to afs_close()
in its OS-specific code. It went undetected in the past
but now causes compile headaches because of more accurate
prototypes in the header file. This patch removes the
offending extra parameter (which never actually caused any
problems because it was the last one in the parameter list).
OpenBSD: Fix use of macros for AFS_KALLOC/AFS_KFREE
The macro definitions for AFS_KALLOC and AFS_KFREE used by
afs_osi_alloc.c to perform OS-specific memory allocation
are only defined by the OpenBSD osi_machdep.h header file
if they already exist, which means: never. This patch fixes
this situtation and makes sure that afs_osi_alloc.c
actually uses them, eliminating a direct OS-specific call
in afs_osi_alloc.c.
OpenBSD: Remove macros definitions for afs_osi_Alloc et al.
The afs_osi_Alloc, afs_osi_Free, etc. routines are now
defined in afs_osi_alloc.c so the macro definitions defined
by osi_machdep.h for OpenBSD are no longer needed and, in
fact, interfere with the compile. Remove them.
OpenBSD does not retain ruid or rgid values in the
afs_creds_t structure (ucred). This patch, therefore,
removes any references to them in the afs.h file. Since
no attempt is made to actually use the removed code (or
macros) on OpenBSD, at least at this time, this does
not result in any real functional change.
Ben Kaduk [Fri, 14 Jan 2011 01:16:44 +0000 (20:16 -0500)]
FBSD: remove vestiges of Giant
We do not support versions of FreeBSD that used Giant to
serialize access to vnode fields, and we always use the same locking
(which really ought to be MPSAFE). Always set the MPSAFE flags
as needed, and do not bother to call VFS_[UN]LOCK_GIANT which
will never do anything for us.
Andrew Deason [Wed, 12 Jan 2011 16:29:46 +0000 (10:29 -0600)]
SOLARIS: Include sys/varargs.h for kernel stdarg
When compiling for the kernel, pre-10 Solaris seems to want
<sys/varargs.h> instead of <stdarg.h>, as documented in the Solaris
man pages. So include <sys/varargs.h> instead of <stdarg.h> where we
need variable arguments (afs_warn.c).
Reviewed-on: http://gerrit.openafs.org/3653 Tested-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Derrick Brashear <shadow@dementia.org> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 6d03eef7217be8f0b72f34ab023e69c976dea84d)
Ben Kaduk [Mon, 20 Dec 2010 00:33:28 +0000 (19:33 -0500)]
FBSD7: Don't sleep with the glock
On FreeBSD 7.X, vinvalbuf() can (will) sleep; this results in a panic
when the kernel is configured with WITNESS and we hold the glock around
it.
Drop the glock in this case.
Ben Kaduk [Sun, 19 Dec 2010 04:52:44 +0000 (23:52 -0500)]
Bring FBSD 7.X client back to life
Having been untested for quite some time, we had several
places that needed more conditionals to compile on FreeBSD 7.
Now we compile and start on 7.3-RELEASE, but have locking issues
under actual use.
It seems that we are also incompatible with the Heimdal 0.6.3 in
the base system -- aklog is unable to actually obtain the needed
credential when compiled against that kerberos implementation;
using MIT krb5 1.6.3 from ports works without incident.
Marc Dionne [Wed, 24 Nov 2010 00:08:24 +0000 (19:08 -0500)]
Cache bypass: switch to rx_Readv
Tests show that cache bypass doesn't scale very well past a few
concurrent processes, with a lot of lock contention in the RX
layer. Switching the implementation to the iovec based rx_Readv
alleviates much of this.
Also take advantage of the fact that the upper layer readpages
only sends down contiguous lists of pages, and issue larger read
requests and populate the pagecache pages from the iovecs we
get back. The loop logic is changed significantly to accomodate
the new pattern.
Read throughput is improved by about 30-40% for some parallel read
benchmarks I use. Along with some other tweaks, it can allow the
throughput to be more than doubled.
Marc Dionne [Tue, 23 Nov 2010 23:39:33 +0000 (18:39 -0500)]
Cache bypass: Only compile bypass code for the Linux kernel
Only compile the afs_bypasscache.c code if AFS_LINUX24_ENV is set,
since it's currently the only case where the code is actually used.
Only sections that caused problems for UKERNEL were previously
ifdef'ed.
Besides making the code cleaner, the main effect of this change
is to prevent compiling most of the bypass code for UKERNEL where
it isn't currently used.
If support for bypass is added for other platforms eventually, the
code here would need to be reworked anyway, ideally abstracting out
and moving any OS specific bits into the platform subdirectories.
Marc Dionne [Tue, 23 Nov 2010 23:21:16 +0000 (18:21 -0500)]
Cache bypass: remove ifdefs under src/afs/LINUX
Compile cache bypass code unconditionally under src/afs/LINUX
since it is now always enabled. Also remove syslog messages
about a "cache bypass patched module" when loading and unloading
the module.
Marc Dionne [Sun, 7 Nov 2010 20:06:16 +0000 (15:06 -0500)]
Cache bypass: release and unlock pages when we get 0-length reply
In some cases, such as reading past the end of file as known to the
server, fetchdata will get a 0 length reply. Deal gracefully by
unlocking and releasing any pages reserved by readpages. Failure
to do so here leads to deadlocks later as we can exit with some pages
still locked.
Reviewed-on: http://gerrit.openafs.org/3283 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit e4250dc64eb26b5da1480e9f5bd58d016f81847f)
Marc Dionne [Sun, 7 Nov 2010 18:35:36 +0000 (13:35 -0500)]
Cache bypass: adjust read size for non-contiguous readpages
The bypass code's readpages does deal with a non-contiguous list
of pages, but it doesn't adjust the size of the read it requests
from the background daemon accordingly. As a result we'll ask the
server for pages we were not asked to read.
Reviewed-on: http://gerrit.openafs.org/3282 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 0b6b2b3cab09eacf9b03638d8770c83aeb0b8fea)
Marc Dionne [Sun, 7 Nov 2010 18:14:55 +0000 (13:14 -0500)]
Cache bypass: make readpage deal with reads at end of file
When a file's size is an exact multiple of the page size, the vfs
will issue a readpage for an extra page at the end, for which there
is no data. Deal with it here instead of letting it trickle down
to the background daemon, which will issue an unnecessary read to the
server, and maybe get confused because there is no data.
Reviewed-on: http://gerrit.openafs.org/3281 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8ec31f26770ef1e85fb3a6005467f0e2d3ce1715)
Marc Dionne [Tue, 23 Nov 2010 22:50:25 +0000 (17:50 -0500)]
Cache bypass: Remove AFS_KMAP_ATOMIC
Since AFS_KMAP_ATOMIC is defined unconditionally, remove the ifdefs
and the code for the !AFS_KMAP_ATOMIC case. We probably don't want
to support this feature on a kernel old enough not to have kmap_atomic.
This should exist on all 2.6 and even 2.4 linux kernels.
This simplifies the code for maintenance and later changes.
Marc Dionne [Tue, 11 Jan 2011 02:31:18 +0000 (21:31 -0500)]
Cache bypass: fix use of incorrect "states"
Test and set the correct field for cache bypass flags. There was
some confusion between cachingStates and the states associated with
vcache entries in a few places.
Reviewed-on: http://gerrit.openafs.org/3637 Reviewed-by: Matt Benjamin <matt@linuxbox.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 8c541079573274d726180d3d9679c6a26cda84ea)
Marc Dionne [Fri, 5 Nov 2010 00:49:41 +0000 (20:49 -0400)]
Cache bypass: Fix oops in bypass transition functions
The FCSBypass flag might change between the time we check it before
entering afs_TransitionToCaching or afs_TransitionToBypass and when
we check it again within the functions.
Instead of panicing, just exit if someone beat us to it. Also move
the checks within the write lock region to make sure the code
doesn't get run multiple times.
Reviewed-on: http://gerrit.openafs.org/3266 Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit f2c6ae300a211460c24c87752cf9400b9e61ee1f)
Ben Kaduk [Mon, 20 Dec 2010 00:29:17 +0000 (19:29 -0500)]
Zero rx_multi_lock before initializing it
FreeBSD's kernel debugging facilities will panic if it detects
an attempt to re-initialize an already-initialized lock, as detected
through some particular bits being nonzero. Zero everything out
before starting, to prevent this panic.
Tom Keiser [Wed, 13 Oct 2010 05:16:25 +0000 (01:16 -0400)]
provide more verbose logging when VGetVolumeByVp_r fails
FSYNC_com_VolOff() commits sepuku when VGetVolumeByVp_r() fails to return
a heavyweight ref to the volume. This small patch provides more detailed
debugging information so we have a better idea why VGetVolumeByVp_r failed.
Reviewed-on: http://gerrit.openafs.org/2969 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3f0c08ad93bf98fbe64d5714649d675712410cc9)
Ben Kaduk [Sun, 19 Dec 2010 05:06:13 +0000 (00:06 -0500)]
FBSD: StopListener glocking fixup
afs_osi_Sleep requires the glock (so that it can sleep on it); we
dropped the glock earlier in osi_StopListener because soshutdown and
soclose can sleep, but we must (unconditionally!) acquire it for our
loop waiting on rxk_ListenerPid.
Andrew Deason [Thu, 11 Nov 2010 20:45:04 +0000 (14:45 -0600)]
vos release: Avoid full dump on all sites
Commit 9fed169b1c5c823fd96cea94daf712b2cf06c901 attempts to remove any
remote RO site that has RO_DONTUSE set. However, we set RO_DONTUSE on
all sites earlier in the release process if this is a full release,
resulting in all sites getting a full dump.
Correct this by remembering in 'origflags' what flags each site has
before we messed with the vldb entry.
Thanks to Mike Meffie.
Reviewed-on: http://gerrit.openafs.org/3296 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit 97474963e58253f8c891e9f6596403213d53527b)
Simon Wilkinson [Sun, 26 Dec 2010 14:14:38 +0000 (14:14 +0000)]
volser: Fix broken bulk conversion
The converstions between the original, N and U bulk list return
values were all broken in various ways:
1/ Shifting from malloc to xdr_alloc() (in 4f1efdc8b73ed)
subtly changed the behaviour when handling an empty list. The
correct XDR representation of an empty list is {0, NULL}, not
{0, &memZero}. Fix the code so that if the source list is empty,
an empty destination list is returned.
2/ The destination list length was never being filled in. This means
that xdr_free() could not be safely used on this list, as the wrong
length would be passed to the allocator. Fill in the destination
list length as part of the conversion.
3/ xdr_free(...) is a no-op when called with an empty list - there's
no need to check before calling it. Remove these checks to improve
the code's readability.
4/ xdr_free(...) should only be called when the RPC returned
sucessfully. The stub is responsible for freeing data should the call
fail mid way through unmarshalling.
5/ Where an RPC returns the number of entries independently of the
length of a counted array, it is unsafe to use that length to
iterate the array without checking that it is within the array
bounds. Instead, just use the array length when performing
conversions.
Simon Wilkinson [Sun, 26 Dec 2010 14:00:42 +0000 (14:00 +0000)]
vos: Abstract out bulk list conversion
Pull the various segments of code that do bulk list conversion into
their own functions. This is purely code reorganisation at this point,
fixes for these functions will follow in subsequent patches.
Ben Kaduk [Sun, 24 Oct 2010 04:29:07 +0000 (00:29 -0400)]
FBSD: band-aid vnode locking in lookup
The lock order requires that we acquire vnode locks from the root
towards the leaf. When looking up "..", this requires that we
unlock the directory before locking the child, otherwise we
are susceptible to deadlock.
This is only a band-aid, as afs_vop_lookup should be rewritten.
Ben Kaduk [Sat, 6 Nov 2010 04:02:31 +0000 (00:02 -0400)]
FBSD: close race in afs_root
Previously, we called afs_PutVCache(afs_globalVp) directly. This
is unsafe because PutVCache acquires locks which can sleep, losing
the serialization of the GLOCK. In rare circumstances, this can
result in two threads simultaneously making that call, and the
second one would panic in vputx() with a negative refcount.
Close the race by using a local variable for the afs_PutVCache()
calls, applying the change to afs_globalVp before dropping the GLOCK.
While here, fix up other race conditions.
Andrew Deason [Wed, 10 Nov 2010 15:11:47 +0000 (09:11 -0600)]
Use afs_foff_t for file offsets
Some callers in vol and volser were not using afs_foff_t for file
offsets for calls to STREAM_ASEEK, FDH_TRUNC, FDH_PREAD, or
FDH_PWRITE. Most notably, in code for volume cloning, purging, and
dumping operations. Fix them to use afs_foff_t to prevent errors when
dealing with large special files.
Russ Allbery [Fri, 24 Dec 2010 18:53:22 +0000 (10:53 -0800)]
Update NEWS for 1.5.78 and 1.6.0pre1
Based on the release notes. Add an entry for 1.6.0 with in progress
instead of a date to hold the release notes for 1.6.0pre1 rather than
creating separate entries for each release candidate. Users who track
the release candidates can refer to the public announcements, and this
will be cleaner when reading history later on.
Andrew Deason [Tue, 21 Dec 2010 15:31:39 +0000 (10:31 -0500)]
LINUX: Avoid unnecessary afs_ShakeLooseVCaches
Before some of the NewVCache refactoring, we only called
afs_ShakeLooseVCaches when afs_vcount was over (or equal to)
afs_maxvcount. Do this again, so we only try to shake loose vcaches
when we need more vcaches. Otherwise, we will call
afs_ShakeLooseVCaches every single time we want a new vcache when
dynamic vcaches are disabled (such as 2.4 Linux), and we log a warning
when we can't free any (which is likely when there are only 1 or 2
vcaches in use).
FIXES 128756
Reviewed-on: http://gerrit.openafs.org/3569 Tested-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fa4b1f3aeb33c28b2d8e2724542d1696fcc87773)
Andrew Deason [Mon, 20 Dec 2010 22:29:37 +0000 (17:29 -0500)]
Cache bypass: remove ifdefs under src/afs/LINUX24
Same as commit 9657695d34badaac654227be8c731a1512f2106b, but for
LINUX24. Remove the AFS_CACHE_BYPASS references in LINUX24, since it
is always enabled. Also remove messages about a "cache bypass patched
module".
Reviewed-on: http://gerrit.openafs.org/3568 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 64e564b29e95898a6eb85dc527d046aab241fb8f)
Marc Dionne [Tue, 23 Nov 2010 23:21:16 +0000 (18:21 -0500)]
Cache bypass: remove ifdefs under src/afs/LINUX
Compile cache bypass code unconditionally under src/afs/LINUX
since it is now always enabled. Also remove syslog messages
about a "cache bypass patched module" when loading and unloading
the module.
Derrick Brashear [Tue, 21 Dec 2010 13:58:31 +0000 (08:58 -0500)]
DARWIN: make growlagent build not run afoul of ._ fun
in some cases a git checkout would promptly merge the ._ file away,
meaning a subsequent build would fail. just use the developer tools
to set an icon instead of clever tricks.
Andrew Deason [Sun, 21 Nov 2010 23:57:22 +0000 (18:57 -0500)]
Solaris: Support -i in shlib-build
Our librokenafs.map file contains symbols that we may not actually
define, since the list of exported symbols varies depending on the
platform's capabilities. This causes errors during linking, which can
be suppressed by marking all symbols as "= EXTERN". Do so by having
shlib-build modify the mapfile at link-time, when -i is specified to
indicate ignoring undefined symbols.
Andrew Deason [Tue, 23 Nov 2010 03:54:32 +0000 (22:54 -0500)]
Only specify CFLAGS_NO* with --enable-checking
Currently we are always specifying e.g. CFLAGS_NOUNUSED as -Wno-unused
when we think we are compiling with gcc. Since autoconf always tries
to use gcc when possible, this breaks the build if we have a gcc
available but we use another cc for building.
This should be fixed otherwise, but in the meantime at least make this
only happen if warnings are actually turned on, so the build is less
likely to break with a default ./configure invocation.
Anders Kaseorg [Sat, 6 Nov 2010 07:03:19 +0000 (03:03 -0400)]
Linux: Fix AFS_NORETURN violation with osi_AssertFailK
Commit d86f0c44d3c5910a6b54895484dc0286eac9bc73 changed the
AFS_LINUX26_ENV implementation of osi_AssertFailK so that it returns,
contradicting its AFS_NORETURN prototype, in an effort to make the
following BUG() display the right line number. To fix this, move the
returning implementation into its only caller, the osi_Assert macro.
This fixes possible compiler misoptimizations due to
rx_kcommon.c:255:1: warning: ‘noreturn’ function does return
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/3276 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1519144f83925d82117f31ce0872f77660f197ee)
Andrew Deason [Thu, 9 Dec 2010 00:16:14 +0000 (18:16 -0600)]
Add ioctl-based AFS calls for Solaris 11
Switch from using syscall-based AFS calls to ioctl-based AFS calls,
since syscall 65 was repurposed in some kernels in Solaris 11 and
OpenSolaris. Update the provided afs init script to accomodate the
additional steps needing for starting the AFS client.
Partially based off of some work by Derrick Brashear.
Andrew Deason [Thu, 9 Dec 2010 19:02:16 +0000 (13:02 -0600)]
DARWIN: Fix setpag syscall error detection
Darwin uses the same variable as the return value for
ioctl_afs_syscall, and as the last 'out' parmater, so the return value
for ioctl_afs_syscall will always overwrite whatever is written to the
last 'out' parameter. Instead, record two different variables, and
allow the returned error to overridte the error set as the last
parameter.
Andrew Deason [Thu, 4 Nov 2010 15:57:30 +0000 (10:57 -0500)]
UKERNEL: f_fsid is a struct on AIX
The statvfs f_fsid member is a struct with two fields on AIX when
_ALL_SOURCE is defined (which we define to get various extensions). So
in the AIX case, use it as such a struct instead of a single integer.
Christof Hanke [Fri, 19 Nov 2010 20:30:21 +0000 (21:30 +0100)]
use proper 64bit casting for pointer-math
building with "./configure --enable-checking --enable-supergroups"
fails, because on 64bit, the casting in map.c gives a warning.
Just add another ifdef and cast according to the size of a pointer.
Marc Dionne [Fri, 5 Nov 2010 21:30:02 +0000 (17:30 -0400)]
Linux: define llseek operations
With kernel 2.6.37 it is now mandatory to define the llseek operation
for files and directories. If these are not defined, no_llseek is
called, and any attempt to seek returns ESPIPE.
Most file systems use generic_file_llseek, but it seems safer to use
default_llseek which is what the vfs used to call for us by default.
In 2.6.37 these two functions are actually functionally identical.
Jeffrey Altman [Sun, 6 Jun 2010 15:03:44 +0000 (11:03 -0400)]
Convert from using nvldbentry to uvldbentry
The support routines relied upon by vos use the older nvldbentry
data structures which do not include the UUID for the server.
This patchset updates the code to use the uvldbentry structure
so that a future patchset can make use of UUID values when available.
Any functions from vsprocs.c which are referenced by vos.c are
considered public. This includes all of the VL_xxxx, UV_xxxx
and Lp_xxxx functions, the EnumerateEntry, SubEnumerateEntry, and
host mapping functions. For any which references an nvldbentry as a
parameter a new 'U' version is created that accepts a uvldbentry.
These new 'U' functions are then used throughout vos.c and the internal
routines.
Andrew Deason [Thu, 30 Sep 2010 16:34:59 +0000 (11:34 -0500)]
volser: Do not FSYNC_VOL_DONE temporary volumes
Currently, the volserver just looks at the destroyMe field in a volume
header to see if it should tell the fileserver a volume has been
deleted (FSYNC_VOL_DONE opcode). However, temporary volumes created by
the volserver (such as new volumes or clones) have destroyMe set, but
are obviously not deleted, and so the fileserver should just be told
FSYNC_VOL_LEAVE_OFF about these volumes instead.
Note that this commit slightly changes the meaning of the
vp->needsPutBack field. Now it must be set to VOL_PUTBACK_DELETE to
tell the fileserver that the volume has been deleted, and set to
VOL_PUTBACK if it just needs to be given back to the fileserver.
Andrew Deason [Fri, 5 Nov 2010 21:48:28 +0000 (16:48 -0500)]
vol: Do not give back not-checked-out vols
VAttachVolumeByName_r has logic to give back a volume over FSSYNC if
we checked out a volume but failed to attach it for whatever reason.
However, the logic used for determining if the volume was checked out
or not is a bit inaccurate (even moreso than the comments imply),
potentially causing us to VOL_ON volumes that don't exist at all.
Instead of trying to guess based on various conditions whether or not
we checked out the volume, keep track of a variable that is only set
when we actually checkout the volume from the fileserver. Then only
give back the volume if it is set.
Andrew Deason [Fri, 5 Nov 2010 19:34:05 +0000 (14:34 -0500)]
DAFS: Do not let VScheduleSalvage_r free vp
In VScheduleSalvage_r, we were calling VCancelReservation_r, which has
the possibility of free'ing vp. Since we still use vp after doing this
(and since we're already inside VCancelReservation_r to begin with),
we must not free vp. Instead, just decrement nWaiters without
triggering any of the dtor code in VCancelReservation_r. This is safe
as long as all VScheduleSalvage_r callers ensure that they check to
free the vp if necessary, which they all do.
Ben Kaduk [Sun, 28 Nov 2010 04:25:03 +0000 (23:25 -0500)]
FBSD: clean up rx_socket teardown
We had previously been waiting for the SO_ISDISCONNECTED flag
to show up in the so_state field, but the flags are not really
used for stateless protocols such as UDP, and that flag never
shows up. Even with a full three-second wait, the rxk_Listener
sometimes still failed to fully terminate, preventing the reuse
of the rx port for a restarted afsd.
Copy from Solaris and loop until rxk_ListenerPid is zero, doing
bogus one-byte NetSends in the body of the loop.
Reviewed-on: http://gerrit.openafs.org/3391 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 622403c87a8cbcedcd1212fd32414285d103887b)
Ben Kaduk [Sat, 27 Nov 2010 04:28:50 +0000 (23:28 -0500)]
Catch up on FBSD releases
Add param.foo.h and sysname entries for the past and forthcoming
FreeBSD 7.2, 7.3, 7.4, and 8.2 releases. Also update the
MakefileProto.FBSD.ins that need touching, simplifying the libuafs
one in the process.
properly mark servers down for rx errors except OPCODE
if we get a negative (rx) error, it means the server is down,
*except* for RXGEN_OPCODE. make this handling consistent
(cherry picked from commit be770d4336c2fd7b8a83f18577ae6bb23a3f3e99)
The osi_PostPopulateVCache() routine in the OpenBSD version of
osi_vcache.c tries to use the non-existent variable "vc" instead
of "avc". This fixes it.
OpenBSD: Fix use of mstat Length field in osi_vm.c
The code for osi_VM_FlushPages() in osi_vm.c for OpenBSD incorrectly
tries to access field "m.Length" in the vcache structure "avc"
instead of "f.m.Length".
OpenBSD: Use Darwin version of afsi_SetServerIPRank() for OpenBSD 4.7 and above.
With OpenBSD 4.7, the ia_subnet and ia_subnetmask fields have been removed
from the in_ifaddr structure as part of a cleanup that considers them
unnecessary. Thus, the version of afsi_SetServerIPRank() that OpenBSD was
using no longer compiles. On the other hand, the Darwin version of this
routine seems suited to OpenBSD's needs since it doesn't use those fields
so we'll use that version for OpenBSD 4.7 and above instead.
Darwin: Assign correct value to myDstaddr in afsi_SetServerIPRank()
The value in sin->sin_addr.s_addr that's assigned to myDstaddr in the
Darwin version of afsi_SetServerIPRank() is in network byte order but
really needs to be in host byte order.
Note: This patch assumes that change I66f5c790d8c55b359e3550b6d71f3abe040a2820
has been previously installed. The patch fails otherwise.
Reviewed-on: http://gerrit.openafs.org/3402 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2822416059fe192dc7e3c261b1e93510f2f10f3e)
Change-Id: I6fba524733ecf35e60419d449838e93a7a5255a6
Reviewed-on: http://gerrit.openafs.org/3452
DARWIN: Fix processing using rx_ifaddr_* macros in afsi_SetServerIPRank()
The macros rx_ifaddr_address, rx_ifaddr_netmask, and rx_ifaddr_dstaddress
all expand to a call to memcpy() which returns the destination address as
its return value. The test in the DARWIN version of afsi_SetServerIPRank()
for completion when using this macro, however, seems to assume that success
returns zero, which is wrong and results in myAddr, subnetmask, and
myDstaddr always being set to zero. This patch corrects this behaviour.
RedHat: Remove potpourri.h from RedHat SPEC file manifest
potpourri.h is no longer needed, so it should be removed from the
list of files to be installed. The missing file was causing the
RPM package build process to fail.
Jeffrey Altman [Tue, 2 Nov 2010 20:16:20 +0000 (16:16 -0400)]
Windows: Do not leak cm_volume_t objects from the LRU queue
During cm_volume_t object recycling the object is removed
from the LRU to ensure that a single object is not recycled
by multiple threads at the same time. Before cm_FindVolumeByName()
exits the object must be re-inserted into the LRU if it is not
present.
as discovered by Benjamin Kaduk, we were usually holding rx_refcnt_mutex
but briefly, and here we held it longer, and thus around acquiring freepktQ
mutex. undo it by simply setting STATE_RESET sooner as newcall does.
Rx: protect rx_conn and rx_call refCount field with rx_refcnt_mutex
Add a new global mutex rx_refcnt_mutex to protect the conn->refCount
and call->refCount in place of relying upon the conn->conn_data_lock
and the call->lock.
This will relieve some lock contention with rx_ReceivePacket().
Rod Widdowson [Thu, 28 Oct 2010 17:34:41 +0000 (18:34 +0100)]
Windows: fix built in touch
Recent versions of windows add a whole bunch of attributes above
A_ARCH. (FILE_ATTRIBUTE_NOT_CONTENT_INDEXED was what bit be but
encryption of compression would do it).
This makes ~_A_ARCH not a good choice for testing nonwritability
of a file - so files with these new attributes just get silently ignored.
Using an explicit mask is much better. So do that.
Marc Dionne [Wed, 27 Oct 2010 00:33:41 +0000 (20:33 -0400)]
bucoord: parallel make fix
Fix an instance of a Makefile rule with multiple targets.
This can cause a parallel make to fail when two instances of
compile_et compete to write the same output files.
Spotted by a build failure with a corrupt bc.h header.
Jeffrey Altman [Thu, 28 Oct 2010 05:19:17 +0000 (01:19 -0400)]
Windows: Finish converting vol apps to pthread only
The src/vol directory on Windows is one of the rare examples
where a single directory builds both lwp and pthreaded versions
of libraries and executables. With this patchset the executables
are fully converted from lwp to pthread. This requires that
afsrpc.dll include the pthread implementations of the threadname,
fasttime, and lock implementations from the LWP directory.
The inclusion within afsrpc.dll permits the dviced and
dvolser directories to avoid rebuilding those object modules.
Ben Kaduk [Fri, 29 Oct 2010 16:01:04 +0000 (12:01 -0400)]
FBSD: lock interlock around v_usecount accesses
The FreeBSD vnode locking strategy requires that the vnode
interlock be held for all accesses to v_usecount, such as those
used by our VREFCOUNT and VREFCOUNT_GT macros. Conveniently,
a wrapper function is provided that takes the lock around its
access of the element, vrefcnt(). Use it for our macros.
Ben Kaduk [Fri, 29 Oct 2010 07:18:02 +0000 (03:18 -0400)]
FBSD: correct and simplify vcache eviction routines
osi_VM_FlushVCache and osi_TryEvictVCache were both attempting
to be wrappers around vgone(), with some checks before hand.
Implement the latter in terms of the former to prevent
code duplication and propagation of incorrect code.
Additionally, correct the locking around vgone(). The
vnode lock must be held, and we must also increase the vnode's
hold count so that it does not disappear out from under us.
As we need the interlock to check the usecount, keep it
locked until we lock the vnode lock, for extra protection.
As an added bonus, we no longer try to call vgonel(), which
is not an exported symbol and merely happened to work due
to the current kernel linker implementation.
Remove some stale comments.
With this change, a parallel buildworld completes on
my four-core machine.
Phillip Moore [Tue, 19 Oct 2010 15:31:47 +0000 (11:31 -0400)]
fs getfid defaults to '.', like other path-related commands
I noticed that all of the other commands that accept a list of paths
use the SetDotDefault() function to default to ".", when no arguments
are given. This patch adds that call to getfid, making it more
consistent with similar commands.
Phillip Moore [Tue, 19 Oct 2010 15:23:46 +0000 (11:23 -0400)]
fs getfid output changed for consistency with Windows implementation
This patch removes the redundant volume ID from the output of fs
getfid, and replaces it with the cell name, which is what the Windows
implementation provides.
Phillip Moore [Tue, 19 Oct 2010 12:24:41 +0000 (08:24 -0400)]
Makes fs getfid error handling consistent with other fs commands
This patch makes the fs getfid command print errors for paths that
can't be handled correctly, instead of quietly ignoring them, and it
also returns an error code if any such paths are encountered. This
makes the behavior consistent with other fs commands, such as
listquota, whereis, etc.
Phillip Moore [Tue, 19 Oct 2010 16:17:20 +0000 (12:17 -0400)]
Fix fs bypassthreshold to accept a size of -1 to disable
The fs bypassthreshold command assumes a value of -1 means the feature
is disabled, but the CLI refused to accept this argument, since it is
not strictly a digit (according ti isdigit()). This patch accepts the
string -1, and makes it possible to both enable AND disable this
feature.
Reviewed-on: http://gerrit.openafs.org/3009 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1fa575c09ea7aa66e657b226465cb90dbba4af70)
Change-Id: I0e748b513bcb97c436bd10c8a80222fc10fce08c
Reviewed-on: http://gerrit.openafs.org/3228