openafs.git
10 years agoSort the rfc3961 library's export symbol list
Ben Kaduk [Sat, 14 Dec 2013 00:07:13 +0000]
Sort the rfc3961 library's export symbol list

It was originally committed in an unsorted state.

Change-Id: Ife43b60cd625eae5062865942fc5c8956d6b6aab
Reviewed-on: http://gerrit.openafs.org/10583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoLinux: stop trying to use getname/putname
Jeff Layton [Fri, 6 Dec 2013 18:34:04 +0000]
Linux: stop trying to use getname/putname

The current code has afs_putname defined as

    kmem_cache_free (names_cachep, (void *) name);

This is wrong and will cause a double -free when syscall auditing is
enabled. Fix it to call putname properly.

Instead of that, just create a new afs_getname function that doesn't
bother with struct filename at all, and use that unconditionally.

Signed-off-by:Jeff Layton <jlayton@redhat.com>

Change-Id: I1cd58a7e528abfeb7473cf47ae4cff5b8c8f419c
Reviewed-on: http://gerrit.openafs.org/10547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoRemove extra whitespace from macro invocations
Ken Hornstein [Thu, 5 Dec 2013 18:57:36 +0000]
Remove extra whitespace from macro invocations

On MacOS X 10.9, the compiler has switched to LLVM and as a consequence
generates an error if there is a space between a macro invocation and
the starting left parenthesis.

Based on code originally done by Matt Haught <dmhaught@ncsu.edu>.

Change-Id: I28848f5294d0575d8abb1759c202cc3c2db85ac2
Reviewed-on: http://gerrit.openafs.org/10540
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoPackaging support for MacOS X 10.9 "Mavericks".
Ken Hornstein [Thu, 5 Dec 2013 18:53:56 +0000]
Packaging support for MacOS X 10.9 "Mavericks".

Based on work originally done by Matt Haught <dmhaught@ncsu.edu>.

Change-Id: Ibc7d79953667dfdfcc2e6c5c1c4c77249f11f4ad
Reviewed-on: http://gerrit.openafs.org/10539
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoAdd support for configuration of MacOS 10.9 "Mavericks".
Ken Hornstein [Thu, 5 Dec 2013 18:46:18 +0000]
Add support for configuration of MacOS 10.9 "Mavericks".

Based on work originally done by Matt Haught <dmhaught@ncsu.edu>

Change-Id: I331cfc0040fab526c32e24f6af970f352f0a0a8e
Reviewed-on: http://gerrit.openafs.org/10538
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoWindows: RXAFS_GetVolumeStatus no PRSFS_READ check
Jeffrey Altman [Thu, 5 Dec 2013 05:41:10 +0000]
Windows: RXAFS_GetVolumeStatus no PRSFS_READ check

Since d2d591caf2c9b4cf2ebae708cc9b4c8b78ca5a5a the file server no
longer performs a PRSFS_READ access check for the GetVolumeStatus RPC.
The cache manager should no longer test for PRSFS_READ as a means of
avoiding RPCs that are known to fail.

Change-Id: I67bd849d337d87657db8e1f0ed2839367b7972a8
Reviewed-on: http://gerrit.openafs.org/10532
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agolwp: rw now depends on libopr
Chas Williams (CONTRACTOR) [Mon, 25 Nov 2013 12:13:32 +0000]
lwp: rw now depends on libopr

rw (a test program for lwp) needs libopr to build

Change-Id: I489e675f5a1b845c7a8083466b44a73af305f8b8
Reviewed-on: http://gerrit.openafs.org/10517
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoLinux: fix whitespace issue
Christof Hanke [Thu, 5 Dec 2013 09:00:42 +0000]
Linux: fix whitespace issue

introduced in Change I1e84969b. It does not
follow the overall style.

Change-Id: I5f68fdf425b365d69ee94680cef014de679cf6ff
Reviewed-on: http://gerrit.openafs.org/10529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: RDR capture Cc/Mm exceptions do not break
Jeffrey Altman [Wed, 27 Nov 2013 17:26:44 +0000]
Windows: RDR capture Cc/Mm exceptions do not break

All of the Cc and Mm functions are wrapped in try/except blocks.
The purpose is to ensure that Cc and Mm do not return an error as
an exception which could result in the afs redirector failing to
release a resource.   Instead of calling the AFS exception handler
just handle the exception with EXCEPTION_EXECUTE_HANDLER.  This permits
the __except block to capture the exception code.

The AFS exception handler will throw its own exception if the
AFSDebugFlags AFS_DBG_BUGCHECK_EXCEPTION bit is set.  This is helpful when
debugging exceptions thrown by errors in the afs redirector code.  It is
not helpful when a Cc function throws an exception.  For example,
CcReadCopy() will throw STATUS_DELETE_FILE as an exception if an attempt
to read from a deleted file is initiated.   This should simply fail the
read operation not BSOD the system.

Change-Id: I2fd1d4db530600441272e59353fbf28b831e2691
Reviewed-on: http://gerrit.openafs.org/10524
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: AFSRDFSProvider NPOpenEnum vs no redirector
Jeffrey Altman [Tue, 26 Nov 2013 01:27:10 +0000]
Windows: AFSRDFSProvider NPOpenEnum vs no redirector

If there is no redirector device present, return WN_NO_NETWORK
to indicate that this network provider is not ready for browsing.

Change-Id: I3e33769bb2d52a59b0ff993aa07e89d959d60800
Reviewed-on: http://gerrit.openafs.org/10523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoRemove klogin
Ben Kaduk [Wed, 27 Nov 2013 15:26:33 +0000]
Remove klogin

It has not been connected to the build since at least the 1.2 days
and should be considered dead code.

FIXES 131777

Change-Id: Id1551e7f9f543934dc8755a29f46aa7b905bfadd
Reviewed-on: http://gerrit.openafs.org/10522
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoWindows: Rationalize Freelance vs "fs flush*"
Jeffrey Altman [Tue, 26 Nov 2013 15:52:45 +0000]
Windows: Rationalize Freelance vs "fs flush*"

Background:

cm_scache_t objects representing Freelance volume (cell=-1, volume=-1)
are special because they are populated from the Freelance mountpoint
and symlink tables.  These tables are in turn generated from the
registry.  The tables are regenerated on-demand after the execution of
cm_noteLocalMountPointChange() which increments cm_data.fakeDirVersion
which becomes the new data version value for the (-1.-1.1.1) directory
object.

The next time that cm_GetSCache() is called for a Freelance object
the fake root directory is rebuilt by cm_InitFakeRootDir().  Since the
vnode values are not persistent with regards to directory entry names the
FileId unique is used to distinguish the various versions.
cm_data.fakeUnique is incremented with each call to cm_InitFakeRootDir().

Each time cm_noteLocalMountPointChange() is executed the afs redirector is
notified of the data version change which will force the redirector to
rebuild its view of the directory the next time a path evaluation requires
evaluation of the root (\afs).  In other words, on the next request.

