Simon Wilkinson [Fri, 16 Jul 2010 20:58:33 +0000 (21:58 +0100)]
Linux: Load exportfs first
The changes to use the exportfs interface to access cache files
require that the exportfs module is loaded before our module.
In 'normal' operation depmod, and modprobe, would take care of
this for us, however our legacy installation format where we
ship the kernel module outside of /lib/modules stops modprobe from
working, and our init script uses insmod. So, explicitly load
exportfs first.
Note: I'm aware of just how much this sucks, and the fact that we
really should just tidy up all of the packaging and init scripts
around our kernel module - but this close to 1.6 branch is probably
not the time for those kinds of changes.
Rename configure.in and configure-libafs.in to use the *.ac extension
instead, which is preferred by current Autoconf versions for input
files to Autoconf. *.in can then be more consistently used for files
that are input into config.status.
Add a preprocessor for POD documentation that handles a custom
=include directive. Demonstrate how to use the preprocessor by
factoring out all the standard PTS options into a separate POD
fragment and including that fragment in all the PTS commands that
take the standard options instead of including that documentation
in each separate file.
Remove obsolete configure options and document all remaining options
other than some provided by Autoconf and some that are currently not
very interesting.
Document that, on modern Linux systems, configure can find the kernel
build system and headers by itself and doesn't need the flag.
Include some more information in README about changing the default
installation paths, and mention that the da* versions of the file server
and volserver also aren't stripped.
Remove the generic GNU installation instructions, which aren't useful
for OpenAFS.
Now that we have a build-tools directory, move the various support
files used by Autoconf and Automake into it as well to reduce clutter
at the top level.
Marc Dionne [Thu, 15 Jul 2010 02:43:01 +0000 (22:43 -0400)]
afspag version of rx_knet.o
in order to correctly generate KBUILD_MODNAME, each object
file needs to be built only once. in this case it matters because the
pr_debug macro, called as a result of including errqueue.h, needs it
and things which depend on it, and when it's built into 2 .kos,
the wrong thing happens.
Debian packaging can deal with the full version number that we
generate using git-version, so base the version we put into
src/packaging/Debian/changelog on that version instead of the
LINUX_PKGVER that we use for other packaging.
The source package we would get by running dpkg-buildpackage in the
source tree without further preparation is basically useless, since
it's a native source package for a non-native package and will contain
any random dirty cruft in the current source tree. Since the purpose
of make dpkg is to provide quick Debian packages for testing purposes,
only build the *.deb files and don't bother to build the source
package.
0xffffffff is a bad representation for -1 when the size of the data
type may vary. Rather than forcing everything to 32 bits and losing
later on platforms with 64-bit time_t, change the table to use time_t
and try to add a cast that will do the right thing.
Andrew Deason [Thu, 8 Jul 2010 20:59:58 +0000 (15:59 -0500)]
RX: ignore all local 127/8 IFF_LOOPBACK interfaces
Currently RX lists all non-127.0.0.1 interfaces in the interface list,
even those that are specified as IFF_LOOPBACK, to accomodate certain
special cases where IFF_LOOPBACK interfaces should be advertised.
However, this makes us advertise e.g. a 127.0.0.2 lo interface. So
instead, skip all interfaces that are both in 127/8 and claim they are
IFF_LOOPBACK, as this will skip a stray 127.0.0.2, but should not
confuse the special cases.
Andrew Deason [Thu, 8 Jul 2010 15:56:28 +0000 (10:56 -0500)]
Treat all 127.0/16 addresses as loopback
Many places treat loopback addresses specially; they are skipped over
when traversing local interface lists, and they are sometimes replaced
with the public IP of the local hostname when interpreting user
arguments.
However, we only treated 127.0.0.1 as 'loopback'. Many systems can
have more than one loopback interface, such as having an interface
with the address 127.0.0.2. So, to catch these, treat everything in
127.0/16 as a loopback address or otherwise 'invalid' address. We
still do not treat the rest of 127/8 like this, to still allow some
127.* addresses to not be treated as loopback if someone really wants
to.
Rewrite FUSE macro to skip FUSE if not found unless --enabled
If no configure flags are given, build the FUSE afsd iff FUSE is
found. If --enable-fuse-client is explicitly given, always try to
build the FUSE client and abort if FUSE libraries could not be found.
Marc Dionne [Wed, 14 Jul 2010 13:52:03 +0000 (09:52 -0400)]
Linux: use an int pointer for the size argument to getsockopt
getsockopt expects an int pointer as the size parameter, both in
the kernel version and our replacement compat inline function, which
causes warnings because we give it a size_t pointer.
Don't overflow a buffer on the server's stack at startup
The servers like to log the command line it was invoked with.
It does this by concatenating its arguments, separated by spaces,
into a 150-character buffer on the stack of main(). That's just
wrong. Use a dynamically-allocated buffer instead.
Andrew Deason [Fri, 25 Jun 2010 22:02:54 +0000 (17:02 -0500)]
Add -unsafe-nosalvage fileserver option
Provide a runtime flag to the DAFS fileserver to allow for
fast-restart-like behavior for DAFS. Call the flag -unsafe-nosalvage, and
document it, warning against its use.
This update now builds shared library packages for the libafsauthent
and libafsrpc shared libraries. It should also fix problems with
make dpkg due to debian/changelog being deleted on make distclean.
It's pointless to have make dpkg build the tree before running the
Debian build rules, since the Debian build rules are just going to
build the tree again.
libafsauthent includes auth/cellconfig.c, which uses res_search, so it
requires -lresolv even if it isn't needed for gethostbyname. Add
LIB_AFSDB to the link line for libafsauthent.
libafsauthent includes auth/cellconfig.c, which uses res_search, so it
requires -lresolv even if it isn't needed for gethostbyname. Add
LIB_AFSDB to the link line for libafsauthent.
DAFS: variable declarations in C must be a top of block
Two instances of variable declarations not being present
at the top of a code block in src/vol/volume.c when building
with AFS_DEMAND_ATTACH_FS. Fix them.
Add a "check" rule to each of the docbook directories
that uses xmllint.exe (from Cygwin) to validate the
docbook source against the DTD. Validation failures
will halt the build.
Michael Meffie [Mon, 19 Apr 2010 14:00:52 +0000 (10:00 -0400)]
viced: host hash address collisions
Attempt to resolve collisions when adding a host to the
address hash table and another host with the same address:port
is already present in the hash table. Retrieve the uuid for
the host at that address and if the uuid matches the new host
and not the old, remove the address from the old host and
install the new host into the address hash.
Change-Id: Id182f907f63be556c61ffb91777edd35f0aa950d
Reviewed-on: http://gerrit.openafs.org/1786 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Thu, 8 Jul 2010 21:40:07 +0000 (16:40 -0500)]
GetInodeSummary: free inode info
In the salvager, GetInodeSummary stores some information about the
relevant inodes into a file. Free the memory for that information
after it's been written out, since we don't reference that memory
again.
Matt Benjamin [Thu, 24 Jun 2010 13:07:36 +0000 (09:07 -0400)]
An RPC test dispatch library for vice
A library framework for remote testing against file servers,
with the ability to establish multiple call/callback channel
pairs within a single test process and dispatch requests
arbitrarily on each. Thanks to Derrick for design and debugging
help. Additional callback processing intelligence will follow
in a future changeset. This version builds on Windows NT (but
might need further adjustment).
Simon Wilkinson [Sat, 10 Jul 2010 19:30:31 +0000 (20:30 +0100)]
Linux: Actually use freezer compatibility func
We were calling try_to_sleep, rather than afs_try_to_sleep. Whilst
try_to_sleep is present in all modern Linux kernels, on some older
systems we need to fall back to our own implementation, which is
what the afs_try_to_sleep function should do, but it can only do so
if we call it.
Simon Wilkinson [Sat, 10 Jul 2010 19:17:56 +0000 (20:17 +0100)]
Linux: Use freezer compatibility macros in RX
Commit eef18466d920985c37ed8d22a6557b609c6225a6 introduced some
compatibility macros for the refridgerator functionality. Use these
in the Linux kernel RX code, rather than rolling our own.
Autoconf apparently doesn't care because it runs it explicitly under
a shell, but it's sometimes useful to run it manually to check
something. Plus, executable shell scripts should be executable on
general principles.
Andrew Deason [Wed, 7 Jul 2010 20:43:26 +0000 (15:43 -0500)]
Use afs_sfsize_t for *_SIZE results
Callers of FDH_SIZE and OS_SIZE should be storing the results in an
afs_sfsize_t. Some were using regular 'int's and other things, which
can screw up if the file is sufficiently large.
Ben Kaduk [Fri, 9 Jul 2010 04:38:16 +0000 (00:38 -0400)]
Remove incorrect critical section use in dnlc_lookup
Critical sections may not be used with (non-spin) locks. As such,
this code was wrong, and led to a panic.
We don't see why there what synchronization they may have been
providing, so just remove them and do not replace them.
Michael Meffie [Thu, 8 Jul 2010 18:45:22 +0000 (14:45 -0400)]
build fix on older linux
The commit d0abe56aa47d4561ba57527d53a2b0db2ea613c2 added
a duplicate inclusion of freezer.h. Older versions
of linux (circa 2.6.20) are missing include guards
on freezer.h.
Andrew Deason [Fri, 2 Jul 2010 19:28:29 +0000 (14:28 -0500)]
Fix VPrintDiskStats_r logging
VPrintDiskStats_r tried to log some information using separate Log()
statements on the same line. This looks very odd when logged, since we
add a timestamp to every Log() call these days. Fix it to print the
line as one call to Log().
Ben Kaduk [Thu, 8 Jul 2010 02:10:44 +0000 (22:10 -0400)]
Fix build
Previous commit to this file was not as tested as we thought.
This one actually builds (well, except for the part where flex
doesn't like et_lex.lex.l at the moment).
Ben Kaduk [Thu, 8 Jul 2010 00:47:55 +0000 (20:47 -0400)]
FBSD: sync with NFS for *pages vnops
We've had per-cpu counter variables for a while, use the proper
macros to adjust them.
FBSD90 has had the page queue locks pushed down a level, so we
don't need to lock them and should lock individual pages instead.
This fixes mmap() on FreeBSD HEAD.
Andrew Deason [Wed, 7 Jul 2010 17:52:10 +0000 (12:52 -0500)]
klog: refactor klog_prompter
The ifdefs in klog_prompter were getting a bit confusing. Split out
some logic into a separate "is this prompt a password prompt"
function. As a result, we can build without KRB5_PROMPT_TYPE_PASSWORD
defined, which happens to be the case on hp_ux11i.
Change-Id: I1d5f794bfc33017f699478e367cde91a3e77d33c
Reviewed-on: http://gerrit.openafs.org/2353 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
kernel InitPeerParams has bogus branching and dup code
several of the mtu configuration cases for the kernel version
of InitPeerParams were bogus. clean up the function.
(a forthcoming change reworks this anyway, but..)
Andrew Deason [Tue, 6 Jul 2010 19:41:13 +0000 (14:41 -0500)]
HPUX: make osi_procname a stub
It is not immediately clear how to obtain the current process name on
HPUX, and the current osi_procname definition breaks the build, so
just make osi_procname a stub for HPUX.
Ben Kaduk [Sun, 4 Jul 2010 06:28:02 +0000 (02:28 -0400)]
FBSD: always close the rx socket when shutting down
The soclose(rx_socket) call is needed in order to restart AFS.
(Otherwise sobind() fails with EADDRINUSE.)
While here, use the defined constant SHUT_RDWR instead of
hardcoding '2' for soshutdown's second argument.
Ben Kaduk [Sun, 4 Jul 2010 02:58:39 +0000 (22:58 -0400)]
Do not recurse on the glock in rxk_NewSocketHost
If sobind() failed, we would lock the glock before going to bad,
which proceeded to lock the glock, panic()ing on the recursion attempt.
Remove the unneeded first call.
The executable %{_bindir}/kpasswd was included in the
the 'openafs' base package.
This change removes the kpasswd executable from the base package. It
is still built and is installed in the 'openafs-kpasswd' package. I
believe this was the original intent of the 'openafs-kpasswd' package.
Andrew Deason [Tue, 29 Jun 2010 18:19:11 +0000 (13:19 -0500)]
DAFS: Salvage VG on volume creation error
When trying to create a volume (either an entirely new volume or a
clone), request a demand-salvage on that volume group if we hit an
unexpected error. This can allow some situations to automatically
rectify themselves if, for example, a volume is missing its .vol
header, but still otherwise exists and causes an error during a clone.
Andrew Deason [Tue, 29 Jun 2010 19:44:31 +0000 (14:44 -0500)]
DAFS: Allow FSSYNC salvages on unknown volumes
Allow salvage requests over FSSYNC (FORCE_ERROR with the FSYNC_SALVAGE
reason code) that are requested on volumes that we do not know to
exist. This can be helpful if a salvage is requested on a volume that
someone attempted to create but failed, indicating that a
partially-created volume may be in the way.
Log an additional message when we do this, as it should not be a
normal occurrence.
Change-Id: I6e1bbe35111a41c489fe85cad36e6a8a6f323a5a
Reviewed-on: http://gerrit.openafs.org/2285 Reviewed-by: Tom Keiser <tkeiser@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
cache-bypass explicitly reference pages involved in background i/o
Formerly, we assumed that any page eligible for background i/o could
be effectively pinned by lock_page. Persuant to concern expressed by
Simon that such pages might be eligible to be released by the kernel
after readpages returns, call get_page to increment the refcount on
each page before dispatching a background read (and matching put_page
when the i/o is completed).
Simon Wilkinson [Tue, 29 Jun 2010 20:45:36 +0000 (21:45 +0100)]
Build: Rework git version detection
Rework the git version detection script to handle some issues that
have been pointed out.
1/ Make it work properly with objdir builds
2/ Don't try to work out if the tree is dirty if git describe failed
3/ Use the configured VERSION as a fallback if we can't obtain proper
version information during a make
Change-Id: I39494e1c18cf4eacbb55386334da7128fbe96310
Reviewed-on: http://gerrit.openafs.org/2283 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>