Commit Graph

11816 Commits

Author SHA1 Message Date
Benjamin Kaduk
b7326e487f afs_fetchstore: re-avoid uninitialized variable
As noted in the gerrit comments for change 10742, commit
baf6af8a8f does not handle the case
where the second rx_Read() call fails, and the 'length' variable
can still be used uninitialized.

Instead of using an err label and jumping to it on the case of
errors, initialize length to zero and take care to neither
set nor access *alength if an error has occurred.  This is
more consistent with the style of the surrounding code while still
avoiding the use of an uninitialized variable.

Change-Id: I6abfa4a5f051368ca12ada1494fc7687f378d319
Reviewed-on: http://gerrit.openafs.org/10806
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 14:26:30 -08:00
Benjamin Kaduk
63291be221 fstrace: only declare 'rval' when it is used
... to avoid compiler warnings about unused variables.

Found by clang on FreeBSD 10.0.

Change-Id: I30c9fbc0e2fb0f9af273f0f17861009b6d0577df
Reviewed-on: http://gerrit.openafs.org/10822
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 14:21:25 -08:00
Benjamin Kaduk
53d7145416 FBSD: Switch the dummy 'data' for mount(2)
The mount(2) API takes a void*, but 'rn' is const char*, which
is const-incorrect.  Our vfs_cmount implementation ignores the 'data'
parameter, but upstream's kernel mount(2) implementation did
have a NULL check until r158611 (in the 6.1 or 7.0 timeframe),
so leave that comment for now.

Arguably we should be using nmount(2) instead of mount(2) anyway,
but leave that for a separate patch.

Change-Id: I22fd85c2f1a32aa849e182d263de119a953690d2
Reviewed-on: http://gerrit.openafs.org/10821
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 14:20:49 -08:00
Benjamin Kaduk
758ec15f93 pointers are not castable to unsigned int
When printing a pointer's value for debugging purposes, use the
dedicated printf format specifier for pointers instead of assuming
that unsigned int ('x') is good enough.

Found by clang on FreeBSD 10.0.

Change-Id: I18c42df0bf03c2d0e9e7c757445b8ff0f616c671
Reviewed-on: http://gerrit.openafs.org/10820
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 14:18:57 -08:00
Benjamin Kaduk
a52346ae50 Satisfy clang's aggressive strlcpy warnings
Passing something related to the length of the source as the
length argument to strlcpy triggers a warning, which is converted
to an error with --enable-checking (on FreeBSD 10.0).  The current
code is safe, since it is using the same expression that was used
to allocate the destination buffer, but switch to using a separate
variable to hold the length and use that variable for both allocation
and copying, to appease the compiler.

Change-Id: I580083d142fd19a4e7828c915b4846868fa8f917
Reviewed-on: http://gerrit.openafs.org/10818
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 14:10:44 -08:00
Benjamin Kaduk
add4b8100e Remove unneeded inclusion of <sys/timeb.h>
This file is deprecated on FreeBSD, and is not used anywhere.

Change-Id: If10816f26da91855d10826d53501e5b9974cd292
Reviewed-on: http://gerrit.openafs.org/10817
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 14:06:26 -08:00
Jeffrey Altman
3e4af71581 Windows: cm_GetCell_gen Fixup cm_server cellp on race
If a race occurs during the instantiation of a new cm_cell_t object,
the created servers will point at the wrong cm_cell_t object after
the race is detected.  Before cm_GetCell_gen completes the cm_server_t
objects must be fixed to point to the correct cm_cell_t.

Change-Id: I8341c2cfd2a8ac7be31699d11f78b4b9ced257af
Reviewed-on: http://gerrit.openafs.org/10777
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 07:25:33 -08:00
Jeffrey Altman
7760acc457 Windows: Support arbitrary callback ports
Reconfigure the advanced firewall to support callback ports
other than port 7001.

This changes the semantics of the afsicf api.  AFS_PORTSET_SERVER is now
zero.  Any other value is treated as a callback port.