If cm_noteLocalMountPointChange() is executed multiple times there is the
possibility of a race between the redirector and the service.  When the
race is lost the redirector receives an invalidation event for -1.-1.1.1
as it is in the process of rebuilding the directory contents.  The
redirector ends up believing it has the most recent data version when it
doesn't but the service no longer has Freelance mountpoint and symlink
tables representing the requested data version.  Hence, the mountpoints
and symlinks end up as CM_SCACHETYPE_INVALID.

fs flushfile and fs flushvolume both had explicit checks to prevent
flushing Freelance objects because each call to cm_FlushFile() on a
Freelance object would execute cm_noteLocalMountPointChange() triggering
the race.

The Problem:

fs flushall is not executed on a specific object (volume or file).
Therefore there was no explicit check to prevent execution against
Freelance objects.  For each cm_scache_t in the cache cm_FlushFile() is
processed.  If there are N Freelance mountpoints and symlinks, there will
be N+1 calls to cm_noteLocalMountPointChange() in quick succession.  Not
only does this risk losing the race described above but it is extremely
wasteful as the Freelance tables may be repeatedly regenerated.

This Patchset:

This patchset re-organizes the Freelance processing in the flush code
paths.  cm_FlushFile() and cm_FlushVolume() can simply no longer be
successfully executed against a Freelance object.  Both will return
CM_ERROR_NOACCESS.

"fs flush <file>" is not permitted against Freelance objects.

"fs flushvolume <path>" will execute cm_noteLocalMountPointChange() once if
the path is a Freelance object.

"fs flushall" continues to execute cm_FlushFile() on all cm_scache_t
objects.  The calls on Freelance object will fail.  After all cm_scache_t
objects are flushed then cm_noteLocalMountPointChange() will be executed
once to force the Freelance directory to be rebuilt.

This patchset does not address the race but significantly reduces the
likelihood the race will be lost.

Change-Id: I298dad453432001b7b2e6f4533ddee17e041b02e
Reviewed-on: http://gerrit.openafs.org/10521
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: Reset mp/symlink target during fs flush*
Jeffrey Altman [Tue, 26 Nov 2013 15:31:32 +0000]
Windows: Reset mp/symlink target during fs flush*

When processing a "fs flush*" command, reset the the cm_scache_t
mountPointStringp which contains the known mountpoint or symlink
target information.

Change-Id: I72bba6101699e82649eed226cdfc73077b13de92
Reviewed-on: http://gerrit.openafs.org/10520
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoLinux: Fix build for older kernels w/o bool
Stephan Wiesand [Thu, 21 Nov 2013 14:01:29 +0000]
Linux: Fix build for older kernels w/o bool

Commit b7f4f2023b2b3e1aac46715176940fb50cc75265 broke builds against
older kernels which don't have bool defined in linux/types.h . Fix
this by using unsigned char instead of bool for the static inline
functions.

Change-Id: Icbb82446ef66edd2650f33135ed6ccd2b8a920b2
Reviewed-on: http://gerrit.openafs.org/10483
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoSupport for changes to OS X Mavericks VNOP_SYMLINK() function.
Ken Hornstein [Wed, 20 Nov 2013 18:37:52 +0000]
Support for changes to OS X Mavericks VNOP_SYMLINK() function.

Add support for an extra argument to afs_symlink() to return the
newly-created symlink vnode if requested (this is needed on OS X
Mavericks).  On OS X Mavericks return the newly-created symlink vnode in
the symlink vnops functions, on all other platforms ignore it.

It turns out that technically OS X has required the symlink to be
created for a while, but code inside of symlink() would call namei() on
the symlink name if the returned vnode point was NULL.  The difference
is that on Mavericks the Manditory Access Control Framework has been
enabled, and that turns on some extra code which unconditionally calls
vnode_mount() on the returned vnode pointer, which ends up causing a
panic

Change-Id: I33b2f51cd10f76689eb9868eb05800ab493087c4
Reviewed-on: http://gerrit.openafs.org/10474
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoWindows: cm_Analyze retries vs CM_REQ_NORETRY
Jeffrey Altman [Mon, 18 Nov 2013 04:03:43 +0000]
Windows: cm_Analyze retries vs CM_REQ_NORETRY

CM_REQ_NORETRY is set by threads that want all errors returned
immediately.  However, there are some errors that should never
be returned:

  RX_MSGSIZE
  RX_CALL_BUSY
  VNOSERVICE
  RX_CALL_IDLE
  RXKADEXPIRED
  VICECONNBAD
  VICETOKENDEAD

For these errors even if the thread has requested no retries a RPC
retry must be performed.

Change-Id: I692f65a9fdbbf27fc880ac8912fc72c1d1357c6d
Reviewed-on: http://gerrit.openafs.org/10470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agocmd: Correctly initialize cmd_OptionAsString arguments
Chas Williams (CONTRACTOR) [Wed, 20 Nov 2013 18:57:13 +0000]
cmd: Correctly initialize cmd_OptionAsString arguments

These are coming from the stack and as such they might not be NULL.

Change-Id: Ia5c6efd08574b4de05a11dceae47021b0160395b
Reviewed-on: http://gerrit.openafs.org/10475
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoLinux: always include <linux/uidgid.h> headerfile
Christof Hanke [Tue, 19 Nov 2013 08:57:22 +0000]
Linux: always include <linux/uidgid.h> headerfile

when it is required. In some linux-kernels (like in SLES11 SP3)
it is not done automatically and the compilation fails.

Change-Id: I1e84969b26e87e36893b071103325a7a532ebbf9
Reviewed-on: http://gerrit.openafs.org/10471
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoutil: remove dup include
Michael Meffie [Wed, 2 Oct 2013 19:37:18 +0000]
util: remove dup include

Change-Id: I415dbcae5ae549b6347286ecdee5717fb66cc012
Reviewed-on: http://gerrit.openafs.org/10319
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agocleanup potpourri.h references
Michael Meffie [Wed, 2 Oct 2013 19:35:09 +0000]
cleanup potpourri.h references

Clean up references to a header file which was removed some time ago.

Change-Id: I2ddc26afc01edf84bb1bdb21a3488c88dd6c9775
Reviewed-on: http://gerrit.openafs.org/10318
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoautoconf: Combine the x86/solaris configuration stanzas
Chas Williams (CONTRACTOR) [Wed, 6 Nov 2013 13:45:52 +0000]
autoconf: Combine the x86/solaris configuration stanzas

This reduces some clutter and makes it easier to see what is
different.

Change-Id: I2bad8b085daf04444d2740287c106008e2650bc9
Reviewed-on: http://gerrit.openafs.org/10463
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoautoconf: Combine the sparc/solaris configurations
Chas Williams (CONTRACTOR) [Wed, 6 Nov 2013 12:36:02 +0000]
autoconf: Combine the sparc/solaris configurations

According to cc's man page:

  v9        Is equivalent to -m64 -xarch=sparc
    Legacy makefiles and scripts that use
    -xarch=v9 to obtain the 64-bit memory model
    need only use -m64.

