Commit Graph

11787 Commits

Author SHA1 Message Date
Michael Meffie
9b1ffeeeb6 libadmin: makefile rule for afs_AdminError.h
Add a makefile rule to export the libadmin afs_AdminErrors.h header
file, instead of exporting afs_AdminErrors.h as a side effect of
generating the afs_AdminBosErrors error table.

Add the missing afs_AdminErrors.h dependency to the afs_utilAdmin.o
dependency list.

Change-Id: Ib8c7d22d705061615fb20a6a521dc20f0f1d6da0
Reviewed-on: http://gerrit.openafs.org/10369
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-29 07:23:02 -08:00
Michael Meffie
9b105c5586 libadmin: remove duplicate dependency
afs_AdminPtsErrors.h was listed twice in the dependency
afs_utilAdmin.o dependency list.

Change-Id: I4bf37d0502e26e05f912a136045814e32de73c4a
Reviewed-on: http://gerrit.openafs.org/10725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-29 07:22:43 -08:00
Michael Meffie
e39e226a13 tvolser: fix makefile clean target
Remove generated source files with the clean makefile target.

Change-Id: I1e7d06c217f63fb9ee749e23bca1531d22babdda
Reviewed-on: http://gerrit.openafs.org/10724
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-29 07:22:25 -08:00
Michael Meffie
31d6467aa0 config: use the standard INSTALL_DATA makefile macro
Replace the custom INST makefile macro with the standard
INSTALL_DATA macro for installing and exporting files.

Change-Id: I5d8c41d1c6d2c3ee021e0d6a5fbca8ef9178e74d
Reviewed-on: http://gerrit.openafs.org/10723
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-29 07:22:07 -08:00
Michael Meffie
c8e83f0e82 config: parallel-safe param.h makefile rule
Generate the param.h.new temporary file in a parallel-safe
way.  The rule to generate the three copies of param.h can
run at the the same time under a parallel make, clobbering
the param.h.new temporary file. Instead of creating this file
inline, create a common rule to generate the temporary file
once.

Change-Id: I823b6a55f3168e991b64660bfe51303d43f693a9
Reviewed-on: http://gerrit.openafs.org/10516
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-29 07:21:19 -08:00
Michael Meffie
52fe3f52de libafscp: makefile install rule update
Change the makefile install rules to install the header
file from the libafscp directory, and not the top level
include directory to make the install rules consistent
with the rest of the tree.

Change-Id: Ia06c29e72f7005569f2d11d3d0f6691413e0eeec
Reviewed-on: http://gerrit.openafs.org/10514
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-29 07:21:00 -08:00
Michael Meffie
9df43aacab comerr: compile_et -emit option for parallel make
Add the -emit option to the compile_et command to support parallel make.

The -emit option allows make to generate the header and the source files
independently, instead of building two files at the some time.  This
avoids the issue where one command creates two separate files, which is
difficult to handle correctly for parallel makes.

Change-Id: Ib44a8e358643cf19b4834b3bd4d5b88db6cd0ccf
Reviewed-on: http://gerrit.openafs.org/7921
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-29 07:20:44 -08:00
Michael Meffie
501d6d288f doc: afs_compile_et -h option
Document the afs_compile_et -h option.

Change-Id: I4972bcc1948e8dd7ae73dfcabfbaf822cfbfe64b
Reviewed-on: http://gerrit.openafs.org/10722
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-29 07:19:57 -08:00
Stephan Wiesand
534f802ac9 RedHat: Use systemd unit files on RHEL >= 7
Handle rhel >= 7 like fedora >= 15 when deciding whether
to package systemd unit files or sysvinit scripts in the
rpm spec file.

Change-Id: I2f1e807786e484774e5a1a97c297532d86f99265
Reviewed-on: http://gerrit.openafs.org/10631
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2014-01-27 18:32:22 -08:00
Michael Meffie
37937a3e92 comerr: long and short form of the -prefix option.
The man page documented the prefix option as -prefix; compile_et
supported only the short form -p.