Change-Id: I4df421cc0ceb4dca94a6b5e81990115a4ce0334e
Reviewed-on: http://gerrit.openafs.org/10776
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 07:25:11 -08:00
Jeffrey Altman
dd9e59805b Windows: cm_AddCellProc always call cm_NewServer
The current implementation of cm_NewServer handles races and
collisions.  There is no need to perform a cm_FindServer() check
first.  Just call cm_NewServer() for all server entries.

Move the logging of server creation and cell assignment to
cm_NewServer().

Change-Id: If0cdb2eda9bcb6234eeaef7c2a35edf751a9c0ca
Reviewed-on: http://gerrit.openafs.org/10775
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 07:25:00 -08:00
Chas Williams (CONTRACTOR)
1d1e962192 bos: Remove last of MRAFS references
A few MRAFS tidbits were left behind during the cleanup in commit
a9301cd2dc.

Change-Id: I7dcd30797ff87c61d57781c66cb9f7369638fa36
Reviewed-on: http://gerrit.openafs.org/10808
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 07:22:10 -08:00
Arne Wiebalck
b490cfd240 libacl: use initialized memory
Replace malloc with calloc to use zeroed memory when converting access
lists.

Change-Id: I17558d1737fee020772919e423c9fba37180beca
Reviewed-on: http://gerrit.openafs.org/10815
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-02-08 07:01:20 -08:00
Andrew Deason
9f90b12e14 afs: Throttle byte-range locks warnings per-file
Currently, the warning messages about byte-range locks are throttled
only according to what the last PID of the locking process was. So, if
that same process performs a bunch of byte-range locks a bunch of
times, we log this warning message at most once every 2 minutes.

However, if we have even just one other process also performing
byte-range locks, the throttling can become pretty useless as
lastWarnPid ping-pongs back and forth between the two different PIDs.
This can happen if multiple unrelated byte-range-lock-using pieces of
software just happen to be running on the same machine, or if a piece
of software uses byte-range locks after forking into separate
processes.

To avoid flooding the log in situations like this, keep track of the
last warn time in the relevant vcache, so we don't get frequent
warnings for byte-range lock requests on the same file.

Change-Id: I446cf6a438a75aa741c5543b93f74f4184ee6508
Reviewed-on: http://gerrit.openafs.org/10796
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-02-05 20:04:52 -08:00
Andrew Deason
1096582bde namei: Ignore misplaced files
The namei salvaging/ListViceInodes code currently ignores files where
we cannot derive an inode number from a given filename. However, if a
file is a valid inode filename, but is in the wrong directory, we
still record it. This can cause the salvager to abort, since it
assumes inode e.g. 12345 is present, but when it tries to open 12345,
namei translates the inode to a nonexistant path, and we bail out.

It is unknown how a namei directory structure can reach this state,
but try to handle it. To be on the safe side, just ignore the files,
and log a message about them. That way, if the files are required for
reconstructing the volume or contain important data, they are still
available if needed. And if they contain incorrect or old data, we
don't screw up the volume by trying to use them.

Thanks to Sabah S. Salih for reporting a related issue.

Change-Id: I529e0c51f48b5b7a62d6aab0470fad71788a5b69
Reviewed-on: http://gerrit.openafs.org/10214
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-02-05 07:06:44 -08:00
Andrew Deason
602e8eb200 salvager: Handle multiple/inconsistent linktables
The ListAFSSubDirs code in namei_ops.c currently detects
incorrectly-named linktable files, and whines about them and says the
salvager will handle them. However, the salvager doesn't really handle
them, since we just use the first linktable we find (FindLinkHandle)
without checking any of the information about it.

So, check for these. Fix FindLinkHandle to only consider a linktable
the "real" linktable to use if it actually matches the volume group id
we're salvaging. Also delete any inconsistent linktables via the new
function CheckDupLinktable later on.

Note that inconsistently-named linktables have been known to have been
created in the past due to a bug in the salvager (fixed by ae227049),
and possibly due to other unknown issues.