Change-Id: Idd1021f3fef9c427072079f3c7d7aa9ca6fa0060
Reviewed-on: http://gerrit.openafs.org/10462
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoWindows: cm_FindVolumeByFID
Jeffrey Altman [Fri, 15 Nov 2013 23:32:37 +0000]
Windows: cm_FindVolumeByFID

cm_GetVolumeByFID() does not query the vldb if the volume group
is not known to the cache manager.   cm_FindVolumeByFID() is to
be used in cases where the volume group data must be known for the
operation to successfully complete.

Change-Id: I9bb3bd13f14dea534952495b00a3348aafd2d591
Reviewed-on: http://gerrit.openafs.org/10465
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: Fix out of range pointer validation
Jeffrey Altman [Tue, 12 Nov 2013 14:58:44 +0000]
Windows: Fix out of range pointer validation

The ACL, Stat, and Volume pointer validation checks did not take
into account that NULL is a valid pointer value.  As a result the
cache validation failed.

Change-Id: I538310d534fd4ada383d5bf0dc58d49206fe3dfb
Reviewed-on: http://gerrit.openafs.org/10453
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows; GetSystemTimeAsFileTime
Jeffrey Altman [Mon, 4 Nov 2013 05:12:07 +0000]
Windows; GetSystemTimeAsFileTime

As per Raymond Chen's "The Old New Thing" blog

  http://blogs.msdn.com/b/oldnewthing/archive/2013/11/01/10462403.aspx

Calling GetSystemTime() followed by SystemTimeToFileTime() performs
two format translations which can be avoided by using
GetSystemTimeAsFileTime() directly.

Change-Id: I3d3de0e045777c9dfdb1c1f4503bfdfe19fb7b73
Reviewed-on: http://gerrit.openafs.org/10430
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: GiveUpAllCallBacks only if non-loopback
Jeffrey Altman [Wed, 30 Oct 2013 04:44:25 +0000]
Windows: GiveUpAllCallBacks only if non-loopback

If the only ip addresses are known to be loopback addresses, then
do not waste time by attempting to GiveUpAllCallBacks during suspend
or shutdown.

Change-Id: I28b08e61435a7132ba08c9649010185097df0da0
Reviewed-on: http://gerrit.openafs.org/10429
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoLinux: Get rid of !STRUCT_KEY_UID_IS_KUID_T case
Anders Kaseorg [Thu, 7 Nov 2013 20:37:25 +0000]
Linux: Get rid of !STRUCT_KEY_UID_IS_KUID_T case

On the few kernel versions before struct key.uid was converted to
kuid_t (v3.7-rc1~147^2~76), it was not possible to enable both
CONFIG_KEYS and CONFIG_UIDGID_STRICT_TYPE_CHECKS, so this case was
impossible.  That’s good, because it also had a typo in its
implementation (and was confusing to deal with correctly).

Change-Id: I4ecd164ed3604558ed4419bf6f9d531bd5d1a9ff
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10443
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoLinux: afs_fill_super: Call bdi_destroy on the failure path
Anders Kaseorg [Tue, 12 Nov 2013 05:23:47 +0000]
Linux: afs_fill_super: Call bdi_destroy on the failure path

Without this, if AFS startup failed, then trying to start AFS again
triggers these warnings:

WARNING: CPU: 3 PID: 657 at /build/buildd/linux-3.12.0/fs/sysfs/dir.c:526 sysfs_add_one+0xa5/0xd0()
sysfs: cannot create duplicate filename '/devices/virtual/bdi/afs'

WARNING: CPU: 3 PID: 657 at /build/buildd/linux-3.12.0/lib/kobject.c:196 kobject_add_internal+0x1f4/0x300()
kobject_add_internal failed for afs with -EEXIST, don't try to register things with the same name in the same directory.

and leads to general system instability.  This can be reproduced by
starting AFS twice with an empty cache, dynroot disabled, and no
network.

Change-Id: I8ec1ed365c5b3cf60bd34af0aca94e0c496bcaa3
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10448
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agobuild: more configure summary
Michael Meffie [Thu, 3 Oct 2013 16:44:30 +0000]
build: more configure summary

Improved configure summary, including a check for namei fileserver mode.

Change-Id: Id5117ae8c27126c56e28eb3ab7f6e8ef7fd0558d
Reviewed-on: http://gerrit.openafs.org/10372
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: backup manpage fixes
Andrew Deason [Thu, 7 Nov 2013 06:05:39 +0000]
doc: backup manpage fixes

 - Consistently specify -dryrun and -n across various subcommands.
   Many did not list -n, some listed -n but no -dryrun, and some
   listed -noexecute instead.

 - backup_volrestore: Add missing option -usedump

 - backup_deletedump: Add missing options -groupid, -dbonly, -force,
   and -portoffset

Change-Id: Iec1c36cba0ad0e61d7e6215c9cba81228b95a81f
Reviewed-on: http://gerrit.openafs.org/10441
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agobackup deletedump: Change -port to -portoffset
Andrew Deason [Thu, 7 Nov 2013 06:03:17 +0000]
backup deletedump: Change -port to -portoffset

Use -portoffset instead of -port, for consistency with all of the
other backup suite commands. Leave -port in as an alias, for backwards
compatibility. Currently -port will mean -portoffset anyway, since
it's an unambiguous abbreviation, but put in the alias explicitly,
just in case some other option comes along starting with -port.

Change-Id: I2f8aaa34fdf9e7c80a8fec1dc1caf63d9b7192b1
Reviewed-on: http://gerrit.openafs.org/10440
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agobackup: Display general help on -help
Andrew Deason [Tue, 5 Nov 2013 17:00:21 +0000]
backup: Display general help on -help

Currently, 'backup' tries to guess if we are running 'backup
interactive' before libcmd actually parses our arguments. This is
tricky, since we run 'backup interactive' if no explicit subcommand is
actually given. One consequence of this is that currently, running
'backup -help' just displays the help for the 'backup interactive'
command, not the help output for 'backup' itself.

The current heuristics for guessing at whether we are running 'backup
interactive' or not are a bit fishy, but at least for now, just make
sure -help works. This should still ensure any other behavior is
unchanged, but just 'backup -help' now works like other command
suites.

Change-Id: I31ecbcad7efffd301d23f109c66eee0417882a90
Reviewed-on: http://gerrit.openafs.org/10439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: Add 'checkman' tool
Andrew Deason [Wed, 12 Jun 2013 22:48:46 +0000]
doc: Add 'checkman' tool

Add the 'checkman' script, which compares a command's "-help" output
to the options actually documented in its manpage. This command is
certainly not perfect, and may contain false negatives and false
positives. It is not (currently) intended to be run as an automated
check, but is meant to assist a human manually checking the
correctness of man pages. An error reported by 'checkman' does not
necessarily indicate something that should actually be changed.

Change-Id: Iae1965c441279dd3f93c1a7283ea0a0140d5ebe3
Reviewed-on: http://gerrit.openafs.org/10442
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agobos: Remove MR-AFS commands and options
Andrew Deason [Fri, 14 Jun 2013 20:37:27 +0000]
bos: Remove MR-AFS commands and options