Document and support both the long and short forms for the prefix
option; -p and -prefix.

Change-Id: Ide5551b06ae888748600677ed09ba674506a584f
Reviewed-on: http://gerrit.openafs.org/10721
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-27 17:58:30 -08:00
Michael Meffie
15c80b1a92 comerr: avoid comma operator
Avoid unnecessary use of the comma operator in compile_et's
command-line argument processing.

Change-Id: If9308d211676be471f3534e144c7d90214994699
Reviewed-on: http://gerrit.openafs.org/10491
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-27 17:58:04 -08:00
Michael Meffie
355ca7b20b doc: afs_compile_et -lang short form
Document the -lang short form for -language.

Change-Id: I4a57bdb23ca5fab4e1565d7e930cdc10097a7414
Reviewed-on: http://gerrit.openafs.org/10720
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-27 17:57:11 -08:00
Michael Meffie
de8ff76f87 doc: afs_compile_et formatting fixes
Fix two pod formatting errors and remove one trailing
whitespace characters.

Change-Id: I2ba4fd56afb8c26591d2770301c3edfdd1a898fb
Reviewed-on: http://gerrit.openafs.org/10719
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-27 17:56:56 -08:00
Benjamin Kaduk
8817308a87 FBSD: catch up to 1997 and include if_var.h with if.h
The commit message for upstream's r257244 change includes:
 - Make the prophecy from 1997 happen and remove if_var.h inclusion
   from if.h.
Despite the clear public posting, we were caught unawares.  We made
it down to the cellar despite the missing stairs, but "Beware of
the Leopard" caused us to turn back, apparently.

Since if.h is included in many places and if_var.h is not present
on all OSes, pull the if.h inclusion into the common kernel headers
for afs/ and rx/ , and add in if_var.h (as well as the sys/socket.h
prerequisite).

Change-Id: I228c1560a128388c187804e05c0dd2500fb2853e
Reviewed-on: http://gerrit.openafs.org/10754
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-27 17:55:56 -08:00
Andrew Deason
7f58e4ac45 afs: Return raw code from background daemons
Currently, a background daemon processing a 'store' request will
return any error code in the 'code' field in the brequest structure,
for processing by anyone that's waiting for the response. Since any
waiter will not have access to the treq for the request, they won't be
able to call afs_CheckCode on that return code, so the background
daemon calls afs_CheckCode before returning its error code.

Currently, afs_close uses the 'code' value from the background daemon
as if it were not passed through afs_CheckCode. That is, if all
background daemons are busy, we get our 'code' directly from
afs_StoreOnLastReference, and if we use a background daemon, our
'code' is tb->code. But these values are two different things: the
return value from afs_StoreOnLastReference is a raw error code, and
the code from the background daemon (tb->code) has been translated
through afs_CheckCode.

This can be confusing, in particular for the scenario where a
StoreData fails because of network errors or because of a VBUSY error.
If we get a network error when the request went through a background
daemon, afs_CheckCode will translate this to ETIMEDOUT, which is
commonly value 110, the same as VBUSY. So, an ETIMEDOUT error from the
background daemon is difficult to distinguish from a VBUSY error from
a direct afs_StoreOnLastReference call. Either case can result in a
message to the kernel like the following:

  afs: failed to store file (110)

To resolve this, have the background daemon store both the 'raw' error
code, and the error code that has been translated through
afs_CheckCode. afs_close can then use the raw error code when
reporting messages like normal, but can still use the translated error
code to return to the caller, if it has a translated error. With this
change, now afs_close will always log "network problems" for a network
error, regardless of if the error came in via a background daemon or a
direct afs_StoreOnLastReference call.

In Irix's afs_delmap, we just remove the old usage of tb->code, since
the result was not used for anything.

