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>
Rainer Toebbicke [Wed, 23 Jun 2010 11:08:47 +0000 (13:08 +0200)]
Do not call afs_FlushVCBs with afs_xvcache held
In afs_AllocCBR, use dynamically created afs_cbr structures
when running out of preformatted ones, rather than calling
afs_FlushVCBs under, potentially, the afs_xvcache lock
(which would be held across the RPC, difficult to drop and
re-acquire under the current hierarchy).
Modest modernization of the number preformatted afs_cbr structures,
rule-of-thumb, not pretending any research.
Marc Dionne [Fri, 2 Jul 2010 13:28:05 +0000 (09:28 -0400)]
Linux: cache bypass: remove warning print before panic
This warning printf has some issues - it prints out pointers as
ints with %d (which causes warnings), and if the intention was
to print the referenced values, they wouldn't be set yet at that
point in the function.
Since the purpose is not clear and it has issues, just remove it.
Change-Id: Ied69c390818f9dff235bdaa31af42996aaa39af3
Reviewed-on: http://gerrit.openafs.org/2325 Reviewed-by: Matt Benjamin <matt@linuxbox.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Marc Dionne [Thu, 1 Jul 2010 20:07:40 +0000 (16:07 -0400)]
Linux: cache bypass: deal with the afs_serverHasNo64Bit case
Deal correctly with the case of a server with no 64-bit fetch
support. In that case, the code needs to fallback to the standard
FetchData call, similar to what happens in afs_fetchstore.c.
Move existing check out of 64-bit-only branch so servers
already known to be non-64-bit and not merely those newly
discovered so execute the non-64-bit FetchData.
Change-Id: I505ce6d88072bc3ee5208863717395a78f8562fa
Reviewed-on: http://gerrit.openafs.org/2319 Reviewed-by: Matt Benjamin <matt@linuxbox.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>
Some variables are only used for AFS_64BIT_CLIENT code, so make
their declaration conditional as well.
Also, initialize 'code' while we're at it. The compiler has a
legitimate complaint that it could be used before it's set,
for instance if we have AFS_64BIT_CLIENT but afs_serverHasNo64Bit
is true.
Simon Wilkinson [Wed, 30 Jun 2010 07:29:28 +0000 (08:29 +0100)]
Linux: Fix pagevec use in cache-bypass
Cache-bypass was still using the old style pagevec manipulation
functions, and so won't build on newer kernels. Update it to use the
same pagevec functions as the generic readpages code.
FIXES 127505
Change-Id: I9d8acaf3165bbdf24068bd9145a2369cd0c87e4d
Reviewed-on: http://gerrit.openafs.org/2298 Reviewed-by: Matt Benjamin <matt@linuxbox.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>
Ben Kaduk [Thu, 1 Jul 2010 16:47:55 +0000 (12:47 -0400)]
FBSD: do not recurse on the afs_xvcache write lock
afs_ShakeLooseVcaches grabs the write lock before calling
osi_TryEvictVCache. The latter calls vgone(l), which sometimes
calls into VOP_CLOSE, which again trys to acquire the write lock,
leading to deadlock. Drop the write lock and reaquire it in
TryEvictVCache as a fix.
While here, set *slept to 1 since we drop the glock.
This churn was enough that the gcc no longer cached the value of
AFSTOV(avc), which gets set to 0 in VOP_RECLAIM, so the subsequent
VOP_UNLOCK dereferenced a null pointer. Cache the vnode pointer
in a local variable for the entire function instead of using
AFSTOV() everywhere.
Andrew Deason [Thu, 1 Jul 2010 16:22:13 +0000 (11:22 -0500)]
fs: Correct human-readable output alignment
'fs lq' output separates its space values by whitespace, but 'fs df'
does not, which was causing the human-readable output for 'fs' to not
be properly aligned with the output headers. Modify HumanPrintSpace to
take up exactly 10 characters (9 for the value, 1 for the exponent),
and have the callers print out an extra space if appropriate.
Derrick Brashear [Wed, 30 Jun 2010 19:35:38 +0000 (15:35 -0400)]
update ticket5 from heimdal
includes updated instructions for updating.
note that gen_glue.c in lib/asn1 has a bug which omits
a needed newline in the "const struct units * asn1_%s_units(void);",
line.
Tom Keiser [Wed, 30 Jun 2010 22:40:20 +0000 (18:40 -0400)]
DAFS: fix VOL_HDR_IN_LRU state bit tracking
For the case where the cached vp->header can be re-used by
GetVolumeHeader(), we have not been re-setting the VOL_HDR_IN_LRU
state bit. Although this has not affected correctness (this
bit is merely used to aid in debugging), we should be resetting
it in all relevant cases...