The blockscanner and unblockscanner commands, as well as many options
to "bos salvage", were only of use to MR-AFS. MR-AFS is not used
anywhere anymore, and these commands and options were largely
undocumented, so get rid of them. See
<https://lists.openafs.org/pipermail/openafs-info/2013-January/039215.html>.
Thanks to Hartmut Reuter for providing information about this.

Change-Id: I496eb4a23a0310aafd6c224a08c76a8b7464c758
Reviewed-on: http://gerrit.openafs.org/10425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agovolserver: Remove -sleep functionality
Andrew Deason [Thu, 31 Oct 2013 04:33:40 +0000]
volserver: Remove -sleep functionality

This option is completely useless since the LWP volserver was removed.
Remove the code for it.

Change-Id: I2257ba2ecd2ffeb9c47d21cbb516d6a0abb19b94
Reviewed-on: http://gerrit.openafs.org/10424
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agovolserver: Restore -allow-dotted-principals
Andrew Deason [Thu, 31 Oct 2013 04:28:16 +0000]
volserver: Restore -allow-dotted-principals

Commit cd3492d0 converted volserver command-line parsing to use
libcmd. However, it accidentally also changed the
-allow-dotted-principals option to -dotted. Change it back to
-allow-dotted-principals for consistency with previous versions, as
well as other server processes.

Note that currently there are no public releases of OpenAFS containing
cd3492d0, so no public release has contained the -dotted option.

Change-Id: Ied07f0eb867a13591656daae00bc9e85a2c7f6c8
Reviewed-on: http://gerrit.openafs.org/10423
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agovolserver: Exit on arg parsing failure
Andrew Deason [Wed, 30 Oct 2013 02:22:02 +0000]
volserver: Exit on arg parsing failure

If ParseArgs returns an error, argument parsing failed. Currently we
keep going anyway, ignoring the error. Exit instead.

Change-Id: I2f9e4e06d6c3fab8e29921bdb0ea30d714c794b1
Reviewed-on: http://gerrit.openafs.org/10422
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoLinux: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS (user namespaces)
Anders Kaseorg [Thu, 31 Oct 2013 13:11:59 +0000]
Linux: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS (user namespaces)

With CONFIG_UIDGID_STRICT_TYPE_CHECKS (a dependency of user namespace
support, CONFIG_USER_NS) turned on, uid_t and kuid_t are different
types, as are gid_t and kgid_t, and we need to use namespace-dependent
functions to convert between them.

We can’t use init_user_ns as the namespace because it’s GPL-only, so
instead we grab the current user_ns at module load time.

This is required to support kernels with user namespace support.  We
don’t yet have full support for independent AFS use by different users
in a multiuser container; that will need to wait for future work.

Change-Id: Icc03f9098dd25b483d406db5167264ba960cdcb7
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10386
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoafs_linux_pag_from_groups: Stop checking for NOGROUP sentinel
Anders Kaseorg [Tue, 5 Nov 2013 06:11:15 +0000]
afs_linux_pag_from_groups: Stop checking for NOGROUP sentinel

Linux hasn’t used NOGROUP as a sentinel like this since before kernel
2.1.12, and OpenAFS hasn’t used it on Linux since commit
109927bf6f54b58b76ac48ba41c2012c74937fed (Remove pre-Linux 2.6
support).

Change-Id: I0b18de8e5d9b6cd9b20da43ed050163c2d8651ff
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10426
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoExit successfully on -help
Andrew Deason [Wed, 30 Oct 2013 02:11:54 +0000]
Exit successfully on -help

Running a command with -help is not an error. cmd_Dispatch handles
this correctly, but several server processes call cmd_Parse directly,
and exit with failure on -help. Make them exit successfully instead.

Change-Id: Ieab32ba4a62a182308538469e69320d241dc3aad
Reviewed-on: http://gerrit.openafs.org/10421
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoklog.krb5: Don't hide the -x option
Andrew Deason [Sat, 27 Jul 2013 02:58:21 +0000]
klog.krb5: Don't hide the -x option

We accept the -x option, even if it doesn't do anything. Don't hide
it, to be honest about what options we accept.

Change-Id: I779558c429b18c97c495c5e9ae81f8630383f572
Reviewed-on: http://gerrit.openafs.org/10420
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoDo not hide -enable_{peer,process}_stats
Andrew Deason [Mon, 4 Nov 2013 00:59:08 +0000]
Do not hide -enable_{peer,process}_stats

Both afsd and kaserver accepted the -enable_peer_stats and
-enable_process_stats options, but they did not include the options in
their usage message. We already document these flags in the manpages,
so also include them in the usage message; they are not a secret.

Change-Id: Ic1ff0e8c0dcd07e2721676b09a53c30a3db3ee9d
Reviewed-on: http://gerrit.openafs.org/10419
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoptserver: Fix argument aliases
Andrew Deason [Sun, 30 Jun 2013 22:44:21 +0000]
ptserver: Fix argument aliases

It's "-db", not "db". Similarly, it's "-depth", not "depth".

Change-Id: I24a3f08d02f9b14d06ad3f04c52957c46001b2d9
Reviewed-on: http://gerrit.openafs.org/10418
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agobozo: Fix help message formatting
Andrew Deason [Sun, 30 Jun 2013 18:41:47 +0000]
bozo: Fix help message formatting

Need a space here to separate [-allow-dotted-principals] from the
following option.

Change-Id: Iabe353fd1c5366064a448c15a7c986d0fcf35415
Reviewed-on: http://gerrit.openafs.org/10417
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoviced: Misc argument parsing fixes
Andrew Deason [Fri, 14 Jun 2013 21:17:44 +0000]
viced: Misc argument parsing fixes

 - It's -pctspare, not pctspare.

 - The -config and -logfile options are already specified in the
   "testing" options section. Don't specify them again here.

Change-Id: Ieace97d92d35dc2e310a8122bdec7987246aa723
Reviewed-on: http://gerrit.openafs.org/10416
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: Add 'fs discon' manpage
Andrew Deason [Mon, 28 Oct 2013 04:19:24 +0000]
doc: Add 'fs discon' manpage

Change-Id: I67c3bf50bfb7f4f7c0eb46cd011cc8ae68ec5302
Reviewed-on: http://gerrit.openafs.org/10415
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: Add 'fs nukenfscreds' manpage
Andrew Deason [Sat, 19 Oct 2013 20:12:03 +0000]
doc: Add 'fs nukenfscreds' manpage

Change-Id: I51c6cd56f463e10ab51adf20a0cf8505e3361326
Reviewed-on: http://gerrit.openafs.org/10414
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: Add 'fs precache' manpage
Andrew Deason [Sun, 13 Oct 2013 03:55:09 +0000]
doc: Add 'fs precache' manpage

Change-Id: Ib4101fdb37cf91a547974216425e4a005392d988
Reviewed-on: http://gerrit.openafs.org/10413
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: Symlink all dafssync-debug pages
Andrew Deason [Thu, 5 Sep 2013 05:48:02 +0000]
doc: Symlink all dafssync-debug pages