Change-Id: I3e2bf7e36c1f098df16a1fdb0dc88b45ea87dfa9
Reviewed-on: http://gerrit.openafs.org/10633
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-01-27 17:52:41 -08:00
Michael Meffie
eb3f8c99ed doc: fix typo in fs setacl
Fix typo in the dropbox section where 'l' was referred
to as 'read', not 'lookup'.

Change-Id: I6429c125f0561a1b5d4e7816930988ac1b347be7
Reviewed-on: http://gerrit.openafs.org/10750
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2014-01-22 17:51:12 -08:00
Benjamin Kaduk
e03b026c4d Remove some explicit sbrk() usage
Mac OS X 10.9 now considers this function deprecated and warns on
its use, causing the buildslave configuration to error out.

Use the library routine to get a process's size instead of inlining
the call to sbrk (which is unlikely to have worked as intended for
quite some time -- most malloc implementations in use do not use
sbrk to get their storage).

Change-Id: If616e1ebbea7c0aa541fb96c486820e883363df1
Reviewed-on: http://gerrit.openafs.org/10696
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-01-18 12:03:27 -08:00
Andrew Deason
e605de61e4 Revert "viced: Enable NAT ping on hosts"
This reverts commit aafdc08cfc.

The fileserver-side "NAT ping" behavior has yet to be proven to be
helpful in situations with NATs. If the behavior is not helpful, this
generates potentially a significant amount of extra useless traffic.
So until it can be shown to what degree this is helpful, keep this
behavior out of the fileserver.

Change-Id: Ibf6718eb1d37b2a7e610617acc697f4ee398b89a
Reviewed-on: http://gerrit.openafs.org/10712
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-01-17 10:40:17 -08:00
Benjamin Kaduk
51d31209dc Use an explicit symbol for uninitialized vnode types
Avoid trying to get clever with stuffing -1 into an unsigned bitfield,
which causes the value to change and generates a warning from clang.
Just use vNull, which is intended to be used for uninitialized/empty
vnodes.

Change-Id: I5662887e5a68c7e687025d19226f821d8f2d6a09
Reviewed-on: http://gerrit.openafs.org/10701
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-17 10:39:56 -08:00
Benjamin Kaduk
8c937cf95f Add braces to avoid a 'dangling else' warning
Change-Id: I301d7d2473d651002f0bf6baa18906bce6d46497
Reviewed-on: http://gerrit.openafs.org/10700
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-17 10:39:37 -08:00
Benjamin Kaduk
17c50911f7 Disable deprecated warnings for krb5 routines
In OS X 10.9 Mavericks, Apple has marked all of the krb5 routines
as deprecated (in favor of the GSS framework).  We must disable
these warnings in order to allow the buildslave to have a successful
build.

Luckily, Apple has left in rope for us to programmatically disable
the deprecated attribute with a preprocessor macro.  Defining this
macro should be safe everywhere, so do so unconditionally.

Change-Id: Iedc920001fdc5731254336424b0ab7b27274555c
Reviewed-on: http://gerrit.openafs.org/10699
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-17 10:39:22 -08:00
Benjamin Kaduk
d72ed6ad4c vol/salvaged.c: Remove unused variable
It was incremented from an uninitialized value, which caused a build
error on the OS X 10.9 buildslave.  Since it's unused, just remove
it entirely.

Change-Id: I845e9139ffd27ba7bf4e010cf4e5625658125486
Reviewed-on: http://gerrit.openafs.org/10698
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-17 10:38:52 -08:00
Benjamin Kaduk
8105129987 viced/callback.c: Ignore dump write errors even harder
Not only do we need to check the return value of write(2), but
we also need to do so in a way that does not leave an empty body
in the if statement, in order to appease the clang-500.2.79 found
on OS X 10.9 with Xcode 5.0.2.