Change-Id: Iac461e1254e1f73406a2bc74eaa5a5f53d697304
Reviewed-on: http://gerrit.openafs.org/10322
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-02-05 07:06:36 -08:00
Mark Vitale
9fca71287d vos: move convertROtoRW core logic to vsprocs
Create new vsprocs routine UV_ConvertRO in preparation for adding
new function to vos convertROtoRW.

Change-Id: Ic66ecbf7cacb277891bec9f8783040995ce6ce17
Reviewed-on: http://gerrit.openafs.org/9277
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-02-05 06:47:41 -08:00
Stephan Wiesand
b78b7f0c34 RedHat: don't package manpages for binaries not included
We don't package copyauth, aklog_dynamic_auth and rmtsysd.
Omit their manpages too.

Change-Id: I653e24be9ac258bcb1539bc773eebae728d6261b
Reviewed-on: http://gerrit.openafs.org/10781
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-02-05 06:45:27 -08:00
Andrew Deason
4f253106dc afs: Include FID in DoLockWarning
Provide the FID that is being locked when we warn about byte-range
locks, so the user can find what file the process is trying to lock.

Change-Id: I56a185c200ac73045ee29b79410e27222c2637f2
Reviewed-on: http://gerrit.openafs.org/10795
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>
2014-02-05 06:44:27 -08:00
Andrew Deason
c73883e784 afs: Refactor DoLockWarning
Change DoLockWarning around a little bit, so subsequent changes are
easier to follow. Move lastWarnTime/lastWarnPid so they are only
usable within this function.

This commit should incur no functional change.

Change-Id: I5d25f64e9c088aecee0f0c46b6c401b2caa71ccb
Reviewed-on: http://gerrit.openafs.org/10794
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-02-05 06:43:58 -08:00
Marc Dionne
997f7fce43 Linux: When revalidating, don't drop in-use dentries
The Linux client can get into a state where the current working
directory is seen as "deleted" by some tools, while it is still
there and accessible to "ls" and other tools.  This has been
reported by several users and sites.

One scenario that has been observed while debugging:
- A process does a chdir() into a directory
- This stores a pointer to the dir's dentry in the task structure
- The server hosting the volume goes offline temporarily
- The dentry for the directory is passed to afs_linux_dentry_revalidate
- afs_linux_dentry_revalidate calls afs_lookup which returns an
error (110 - ETIMEDOUT)
- It then considers the dentry not valid, and calls d_drop()
- d_drop unhashes the dentry unconditionally
- Server comes back up, but dentry is still unhashed
- getcwd() fetches the task structure pointer to the current dir
dentry.  If unhashed, it returns ENOENT, and the vfs layer is
not involved at all.

At that point, many things won't work and there is no obvious way
for the user to get the directory rehashed.

Instead of calling d_drop directly, call d_invalidate instead, as
it will only drop (unhash) the dentry if we're the only one holding
a reference.  Since d_invalidate will also call shrink_dcache_parent,
also remove that call from our code so it doesn't get called twice.

Change-Id: I03e9872f6f9aebd28cdf6b833e14955edaa2527c
Reviewed-on: http://gerrit.openafs.org/10774
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-02-05 06:38:22 -08:00
Arne Wiebalck
3ef0bca9ac Log shutdown progress
Shutting down fileservers with thousands of volumes can take a while and
it is helpful for operations to actually see that there is progress when
detaching volumes. This patch adds a log message to the fileserver log
every time 100 volumes have been detached.

Change-Id: I1685aa62335b223cf7cd3286188781318084c22f
Reviewed-on: http://gerrit.openafs.org/10797
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-02-05 06:35:53 -08:00
Andrew Deason
b398330481 afs: Pay attention to fetchOps->destroy error code
The ->destroy function in our fetchops could change our error code, or
even raise a new error. Don't ignore it. This currently doesn't do
much, since fetchDestroy currently won't change the error code if it's
given an error, but this can change in the future.