For every fssync-debug subcommand, provide a symlink for the
associated dafssync-debug subcommand. This way, running e.g.
"man dafssync-debug_attach" will actually give you a manpage, instead
of needing to specifically run "man fssync-debug_attach".

Change-Id: I83d71dc14f9f838d9a9900fcc62817677898dd27
Reviewed-on: http://gerrit.openafs.org/10412
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: Fix livesys output formatting
Andrew Deason [Mon, 4 Nov 2013 16:04:42 +0000]
doc: Fix livesys output formatting

If we indent text here, the formatting codes are not interpreted, and
the text is output "raw". So currently, we actually see
"I<system_type>" in this section, which is a bit confusing.

Saying the actual output with string substitutions and stuff here
doesn't seem very helpful when the output doesn't have any constant
text in it. Just describe what the output is instead; an example
immediately follows if this is unclear.

Change-Id: Ib3e0f0c5143afa2dd41a655ff3908c791026a426
Reviewed-on: http://gerrit.openafs.org/10411
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: butc manpage fixes
Andrew Deason [Thu, 5 Sep 2013 05:26:00 +0000]
doc: butc manpage fixes

Add missing -rxbind option.

Change-Id: I25fb205dc058ed345bda4d86bd1d344457432939
Reviewed-on: http://gerrit.openafs.org/10410
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: pt_util manpage fixes
Andrew Deason [Sat, 27 Jul 2013 03:14:07 +0000]
doc: pt_util manpage fixes

Add missing -help option.

Change-Id: I2edd7bcaf5b5799ba1216777200580df2cd9ca7f
Reviewed-on: http://gerrit.openafs.org/10409
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: kdb manpage fixes
Andrew Deason [Sat, 27 Jul 2013 03:10:16 +0000]
doc: kdb manpage fixes

Add the missing -numeric and -long options.

Change-Id: I83776e64a161bc0a3ca9260944570799c506bbac
Reviewed-on: http://gerrit.openafs.org/10408
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: volinfo manpage fixes
Andrew Deason [Sat, 27 Jul 2013 02:49:05 +0000]
doc: volinfo manpage fixes

We now have a -checkout option, but no -online option. Document
-checkout and remove -online.

Change-Id: Ie8d6e35c6e09abf994b8417b3bb20ee379095a25
Reviewed-on: http://gerrit.openafs.org/10407
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: rxdebug manpage fixes
Andrew Deason [Sat, 27 Jul 2013 02:00:14 +0000]
doc: rxdebug manpage fixes

Add missing option -long.

Change-Id: I23e3bc38e6962b7727a2aaa07bab7b0818ebcee0
Reviewed-on: http://gerrit.openafs.org/10406
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: vldb_check manpage fixes
Andrew Deason [Wed, 24 Jul 2013 23:00:25 +0000]
doc: vldb_check manpage fixes

 - Add missing option -fix

 - Don't use brackets in the option list; we don't do this in most
   other manpages.

Change-Id: Ifd87dd749aaab2987b2f9c3224b8e931b7bc221c
Reviewed-on: http://gerrit.openafs.org/10403
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: upserver manpage fixes
Andrew Deason [Sat, 27 Jul 2013 01:54:20 +0000]
doc: upserver manpage fixes

Add missing option -rxbind.

Change-Id: I1e6057c3747cf6c502bf14e1d094b8b64691615d
Reviewed-on: http://gerrit.openafs.org/10405
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: afsmonitor manpage fixes
Andrew Deason [Sat, 27 Jul 2013 01:40:50 +0000]
doc: afsmonitor manpage fixes

Add missing option -debug.

Change-Id: I48b37cce536987f5cbf3905e1de70238e83664b5
Reviewed-on: http://gerrit.openafs.org/10404
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: Make all vos pages =include common options
Andrew Deason [Sun, 30 Jun 2013 02:06:51 +0000]
doc: Make all vos pages =include common options

Many manpages for "vos" subcommands were not using the "common" vos
fragments, and instead were just repeating the information directly in
their manpage. Make them all use the "common" vos fragment to avoid
duplication.

Change-Id: I62d84a1164b4ba46082e33a6d27fd24e3722014c
Reviewed-on: http://gerrit.openafs.org/10398
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agodoc: vos manpage fixes
Andrew Deason [Thu, 20 Jun 2013 22:45:05 +0000]
doc: vos manpage fixes

 - Add missing -config option to 'common' vos options, and to the
   synopsis for all commands

 - Remove brackets in the options descriptions for vos_shadow,
   vos_create, and vos_clone. We don't do this in other manpages.

 - vos_create: Add missing -id, -roid to synopsis

 - vos_clone: Add missing -readwrite option

 - vos_shadow: Add missing -toid option

Change-Id: I41fd56509e78116698c82a2f3f4fd07f26cdc95f
Reviewed-on: http://gerrit.openafs.org/10397
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: fs manpage fixes
Andrew Deason [Sat, 29 Jun 2013 20:59:51 +0000]
doc: fs manpage fixes

 - fs_whichcell: Fix formatting typo

 - fs_setcbaddr: Change -host to -addr

 - Add missing -help to fs_setcbaddr and fs_rxstatproc

 - fs_getfid: Add missing -literal to synopsis

 - fs_exportafs: List on/off options in single =item. Doing this in
   two separate consecutive =items confuses the manpage generator.

 - fs_exportafs: Add missing -clipags and -pagcb

Change-Id: I4e986543292f1000fc00456fde486d7da573c9c3
Reviewed-on: http://gerrit.openafs.org/10396
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: restorevol manpage fixes
Andrew Deason [Sun, 30 Jun 2013 22:59:02 +0000]
doc: restorevol manpage fixes

 - Remove nonexistent -verbose option from synopsis

 - Add missing options -umask and -help

Change-Id: Iedddf78c074ead9ab3454bf151adb90138a562b6
Reviewed-on: http://gerrit.openafs.org/10402
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: bosserver manpage fixes
Andrew Deason [Mon, 4 Nov 2013 01:04:30 +0000]
doc: bosserver manpage fixes

Fix -noauth documentation. The current documentation is referring to
the client-side -noauth option, but this is actually the server-side
-noauth option, which is very different.

Change-Id: I65154aef4734e69bb0f3ae485baacac11a718488
Reviewed-on: http://gerrit.openafs.org/10401
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: vlserver manpage fixes
Andrew Deason [Mon, 4 Nov 2013 01:03:42 +0000]
doc: vlserver manpage fixes

 - Indent synopsis formatting

 - Add missing options -trace, -noauth, -smallmem, -rxmaxmtu,
   and -syslog

 - Fix some formatting typos in the synopsis

 - Document the -db alias by putting it next to the -database option,
   separated by a pipe "|"

Change-Id: I4c84baf53d346cb47416cb2843e8b7de2437d147

vlserver: -database option

Change-Id: I7f5539aeebee71441a3901a183033fac05fa411f
Reviewed-on: http://gerrit.openafs.org/10400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: ptserver manpage fixes
Andrew Deason [Mon, 4 Nov 2013 01:02:50 +0000]
doc: ptserver manpage fixes

 - Indent synopsis formatting

 - Document the -db and -depth aliases by putting them next
   to -database and -groupdeth (respectively) separated by a pipe "|"