Change-Id: I4564f05927fe14fea3365e9e250834ee948fe387
Reviewed-on: http://gerrit.openafs.org/10697
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-17 10:38:41 -08:00
Benjamin Kaduk
5c4e555f93 Add a routine to get the size of the current process
Use rusage when available, and fall back to the very old sbrk(0)
hack otherwise.

Change-Id: Ic986fd6b93476b80008908a95f8b8e0c76d9ed9a
Reviewed-on: http://gerrit.openafs.org/10695
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-17 10:38:14 -08:00
Benjamin Kaduk
baf6af8a8f afs_fetchstore: avoid use of uninitialized variable
rxfs_fetchInit() attempts to do a 64-bit RPC first, but falls back
to the 32-bit StartRXAFS_FetchData() if the server appears to not
support the 64-bit RPCs.

We correctly did not read a length from the call if the FetchData
RPC(s) failed, but proceeded to assign from the 'length' local
variable into the 'alength' output variable unconditionally later on.

Instead of blindly continuing on, jump to the error-handling part of
the routine when we cannot read a length from the call.  This has the
side effect of skipping an afs_Trace3() point in the error case.

Change-Id: I4840d5c692c61630c68e97b5e88f9460abade19e
Reviewed-on: http://gerrit.openafs.org/10694
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2014-01-17 10:38:05 -08:00
Benjamin Kaduk
5b8133dedd rfc3961: Use enctypes, not keytypes
We previously defined the enctype symbols to be aliases for keytype
symbols.  The numerical values matched what we wanted (since these
values are specified in an IANA registry), but the C type is not
required to be the same for enctypes and keytypes.

Some of our buildslave configurations notice the type mismatch and
complain, so fix the types by using the enctype enum for enctype symbols
instead of keytypes.

Change-Id: I56ca634d52954ee44baa34e2d8c876271f171288
Reviewed-on: http://gerrit.openafs.org/10693
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
2014-01-17 10:37:58 -08:00
Andrew Deason
9f8b765bbd opr: Silence rbtree warning
On OS X, gcc can complain that 'child' is uninitialized whenever this
'else if' condition is false. We already handled the case where both
node->right and node->left are non-NULL earlier in this function, so
this should never occur. So, to get rid of the warning, just always
take the path in the 'else if', and assert that the right child is
NULL.

Change-Id: I3575de84ea172d3c7e0e022809fdcd0e3b4dcc27
Reviewed-on: http://gerrit.openafs.org/10687
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-15 19:30:09 -08:00
Benjamin Kaduk
b921bf94f6 De-duplicate a couple afs_CheckCode uniquifiers
These uniquifiers are supposed to be globally unique, to identify the
call site within the tree.  For whatever reason, a couple of them
were duplicated at different call sites; provide new (unique) values
to disambiguate between them.

There remain a couple of uniquifiers which are used in multiple
places, but those are in different architectures' implementations
of afs/ARCH/foo.c, and thus will be globally unique for any particular
build.

Change-Id: Iff5defcade74143a45d7ef3aaacbdeb7523f2a40
Reviewed-on: http://gerrit.openafs.org/10709
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-15 08:00:58 -08:00
Michael Meffie
ba0208f1d6 xstat: fix a malformed debug message
a munged format specifier obscured the missing rn arg.

Change-Id: Ic0eb20413123b88e86484a9095beb3e37fdd7ed3
Reviewed-on: http://gerrit.openafs.org/10708
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-15 08:00:35 -08:00
Michael Meffie
cda5e665eb xstat: use ephemeral ports for xstat_fs_test and scout
Instead of trying to bind to port 7101, and then retrying if
the port is in already in use, let the os find an available
port for scout and xstat_fs_test.

This fixes a bug where scout and xstat_fs_test do not call
rx_Finalize() before retrying rx_Init() with a different port
number, causing the program to crash later when more than
one copy of xstat_fs_test and/or scout are running at the same
time.

