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>
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>
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>
Since d2d591caf2 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>
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>
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>
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>
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>
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>
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>
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>
Commit b7f4f2023b 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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
109927bf6f (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>
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>
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>
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>
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>
- 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>
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>
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>