Change-Id: I6fa98cc709cb0fbd4c1e868ba4b9be53313573ff
Reviewed-on: http://gerrit.openafs.org/10787
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-02-04 12:41:32 -08:00
Jeffrey Altman
3b5c636480 Windows: Add caching to cm_GetAddrsU
Cache the results of VL_GetAddrsU queries and reuse the results
for subsequent calls when possible.

Change-Id: I7e2b086ec311208a46439588bc820a1929d2b2b9
Reviewed-on: http://gerrit.openafs.org/10764
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-01-30 22:07:46 -08:00
Jeffrey Altman
74982e6ae1 Windows: cm_GetAddrsU wrapper for VL_GetAddrsU
cm_GetAddrsU() is a wrapper for the VL_GetAddrsU() RPC.  The initial
version is a bare bones replacement for the VL_GetAddrsU() call from
cm_UpdateVolumeLocation().  Future changes will add caching.

Change-Id: I7d51d98d8fd21b91f25424bdb795576ea44deab4
Reviewed-on: http://gerrit.openafs.org/10763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-01-30 22:07:36 -08:00
Jeffrey Altman
311505170d Windows: replace cm_allServersp list with osi_queue
Replace the cm_allServersp list with an osi_queue.  This simplifies
the Add/Remove functionality which will be required in case of VLDB
server uniquifier changes.

Change-Id: I6b118f2a27ee4bd2eb24011aae868865615eb09f
Reviewed-on: http://gerrit.openafs.org/10762
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-01-30 22:07:26 -08:00
Andrew Deason
335a70653a afs: Translate VNOSERVICE to ETIMEDOUT
Some fileservers will kill calls that are taking too long with the
VNOSERVICE abort code. Our logic for retrying calls is already aware
of this usage, but if we cannot retry the call, we still just return
VNOSERVICE as an error code to our caller.

Don't return this raw, since has the same value as ENOBUFS, which can
cause a confusing error message from logs or applications ("No buffer
space available"). Return ETIMEDOUT instead.

Change-Id: Ic16422585a10cda7f21646a27c92f690b131ce9b
Reviewed-on: http://gerrit.openafs.org/10766
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
2014-01-29 07:35:01 -08:00
Andrew Deason
e459f44efe afs: Fix afs_CheckCode identifier collision
The last argument to afs_CheckCode should be unique so the call site
can be identified if fstrace is turned on. BStore and BPartialStore
were both using 43, so change BPartialStore to 430 to avoid the
collision.

Change-Id: I81a43ee41623fad10d0e70a7d9c8e6029aba30eb
Reviewed-on: http://gerrit.openafs.org/10635
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-01-29 07:34:55 -08:00
Andrew Deason
34e4a4fed3 afs: Treat vc_error as a CheckCode-translated code
The vcache field vc_error is generally treated as an error code that
has been translated through afs_CheckCode, but this is inconsistent in
a few places. Fix this in a few ways:

 - Adjust afs_nfsrdwr so we do not call afs_CheckCode on vc_error,
   translating the error code twice.

 - Change afs_close to store vc_error in code_checkcode, and have the
   logging code check for specific values in code_checkcode as well.
   Log unknown values of code and code_checkcode, so we can
   distinguish between e.g. a 'code' value of VBUSY, and a
   'code_checkcode' value of ETIMEDOUT.

Change-Id: Iab4928efd183fb6c5b0b0f30375b9952ba13b45a
Reviewed-on: http://gerrit.openafs.org/10634
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-29 07:34:47 -08:00
Michael Meffie
d208456364 libadmin: add header file deps
Add the missing header file dependencies to the library targets.
This is needed for parallel make.

Change-Id: I60d60e68ef808a62b4063a6106672f5178c1b605
Reviewed-on: http://gerrit.openafs.org/10726
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:34 -08:00
Michael Meffie
66093e4a2d libadmin: use INSTALL_DATA to export headers
Use the INSTALL_DATA macro instead of cp to export
header files.

Change-Id: Ia460d8227f2fb2f594793a01c27f64ff7ce45273
Reviewed-on: http://gerrit.openafs.org/10515
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:16 -08:00
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