Change-Id: I64e4916b03b1cae20ef36bb1ae293885962677e7
Reviewed-on: http://gerrit.openafs.org/10707
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-15 08:00:23 -08:00
Marc Dionne
ccc5d3f7ad Linux 3.13: Check return value from bdi_init
The use of the bdi_init function now gets a warning because the
return value is unused and the function is now defined with
the warn_unused_result attribute.

Assign and check the return value.

Change-Id: I78ae4ea356aef8c9dabe75179ad67db1fd64c28b
Reviewed-on: http://gerrit.openafs.org/10530
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:57:32 -08:00
Andrew Deason
9a0a8ca4d1 viced: Avoid issuing redundant TMAY requests
Currently, if a new Rx connection comes in from a host we already have
a host struct for, we make a TellMeAboutYourself (TMAY) call to the
given host, to verify the UUID (and caps, interface info, etc) is what
we expect it to be. That is, if it's still the "same" host that we
know about. This is necessary because we otherwise have no way of
telling if the Rx connection is from the same host, or from a new host
that just happens to have the same IP address (e.g. in the case that
hosts are moving around and changing IPs). We do this while the host
is locked, so we only issue these TMAY calls one at a time.

If a large number of Rx connections come in from the same host at
around the same time, this can result in a lot of TMAY requests being
issued against the host, even for hosts that never change IPs and
never do anything strange. In these situations, issuing so many TMAYs
is useless. If we have several calls waiting to lock the host to issue
a TMAY, some of the extra TMAY calls are provably useless. So instead
of calling TMAY repeatedly, remember what the last successful TMAY
result was, and reuse it for the "provably useless" calls.

Note that this 'cache' stores the actual raw results of
TellMeAboutYourself. We could save some memory by storing just how we
interpret that data later on in h_GetHost_r, but this way results in
way simpler h_GetHost_r logic. Since, we can use the same code paths
as for a "real" TMAY call.

Change-Id: I6df74e625e90499bd64c9eb34f20db440f6605a6
Reviewed-on: http://gerrit.openafs.org/9711
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:55:16 -08:00
Andrew Deason
5c0a1d4acc DARWIN: Convert crfree back into a macro
Commit 1d8937b860 turned crfree on
DARWIN into an inline function to work around an error flagged by
clang. A side effect of this is that the address passed to
kauth_cred_unref will not be the actual address of the value given to
crfree; we are instead giving kauth_cred_unref the address of our
function argument in order to adhere to the semantics of a function
call.

kauth_cred_unref seems to just take a pointer to the cred pointer in
order to set the value to effectively NULL afterwards, so this is not
a huge deal. However, this does mean that our current implementation
undoes any of the safeguards intended by making kauth_cred_unref work
this way in the first place.

So, revert 1d8937b860 and put the crfree
definition back to the way it was. Fix the caller in
afs_StoreOnLastReference to not cause an error by just assigning the
cred pointer to a temporary value. While it's not ideal that some
callers may need to do this, this is the only place where this is
necessary and it's more of an artifact of the weirdness of storing a
cred pointer in linkData, which probably should be changed anyway.

Change-Id: I50557901203d22a7b19028be551eb40f0c4cd751
Reviewed-on: http://gerrit.openafs.org/10614
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:52:38 -08:00
Andrew Deason
b0f433986c SOLARIS: Support VSW_STATS
Specify the VSW_STATS flag to the vfsdef_t structure we give to
Solaris. This turns on statistics that can be retrieved via fsstat(1M)
and allows the fsinfo::: DTrace provider to work with AFS files.

We don't need to actually maintain these statistics; Solaris does that
for us. This flag just signifies that our vfs_t structure is capable
of storing the information. Since we get our vfs_t from Solaris (via
domount(), it gives us a vfs_t when it calls our afs_mount function)
and do not allocate a vfs_t ourselves, we are safe and this is fine to
do.