Change-Id: Ic40fa0001feee293afe6c22ade7b85dc46fde938
Reviewed-on: http://gerrit.openafs.org/10399
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: Add -help option to fssync-debug manpages
Andrew Deason [Thu, 20 Jun 2013 22:20:17 +0000]
doc: Add -help option to fssync-debug manpages

Change-Id: Id90554b1c56437c62ff9982681ac8a64d4d34948
Reviewed-on: http://gerrit.openafs.org/10395
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: volserver manpage fixes
Andrew Deason [Thu, 31 Oct 2013 04:27:19 +0000]
doc: volserver manpage fixes

 - Fix synopsis formatting, so option arguments are on the same line
   as the option name

 - Add missing options -rxmaxmtu, -rxbind, -syslog, and -sleep

Change-Id: I6e6f06d716e7f78be288bfebde97a3701f086924
Reviewed-on: http://gerrit.openafs.org/10394
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: fileserver manpage fixes
Andrew Deason [Fri, 14 Jun 2013 21:54:01 +0000]
doc: fileserver manpage fixes

 - Fix typo in -syslog option formatting

 - Add missing -nobusy

 - Add missing -vlrudisable

 - Add missing -sync in synopsis

Change-Id: Id63c3228af619c2da5ef88a40e9c2e91888535bb
Reviewed-on: http://gerrit.openafs.org/10393
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: kaserver manpage fixes
Andrew Deason [Fri, 14 Jun 2013 21:15:03 +0000]
doc: kaserver manpage fixes

 - Add missing -rxbind

 - Add missing -crossrealm

 - Fix synopsis formatting, so option arguments are on the same line
   as the option name

Change-Id: I8c73d0f14396aad83651c3037fde1137d83e6692
Reviewed-on: http://gerrit.openafs.org/10392
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: voldump manpage fixes
Andrew Deason [Fri, 14 Jun 2013 21:03:40 +0000]
doc: voldump manpage fixes

Add missing documentation for the -time and -help options.

Change-Id: I04ca0fe6d4a5c298415e450a38a19b719dca4800
Reviewed-on: http://gerrit.openafs.org/10391
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: bos manpage fixes
Andrew Deason [Fri, 14 Jun 2013 20:58:45 +0000]
doc: bos manpage fixes

Add missing documentation for the -mode option.

Change-Id: I360dc3d4cc6d7405feb655bbf2a05aee27a41d46
Reviewed-on: http://gerrit.openafs.org/10390
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: buserver manpage fixes
Andrew Deason [Fri, 14 Jun 2013 20:33:19 +0000]
doc: buserver manpage fixes

 - Add missing -ubikbuffers

 - Remove -enable_peer_stats and -enable_process_stats; we don't
   actually accept these options

 - Fix synopsis formatting, so option arguments are on the same line
   as the option name

 - Fix the -noauth documentation. The current text is referring to the
   client-side -noauth option, but this is actually the server-side
   -noauth option, which is very different.

Change-Id: I11e557e54a8539627ae7bb79cb7af3e8fbc77d25
Reviewed-on: http://gerrit.openafs.org/10389
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agodoc: Fix udebug -port bullet list
Andrew Deason [Sun, 3 Nov 2013 23:58:02 +0000]
doc: Fix udebug -port bullet list

The formatting gets screwed up if we have multiple =item tags together
like this. To just have each one be a bullet point, just have a bare
=item before each one, without a "tag" or "key" for the =item.

Change-Id: I5cb7a98bd16f5999d529a42a0f822835f6d2f66e
Reviewed-on: http://gerrit.openafs.org/10388
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: pts manpage fixes
Andrew Deason [Wed, 12 Jun 2013 23:22:27 +0000]
doc: pts manpage fixes

 - Mention the -help, -auth, -encrypt, and -config options for all pts
   commands in their synopsis

 - Add the -auth option to the pts.pod page

 - Reference the -auth, -encrypt, and -config options from all
   subcommand pts pages

 - pts_removeuser: Replace -name with -user

 - pts_sleep: Add missing -delay

 - pts_source: Add missing -file

Change-Id: I4f0889d661c46f6bdd2a9604d8423d809a632d2d
Reviewed-on: http://gerrit.openafs.org/10387
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agodoc: add linked cells description to man pages
Ken Dreyer [Mon, 14 Oct 2013 17:39:02 +0000]
doc: add linked cells description to man pages

The man pages previously described linking DCE cells to AFS cells.
OpenAFS and YFS also allow linking between two AFS cells. Update the
description of linked cells in CellServDB(5), aklog(1), and
fs_newcell(1) to refer to AFS instead of DCE.

Add a linked cell example to the CellServDB man page with an
explanation.

Change-Id: Ic9b1c643861b7307c09fcc5a1775f4abf4cb4155
Reviewed-on: http://gerrit.openafs.org/10342
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoafs: afs_CacheIsTooFull macro refs wrong constant
Jeffrey Altman [Sat, 7 Sep 2013 17:55:58 +0000]
afs: afs_CacheIsTooFull macro refs wrong constant

When afs_CacheIsTooFull tests the number of free blocks it should
use CM_DCACHESPACEFREEPCT (90%) instead of CM_DCACHECOUNTFREEPCT (95%).

Change-Id: I1c9ac4f9a6d03077047837af6ef9a09e256ea07d
Reviewed-on: http://gerrit.openafs.org/10235
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoafs: CacheTruncateDaemon work until Cache Drained
Jeffrey Altman [Mon, 9 Sep 2013 13:20:32 +0000]
afs: CacheTruncateDaemon work until Cache Drained

The afs_CacheTruncateDeamon() thread will not sleep until both
'afs_CacheTooFull' and 'afs_WaitForCacheDrain' are true but the
thread will stop freeing space in the cache when 'afs_CacheTooFull'
is true which prevents 'afs_WaitForCacheDrain' from ever becoming
true if it is not already.

Make the conditional for doing work include 'afs_WaitForCacheDrain'.

Change-Id: I9a60da6db65511c8bf2391a53a6f76043f825078
Reviewed-on: http://gerrit.openafs.org/10238
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoafs: afs_CacheTruncateDaemon wake waiters !too full
Jeffrey Altman [Sat, 7 Sep 2013 18:04:32 +0000]
afs: afs_CacheTruncateDaemon wake waiters !too full

When processing afs_CacheTruncateDaemon() if the cache is no longer
too full, then wake the waiters.

Change-Id: I114341f8a71654b0a064d6dad2a704dd1fa8dbe2
Reviewed-on: http://gerrit.openafs.org/10236
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoafs: afs_FlushDCache avoid dup cache drained check
Jeffrey Altman [Sat, 7 Sep 2013 17:27:54 +0000]
afs: afs_FlushDCache avoid dup cache drained check

afs_WakeCacheWaitersIfDrained is called as the last statement
of both afs_DiscardDCache and afs_FreeDCache.  There is no need
to perform the same check again before exiting afs_FlushDCache.