Change-Id: I356df91ea409245f0c5b1e4ef693ac28ad8f11b2
Reviewed-on: http://gerrit.openafs.org/10679
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:49:26 -08:00
Michael Meffie
64d7715c02 vol: reset nextVnodeUnique when uniquifier rolls over
The on disk uniquifier counter is set to 200 more than the current
nextVnodeUnique counter when the volume information is updated to disk. When
the nextVnodeUnique is near UINT32_MAX, then the uniquifier counter rolls
over.  This can happen during a volume header update due to
VBumpVolumeUsage_r().

With this change, the nextVnodeUnique customer is reset to 2 and the
uniquifier is reset to 202 when a roll over occurs. (uniquifier of 1 is
reserved for the root vnode.)

With this change, the number of possible uniquifier numbers is limited to
200 less than UINT32_MAX.

The following shows a series of vnode creation/deletions to illustrate
the uniquifier rollover before this commit:

fid = 536870918.4.4294967114, nextVnodeUnique = 4294967115, uniquifier = 4294967295
fid = 536870918.4.4294967115, nextVnodeUnique = 4294967116, uniquifier = 4294967295
fid = 536870918.4.4294967116, nextVnodeUnique = 4294967117, uniquifier = 21
fid = 536870918.4.4294967117, nextVnodeUnique = 4294967118, uniquifier = 22

and after this commit:

fid = 536870918.4.4294967115, nextVnodeUnique = 4294967116, uniquifier = 4294967295
fid = 536870918.4.4294967116, nextVnodeUnique = 2, uniquifier = 202
fid = 536870918.4.2, nextVnodeUnique = 3, uniquifier = 202
fid = 536870918.4.3, nextVnodeUnique = 4, uniquifier = 202

Change-Id: I93c8a7cf47e39b8701265d6507cfc4f8c1352ddc
Reviewed-on: http://gerrit.openafs.org/10617
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:47:22 -08:00
Michael Meffie
1a287c631e vol: fix nextVnodeUnique roll over
Fixes for the per volume nextVnodeUnique counter roll over. Uniquifier number 1
is reserved for the root vnode, so reset the unique count to 2 when the
nextVnodeUnique counter rolls over.

Update the disk backed V_uniquifier count when the in-memory nextVnodeUnique
counter rolls over during the creation of a new vnode. If the nextVnodeUnique
rolls over when V_uniquifier is UINT32_MAX, then the V_uniquifier is not updated
and remains at UINT32_MAX until the next VUpdateVolume_r() call for the volume.

This bug is usually masked by the VBumpVolumeUsage(), which on every 128 volume
accesses, bumps the V_uniquifier to be 200 more than the current
nextVnodeUnique counter.  This causes the V_uniquifier to roll over before
reaching UINT32_MAX.  (The number of access before updating the headers is set
in the usage_threshold volume package option, which is currently set to 128 by
default.)

The following shows the unique counters for a series of vnode
creation/deletions before this commit.  The nextVnodeUnique rolls over to 1,
and the uniquifier is not reset.  The `usage_threshold' was set to a value
greater than 200 to avoid the VBumpVolumeUsage() calls during this test run.

fid = 536870918.4.4294967294, nextVnodeUnique = 4294967295, uniquifier = 4294967295
fid = 536870918.4.4294967295, nextVnodeUnique = 0, uniquifier = 4294967295
fid = 536870918.4.1, nextVnodeUnique = 2, uniquifier = 4294967295
fid = 536870918.4.2, nextVnodeUnique = 3, uniquifier = 4294967295

The following shows the unique counters after this commit:

fid = 536870918.4.4294967294, nextVnodeUnique = 4294967295, uniquifier = 4294967295
fid = 536870918.4.4294967295, nextVnodeUnique = 0, uniquifier = 4294967295
fid = 536870918.4.2, nextVnodeUnique = 3, uniquifier = 203
fid = 536870918.4.3, nextVnodeUnique = 4, uniquifier = 203

Change-Id: I438670200bf97baeac1486eda7df4cf243aabfc4
Reviewed-on: http://gerrit.openafs.org/10616
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:47:11 -08:00
Benjamin Kaduk
67232bd9d6 Fix vcache/vnode mismatch in lookup for DARWIN
We have a vcache and need a vnode, so AFSTOV() is the right macro,
not VTOAFS().

It's kind of unfortunate that --enable-checking doesn't catch this.

Change-Id: I924649918dd0149b5fd7e4380b5f2e49d21fc8c4
Reviewed-on: http://gerrit.openafs.org/10702
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:43:16 -08:00
Andrew Deason
71ec4a3e3d afs: Don't clear afs_CacheTooFull prematurely
Currently, we can clear afs_CacheTooFull here, even if
afs_CacheIsTooFull() doesn't agree that the cache is no longer 'too
full'. This could theoretically result in afs_CacheTooFull being
cleared, even though the cache is indeed 'too full', according to
afs_CacheIsTooFull(). Just break here, and let afs_CacheIsTooFull()
decide.

This reverts a small part of 488c7c9785.
This part doesn't seem important to the functionality in that commit,
though; the rest of that commit is still here, and avoids the extra
work if we have calculated no needed space to free.

Change-Id: If0adce7fa2e88a970ddb202de02c8ff048d2ad15
Reviewed-on: http://gerrit.openafs.org/10460
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:38:42 -08:00
Andrew Deason
81b7857741 afs: Fix some dcache-related comments
- The comments preceding the afs_CacheIsTooFull macro, describing the
   cache-related high and low water marks, are a little out of date.
   We start freeing on 90% space, not 95%, and we also can take into
   account how many free/used chunks we have.

 - afs_WakeCacheWaitersIfDrained looks at the number of non-used (free
   or discarded) blocks, not just free blocks.

Change-Id: I5bf923b3c24993294e752f4312737815d0102779
Reviewed-on: http://gerrit.openafs.org/10459
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-01-12 11:38:11 -08:00
Andrew Deason
cef726558d rx: Clarify error checks for busy channel check
Commit a84c6b0ece changed this so we
don't just discard an incoming request if the call already had an
error. But if the call already has an error, rxi_WaitforTQBusy is a
no-op, so checking if the error has "changed" is unnecessary and can
be confusing. Just bypass this whole block if the call already has an
error.

Discussed during the 5 Dec 2012 release-team meeting.

Change-Id: Id57d65736f3228d4e7595f56800f42c52e83ef39
Reviewed-on: http://gerrit.openafs.org/8748
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-12 11:37:44 -08:00
Andrew Deason
31b518fcf1 viced: Move host quota calculation
Calculate this during initialization, not every time we want to use
it.

Change-Id: I931d2f3f0b4b99add682c098dd51f03c9942f5b4
Reviewed-on: http://gerrit.openafs.org/9710
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-01-12 11:37:07 -08:00
Andrew Deason
16d8ab09bd RedHat: Fix specfile changelog
Oct 29 2007 was a Monday, not a Tuesday. rpmbuild does actually yell
at us about this, so fix this so it will shut up.

Change-Id: I5e13f227ed62c4bbb7ac72f2c844136648c935c7
Reviewed-on: http://gerrit.openafs.org/10621
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2014-01-11 10:09:00 -08:00
Andrew Deason
837ec9dd41 Fedora: Handle new kernel variant paths
With Fedora 20, Fedora now separates the variant from the rest of the
kernel version with a plus (+) instead of a period (.) . This results
in directories called e.g. 3.12.5-302.fc20.i686+PAE, where right now
we look for 3.12.5-302.fc20.i686.PAE.

Use this new directory scheme for Fedora 20 builds, so we can build
against non-default kernel variants on Fedora 20 and beyond.

Change-Id: I309272f4f4f740058c48e92530e40a1c64d63668
Reviewed-on: http://gerrit.openafs.org/10620
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2014-01-11 10:07:07 -08:00
Andrew Deason
cddc732ec5 RedHat: Munge future kernel versions
We currently look for "fc1?" (that is, fc10 through fc19) when trying
to munge the kernel version in some ways. This broke on Fedora 20,
since 20 obviously does not match "fc1?". Similarly, we look
specifically for "el6" for RHEL6 versioning quirks, but these will
break on RHEL7 and beyond.

Change the version checks so that this will work all the way through
Fedora 99 and RHEL 9. That won't work forever, but it will keep us
working for a few versions if the versioning quirks do not change.

Change-Id: I64dfd483eb2cfa57d67c97ae6db09be5bb020195
Reviewed-on: http://gerrit.openafs.org/10618
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
2014-01-11 10:02:28 -08:00
Benjamin Kaduk
cb52cc6e44 ktc: fix up initializer for local_tokens
The old initializer was incomplete (initializing only one of the four
fields in the struct), which prompted warnings from clang
(-Wmissing-field-initializers):
../../../openafs/src/auth/ktc.c:149:2: warning: missing field 'server'
      initializer [-Wmissing-field-initializers]

Since the variable is at file scope, it will be initialized to all
zeros anyway, and there is no need for an explicit initializer.

Change-Id: Ib7690759ec3403d1913852e30bb553ef8ac8f019
Reviewed-on: http://gerrit.openafs.org/10686
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-09 11:23:07 -08:00
Jeffrey Altman
2d5f0a971b Windows: AFSCommonWrite STATUS_PENDING is Success
AFSCommonWrite() can return STATUS_PENDING if the write has been
deferred.  In that case, the function exit must not:

 * Update the Valid Data Length

 * Purge the cache

 * or do anything else related to the request

Change-Id: Ib34bef3a1d56d452babcaf1f3cfbf77fe8f93388
Reviewed-on: http://gerrit.openafs.org/10685
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-01-09 11:21:53 -08:00
Jeffrey Altman
d5bcff7429 Windows: Mark Irp Pending before Deferring
After CcDeferWrite() is called we no longer have access to the
current Irp.  If we mark it deferred after calling CcDeferWrite()
we might mark the wrong thing.

Change-Id: Id4b1bbd241b5e2acafc8d015e85966cb80518dde
Reviewed-on: http://gerrit.openafs.org/10684
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-01-09 11:21:43 -08:00
Jeffrey Altman
6995a56884 Windows: cm_ConnByServer fix search for replication
Separate connection objects are maintained for use when accessing
replicated and single source volumes.   If the matching connection
type cannot be found while holding the cm_connLock shared a second
search is performed after the lock is upgraded to an exclusive lock.
This second connection search was not enforcing the replication criteria.

Change-Id: I408a5d87c3a82da5235fa2255db7d1d7a6bcb6d9
Reviewed-on: http://gerrit.openafs.org/10681
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-01-09 11:21:02 -08:00
Jeffrey Altman
cccb5e6142 Windows: cm_connLock not required for cm_GetUCell
In cm_ConnByServer() there is no need to hold the cm_connLock across
the cm_GetUCell() call.  Obtain the cm_ucell_t object before the
cm_connLock is obtained.

Change-Id: I971b55e0aae7748b59895785c1c22b5461c4fd35
Reviewed-on: http://gerrit.openafs.org/10680
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-01-09 11:20:52 -08:00
Jeffrey Altman
da7adce6dd Windows: Rewrite LargeSearchTime conversions
Use LARGE_INTEGER to avoid the need for shifting and DWORD casts.
Take into account the size of time_t.

Change-Id: I056d920894b661ebb2060a5010efd9a0cd5a4a5d
Reviewed-on: http://gerrit.openafs.org/10673
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-12-29 23:51:09 -08:00