Change-Id: I11b4c42868ca67e4717fd431b1d33a85ce57bd0f
Reviewed-on: http://gerrit.openafs.org/10234
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoafs: Introduce afs_WakeCacheWaitersIfDrained
Jeffrey Altman [Mon, 9 Sep 2013 16:17:36 +0000]
afs: Introduce afs_WakeCacheWaitersIfDrained

Consolidate common code into afs_WakeCacheWaitersIfDrained().

Change-Id: I10e35afbc1f1469038e111a7bbd209c8897c8972
Reviewed-on: http://gerrit.openafs.org/10233
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoafs: FreeDCache test afs_blocksDiscarded
Jeffrey Altman [Sat, 7 Sep 2013 16:26:52 +0000]
afs: FreeDCache test afs_blocksDiscarded

For consistency with afs_FlushDCache and afs_DiscardDCache
include afs_blocksDiscarded in the free space test.  When afs_FreeDCache
is called it should be zero.

Change-Id: Ic9063280d88eb28d84851cbe6b7e4867a1110659
Reviewed-on: http://gerrit.openafs.org/10232
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoWindows: RDRLib Worker Thread shutdown
Jeffrey Altman [Mon, 28 Oct 2013 05:06:47 +0000]
Windows: RDRLib Worker Thread shutdown

The thread waiting to unload the library is polling the state of
the AFS_WORKER_INITIALIZED flag in the PoolContext->State field
for each worker.  Ensure that the thread performs no actions other than
PsTerminateSystemThread() after clearing the AFS_WORKER_INITIALIZED flag.

Change-Id: I0baa92f05a5d5f00219a2cc63ca71c7a6a1f52b5
Reviewed-on: http://gerrit.openafs.org/10383
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: Uninitialized TargetNameLength/Offset
Jeffrey Altman [Tue, 29 Oct 2013 12:24:06 +0000]
Windows: Uninitialized TargetNameLength/Offset

In RDR_PopulateCurrentEntry it is possible for TargetNameLength and
TargetNameOffset to be uninitialized resulting in stack garbage being
returned to the redirector.  This can result in a blue screen.

Change-Id: Ifa306ba54bea3f26f1938cbd6bdc28521065299d
Reviewed-on: http://gerrit.openafs.org/10373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: cm_NewSCache skip in hash recycled entries
Jeffrey Altman [Fri, 18 Oct 2013 23:26:56 +0000]
Windows: cm_NewSCache skip in hash recycled entries

If cm_RecycleSCache returns an in-hash entry it means that either
it wasn't recycled properly or somehow we raced this entry with
another thread.  Just skip it and keep searching.

Change-Id: Ia443a04b063a019003662639d31f96db486d673c
Reviewed-on: http://gerrit.openafs.org/10353
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: cm_RemoveSCacheFromHashTable scp not found
Jeffrey Altman [Fri, 18 Oct 2013 23:14:00 +0000]
Windows: cm_RemoveSCacheFromHashTable scp not found

If the cm_scache_t has CM_SCACHEFLAG_INHASH flag set but cannot be
found in the CH_SCACHE_HASH(&scp->fid) hash chain then search the
entire hash table for the object.  At the end of the function we
will know that the CM_SCACHEFLAG_INHASH flag is safe to clear.

Change-Id: I92bfad98b7d3cdc42b5aa6b8fae24d47557465e7
Reviewed-on: http://gerrit.openafs.org/10352
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: EOF for Synchronous Deferred Writes on XP/2003
Rod Widdowson [Sun, 20 Oct 2013 18:29:35 +0000]
Windows: EOF for Synchronous Deferred Writes on XP/2003

The Windows IO Manager is not supposed to issue multiple
outstanding cached writes to a file system for a synchronous
file object.  To do so would risk out of order application
of writes that extend the end of file and in turn risk data
corruption.  It turns out that on Server 2003 SP2 and more
than likely XP and 2000 as well, if a file system returns
STATUS_PENDING because a write was deferred due to the
Windows Cache Manager failing CcCanIWrite(), the IO Manager
will happily continue issue subsequent write requests.

On OSes older than Vista disable the use of deferred writes
and sit in a spin loop waiting for the Windows cache manager
to make room.  This is much less efficient and increases the
write latency but it is safe.

Change-Id: Ic47d62749bdb4d0475661967fcbfd25834f21a72
Reviewed-on: http://gerrit.openafs.org/10351
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoWindows: Store OS version as a global
Jeffrey Altman [Mon, 21 Oct 2013 15:26:16 +0000]
Windows: Store OS version as a global

In DriverEntry() RtlGetVersion() is used to obtain the OS version
information.  Store the result in a global structure that can be
used elsewhere to make run time decisions based upon the OS.

Change-Id: I194e7da6858d1dea755d8de82a9bee70e63ade4d
Reviewed-on: http://gerrit.openafs.org/10350
Reviewed-by: Rod Widdowson <rdw@steadingsoftware.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoRemove bucoord/expire.c
Ben Kaduk [Fri, 25 Oct 2013 21:45:38 +0000]
Remove bucoord/expire.c

It was not compiled into anything.

Correct references in bucoord_internal to command.c.

Remove the forward declaration of struct cmd_parmdesc and make cmd.h
a prerequisite for this header, since all but two consumers had cmd.h
already.

Change-Id: Id60a550871643610ccd96c226ecf0a3c4acb3955
Reviewed-on: http://gerrit.openafs.org/10363
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoauth: prevent uninitialized key list in AFS config
Mark Vitale [Fri, 4 Oct 2013 01:42:10 +0000]
auth: prevent uninitialized key list in AFS config

_afsconf_OpenInternal() may exit early for a number of reasons
before properly initalizing afsconf_dir->listKeys.
This leads to a crash when _afsconf_CloseInternal() attempts
to clean up listKeys.

Prevent this situation by calling afsconf_InitKeys() before any
possible exit from _afsconf_OpenInternal().

Change-Id: I6911427817a2518a576c00a7ea56351f9fb4fd19
Reviewed-on: http://gerrit.openafs.org/10323
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoubik: fix include quotes
Michael Meffie [Fri, 25 Oct 2013 17:47:59 +0000]
ubik: fix include quotes

Include the generated header in the current directory.

Change-Id: Iaa22fcfd0e22e5f33e7c9bf8a26a838b25668160
Reviewed-on: http://gerrit.openafs.org/10361
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agovos: Remove pthread send/receive select()
Andrew Deason [Wed, 23 Oct 2013 20:32:19 +0000]
vos: Remove pthread send/receive select()

Commit 65e701fee4968b17066bb81e25b7adaa4024d4f3 introduced a couple of
select() calls when the pthreaded vos writes to or reads from a usd
pipe, corresponding to the IOMGR_Select() calls in LWP. However, these
select() calls are unnecessary, since the read() or write() calls
themselves will block anyway. The reason they are there for LWP is so
the IOMGR can run another process while we're waiting for the file
descriptor to be ready.

The select() in ReceiveFile currently incorrectly waits for the output
to be ready for reading, even though we're trying to write to it. As a
result, if we try to 'vos dump' to a pipe with the pthreaded vos (such
as stdout), we will hang forever, since it will never be ready for
reading.

To fix this, just get rid of the select() calls, since they don't
really do anything.

FIXES 131749

Change-Id: Ibe8841e0c01f1e55ac4ca1a8a99ab71083654662
Reviewed-on: http://gerrit.openafs.org/10360
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

10 years agoafs: Clarify comment
Perry Ruiter [Tue, 22 Oct 2013 12:46:10 +0000]
afs: Clarify comment

Fixing a couple typos and rewording a comment for clarity in afs_segments.c

Change-Id: Ic631b6f8d59e4e9a56f61e583a8ef0f8f8794d8b
Reviewed-on: http://gerrit.openafs.org/10364
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoSysname and param.h for FreeBSD 9.2 and 11.0
Ben Kaduk [Tue, 15 Oct 2013 20:56:07 +0000]
Sysname and param.h for FreeBSD 9.2 and 11.0

9.2 is newly released and HEAD is now 11-current.

Change-Id: Ic79ff26aa39e08940b6035770fe4c6f15b02c418
Reviewed-on: http://gerrit.openafs.org/10341
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoAdjust for microtime() ABI on all XBSD
Ben Kaduk [Tue, 15 Oct 2013 20:00:01 +0000]
Adjust for microtime() ABI on all XBSD

On the BSDs, struct timeval is not two 32-bit integers like our
struct clock, so the ABI is quite incompatible.  Use the native type
for the function call and translate to our local type accordingly.

This lets us get rid of a workaround for the FreeBSD kernel build,
wherein particular compiler flags masked the stack corruption that
can occur due to this ABI mismatch.

Change-Id: I68f9947b0875dca7343ecd41a4c529d5c5bc3be5
Reviewed-on: http://gerrit.openafs.org/10340
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Antoine Verheijen <apv@ualberta.ca>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoFix build for FreeBSD 10.0
Benjamin Kaduk [Wed, 25 Sep 2013 20:57:41 +0000]
Fix build for FreeBSD 10.0

Move a rmlock.h inclusion up a bit so that the vm headers can get the
rmlock assertion (and other) macros they need.

The filedesc structure has been expanded on FreeBSD to support a
stronger capabilities system; getting to the actual file descriptor
requires another structure access.

limits.h and stdarg.h need sys/ and machine/ prefixes for inclusion in the
kernel on FreeBSD.  Fixing this lets us get rid of some unnecessary -I
arguemnts in the kernel module build, which seem to have not been functioning
as expected, anyway.

Catch up to VM layer changes.

This builds, but crashes at runtime due to some ABI incompatibilities
that appear in the rx event layer; those will be fixed in a separate patch.

Change-Id: Icc253b1e938a58a7ab8d1b789c82b9b940d263fd
Reviewed-on: http://gerrit.openafs.org/10339
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

10 years agoviced: Improve client error log messages
Andrew Deason [Fri, 18 Oct 2013 00:22:48 +0000]
viced: Improve client error log messages

Commit 6c41b1f740e16b5b9adfe9026630595be6f0699e improved a few log
messages to include the client ip and port of the request triggering
that log message. Include the viceid and fid (if applicable), too, so
an administrator may more easily identify the cause.

This creates the function LogClientError, so we can use a common
function for logging very similar information. This also modifies
h_FindClient_r to give the viceid to the caller, even in the case of
error. In addition, this modifies CallPreamble to accept a fid and
modifies all callers to accomodate.

Change-Id: I326e17538265ea3251db27a05ede25c33e9a230d
Reviewed-on: http://gerrit.openafs.org/10347
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agotabular_output: enable compilation on Windows
Christof Hanke [Wed, 9 Oct 2013 06:06:03 +0000]
tabular_output: enable compilation on Windows

Add the required directives to the makefile.

Change-Id: I7a6e612b37cbf1f6cb61faf55d7c248f8f85808c
Reviewed-on: http://gerrit.openafs.org/10328
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agotabular_output: move public headers
Christof Hanke [Wed, 9 Oct 2013 06:01:35 +0000]
tabular_output: move public headers

from tabular_output.h to afsutil_prototypes.h
Like this, tabular_output.h does not have to be included
in any devel-package.

Change-Id: I9e3089fe4a65b2a801c45ba513a8f5dc49ce609b
Reviewed-on: http://gerrit.openafs.org/10327
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agoConvert buserver to libutil's logging
Ben Kaduk [Thu, 10 Oct 2013 17:50:26 +0000]
Convert buserver to libutil's logging

The primary motivation is to get automatic log rotation, but we
also get built-in locking for the logging calls.

This does have a side effect of changing the format used to print
timestamps in the log file.

Export WriteLogBuffer from liboafs_util so as to be mostly compatible
with the ... idiosyncrasy of LogError()'s previous behavior.

Garbage-collect the unused (and un-exported) printHashTable() and LogNetDump().

Change-Id: I860370e60082ea355806b3f1945eee76db7c32e3
Reviewed-on: http://gerrit.openafs.org/10333
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Karl Ramm <kcr@1ts.org>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>

10 years agosalvager: Ignore linktable-only RW volumes
Andrew Deason [Thu, 3 Oct 2013 17:38:08 +0000]
salvager: Ignore linktable-only RW volumes

In general, the salvager will try to salvage any volume if we find an
inode for that volume. However, for namei, we'll always have at least
one inode for the RW volume, even if we only have e.g. an RO volume at
a particular site, since the linktable special inode is always marked
as for the RW volume id. So, if we salvage a volume group that only
has an RO, normally we would also try to salvage the corresponding RW,
even if it doesn't exist. We would then recreate the "missing"
metadata files, so after salvaging, the RW appears to exist as a
normal volume.

The salvager currently tries to avoid this by skipping salvaging the
RW if we find more than one volume in the volume group, and if the RW
only has one special inode, and that one special inode is the
linktable. This solves the problem most of the time, but misses a few
corner cases:

 - If we found more than one linktable, we'll try to salvage the RW
   anyway. This shouldn't happen, but certain cases of corruption can
   cause incorrectly-named linktables, resulting in multiple
   linktables.

 - If we only find one volume (the RW), we'll still salvage the RW,
   even if the only inode for it is a single linktable. This can
   happen due to botched salvages in the past, or interrupted deletes
   and such. It's just cruft.

In any situation like those, we cause an RW volume to be created where
there previously was none. This can be a problem, since the RW volume
is unknown to the administrator, and does not appear in the VLDB. Such
"phantom" volumes can be very confusing and can cause problems in the
future. For example, if that same RW volume is moved to the server
with the "phantom" RW volume, we now have two of the same RW volume on
the same server on different partitions, which is a big problem.

So, to avoid these corner cases, check all of the special inodes to
see if all of them are linktables. Also perform this check if we don't
have any non-special inodes (even if we only see 1 volume), to catch
the "cruft" case above.

Change-Id: I00df021ebedce44f69302a48ed2716bd9bda124e
Reviewed-on: http://gerrit.openafs.org/10321
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>