Michael Meffie [Thu, 13 Mar 2014 16:40:17 +0000 (12:40 -0400)]
doc: volscan man page
Provide a man page for the volscan utility
Reviewed-on: http://gerrit.openafs.org/10905 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit a30b98c97d6fbf87018bcb6943e09c1c75a3918d)
Change-Id: I980dd7842bd1c606cb09ee838a584b83d004ccb1
Reviewed-on: http://gerrit.openafs.org/11280 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Benjamin Kaduk [Mon, 7 Apr 2014 21:55:09 +0000 (17:55 -0400)]
vol: Fix build with separate objdir
The volscan-main and volinfo-main source files are in the source
tree, not the object tree; refer to the objects in the Makefile
as dependencies, so that they will be picked up properly. The
objects will be made just fine by the implicit .c.o rule.
Reviewed-on: http://gerrit.openafs.org/10988 Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Tested-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 074d745a02d80bfd2c16a4e2b7b4222022f8e641)
Change-Id: I3f29fcfb0257e145e0aae62ba425ccd7df513a72
Reviewed-on: http://gerrit.openafs.org/11279 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Wed, 12 Mar 2014 19:15:32 +0000 (15:15 -0400)]
volinfo: separate volscan binary
Refactor vol-info.c into several files and change the makefile to
build a separate volscan binary, instead of using the program name
to determine if the user is running volinfo or volscan.
This commit adds new source files for the volinfo and volscan main()
function and a common header file.
Reviewed-on: http://gerrit.openafs.org/10903 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit af2e3d81cff39ed06e3bfbfcbfff52163c503c54)
Change-Id: Ie261ac5a8bd6baea7d5d5110248611219ee1c175
Reviewed-on: http://gerrit.openafs.org/11278 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Wed, 12 Mar 2014 13:37:59 +0000 (09:37 -0400)]
volinfo: refactor global options
Move the global options to a structure and pass it to the vol-info
functions. This is a precursor for creating separate volinfo and
volscan programs.
Reviewed-on: http://gerrit.openafs.org/10902 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 77e4d2146e166c5c70d4255408bde5e6499a06bf)
Change-Id: Id97ba0bfecb8104288f904b5efe693a6e652d844
Reviewed-on: http://gerrit.openafs.org/11277 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Sat, 15 Mar 2014 15:04:31 +0000 (11:04 -0400)]
volscan: hide -mask option
The -mask option is unneccessary and sets a bad precedent, so
deprecate and hide this option. The vnodes of interest can be found
can be found easily and much more flexibly with a simple command
pipeline.
Reviewed-on: http://gerrit.openafs.org/10901 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 8119636976de651ff0b8ccdca6a1a703643f7447)
Change-Id: I21519d7c0e9b3e3900cf3cd4c561d1a5aed1ef90
Reviewed-on: http://gerrit.openafs.org/11276 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Wed, 4 Sep 2013 19:10:16 +0000 (15:10 -0400)]
volscan: avoid printing null mount-point cellname
The 'mcell' field is null when there is no cell set in the mount point,
so do not try to print it.
Reviewed-on: http://gerrit.openafs.org/10226 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit db2ed13359ce8e3cd6a4981f8ce8e10ba61f6463)
Change-Id: I96ba7dec59cc6e0fc5663e8e037d76d1006905a7
Reviewed-on: http://gerrit.openafs.org/11275 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Paul Smeddle [Mon, 12 Mar 2012 19:56:11 +0000 (19:56 +0000)]
Make volscan's column delimiter option work
Currently, volscan ignores the -delim command-line option,
using the hardcoded default. This patch adds processing
for this option, allowing alternative characters.
Michael Meffie [Tue, 26 Jul 2011 13:18:44 +0000 (09:18 -0400)]
volscan: print vnode metadata information
volscan program to print vnode meta-data in a grep/awk/perl friendly
format. Optionally, find the paths of each vnode relative to the volume
root. Access control list data can be reported, and are listed as one
access entry per line. Mount point information can be shown to which
volumes are mounted from given volumes.
The path lookup code originally written by Tom Keiser.
1.6 note: The 1.6 libcmd lacks parameter offsets, so this commit
instead splits the param enums into volinfo_parm_t and volscan_parm_t,
and just uses the regular cmd_AddParm to put the parameters in the
same place as the enums. In addition, rx queues are used instead of
opr queues, since opr queues do not exist in 1.6.
Andrew Deason [Wed, 10 Aug 2011 15:23:40 +0000 (10:23 -0500)]
volinfo: Include nfs.h
nfs.h is required for various types used in vol-info.c. Include it. On
namei this header gets pulled in indirectly via other means, but on
inode it does not (and we shouldn't be relying on such anyway).
Reviewed-on: http://gerrit.openafs.org/5185 Tested-by: BuildBot <buildbot@rampaginggeek.com> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 2cd9d0536b173bf8c983aecd8599de0a82610151)
Change-Id: I8c4b1c096b617a3ed62b8e1c7b8677ee7de2a56e
Reviewed-on: http://gerrit.openafs.org/11262 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Fri, 27 May 2011 22:17:44 +0000 (18:17 -0400)]
volinfo: accept -sizeonly for -sizeOnly
For consistency, allow -sizeonly (all lowercase letters) to
request the size summary. The old option name, -sizeOnly is
available as an alias.
Define the command line option parameter positions and use
those to set and look up the options.
1.6 note: The libcmd in 1.6 lacks parameter aliases and offsets.
Instead we create params the normal way and make the offsets enum line
up with the default offsets. To get an alias for -sizeonly, we create
a new parameter that just does the same thing (P_SIZEONLY_COMPAT).
Michael Meffie [Tue, 24 May 2011 14:28:37 +0000 (10:28 -0400)]
volinfo: refactor mode variables
Untangle the various global mode variables, which became muddled when dsizeOnly
and saveinodes were introduced. DumpInfo now indicates the default mode and
DumpVnodes means print the vnode entries, not scan but sometimes print. Remove
unused globals.
Michael Meffie [Mon, 23 May 2011 02:53:46 +0000 (22:53 -0400)]
volinfo: refactor volume and vnode handling code
Refactor volume and vnode handling code for better
maintainability. Move the code invoked by -saveinodes to a new
function. Remove an unneeded else clause in HandleVolumes.
Andrew Deason [Thu, 17 Jul 2014 15:33:23 +0000 (10:33 -0500)]
LINUX: Avoid premature RO volume lock error
Commit 0fc27471e7da0c5de4addcdec1bfbca5208072cc avoids processing lock
requests for RO volumes, but it did this both in afs_lockctl() and in
the Linux-specific afs_linux_lock(). The changes in afs_linux_lock()
are incorrect, since they also avoid F_GETLK requests (whereas
afs_lockctl() just avoids F_SETLK* requests).
Additionally, the section in afs_linux_lock() incorrectly reports an
error, since it returns a positive EBADF error code, when we are
supposed to return -EBADF.
The result of all of this is that an F_GETLK F_WRLCK request for an RO
volume always fails with fcntl() returning 9 (EBADF), which is an
invalid return code for fcntl() F_GETLK (instead we should return -1
with an errno of 9). But if there are no locks, we should return
success anyway.
Just remove this section, since afs_lockctl() handles this case itself
anyway.
Thanks to Todd Lewis for reporting this issue.
Reviewed-on: http://gerrit.openafs.org/11316 Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: D Brashear <shadow@your-file-system.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit e0d0e6ffdbb11d5445b129ef0bd5030aec59d333)
Change-Id: Ia5d03e55f7bad9f5678cdb82808b56d975865438
Reviewed-on: http://gerrit.openafs.org/11361 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Wed, 23 Jul 2014 16:54:47 +0000 (11:54 -0500)]
LINUX: Drop dentry if lookup returns new file
Background: when an entry is looked up after its parent changes,
afs_linux_dentry_revalidate re-looks-up the entry name in its parent.
If we get an ENOENT back, we d_drop the dentry, and in any other
situation we just d_invalidate it. As discussed in prior commits 997f7fce437787a45ae0584beaae43affbd37cce and 389473032cf0b200c2c39fd5ace108bdc05c9d97, we cannot simply d_drop the
dentry in all cases, because that would cause legitimate directories
to be reported as "deleted" if we just failed to lookup the entry due
to e.g. transient network errors (this causes, among other things,
'getcwd' to fail with ENOENT).
However, this logic has problems if the dentry name still exists, but
points to a different file; the case where 'tvc != vcp' in
afs_linux_dentry_revalidate. If that case happens, and the dentry is
still held open by some process, we will continue to try to reference
the vcache pointed to by the 'old' dcache entry, which is incorrect.
To maybe more clearly illustrate the issue, consider the following
cases:
$ sleep 9999 < /afs/localcell/testvol.ro/dir1/file1 &
$ rm -rf /afs/localcell/testvol.rw/dir1
$ mkdir /afs/localcell/testvol.rw/dir1
$ vos release testvol
$ ls -l /afs/localcell/testvol.ro
ls: cannot access /afs/localcell/testvol.ro/dir1: No such file or directory
total 0
d????????? ? ? ? ? ? dir1
Here, on the last 'ls', afs_linux_dentry_revalidate will afs_lookup
'dir1', and notice that it points to a different file (tvc != vcp),
and will d_invalidate the dentry. But since the file is still held
open, the dentry doesn't go away, and so we are still pointing to the
vcache for the old, deleted 'dir1'. That file doesn't exist anymore on
the fileserver, so we get an ENOENT when actually trying to stat() it
(we get a VNOVNODE from the fileserver, whcih gets translated to an
ENOENT).
A possibly more serious case is when the file is just renamed:
In this situation, the same code path applies, but the old file still
exists, so we will continue to use it without error. But since we are
still pointing at the old file, of course the results are incorrect.
Once we kill the process holding the file open, the bad dentry finally
goes away and the results are valid again.
To fix this behavior, d_drop the dentry in all cases, except when we
encounter an error preventing the lookup from being done. This ensures
that the dentry is unhashed from the parent directory in the scenarios
above, and so cannot be used for a subsequent lookup.
With this change, the only afs_lookup response that causes a simple
d_invalidate is when we encounter actual errors during the lookup
(such as transient network failures). This is correct, since in those
cases we don't _know_ that the dentry is wrong. For all other cases,
we do know that the dentry is wrong and so we must force it to be
unhashed.
Reviewed-on: http://gerrit.openafs.org/11320 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit a5866b3a7c21551a8aa40fc6141cca3a65fea563)
Change-Id: I5dbde974e9166d120a5040e81696adfebf94194d
Reviewed-on: http://gerrit.openafs.org/11358 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Use location number 104, which is the next in the sequence.
The code in this module is compiled when building the
nfs translator, which is only built under linux when
configure detects it is possible.
Thanks to Andrew Deason for spotting this error.
Reviewed-on: http://gerrit.openafs.org/11351 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 05dbea9fc4da02c6349d9e0b69656acb3254cfe8)
Change-Id: I5bb69b68716f6a7147d24c0bd698c10488bca2d4
Reviewed-on: http://gerrit.openafs.org/11366 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Mon, 28 Jul 2014 21:27:40 +0000 (17:27 -0400)]
libafs: do not allow NULL creds for afs_CreateReq
Do not allow callers to pass a NULL cred to afs_CreateReq. This
avoids setting the uid of zero in the vrequest when no cred is
passed. Update callers to pass afs_osi_credp for an anonymous cred
when no cred is available.
Thanks to Andrew Deason for pointing out afs_osi_credp should be
used.
Reviewed-on: http://gerrit.openafs.org/11336 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit b7f1763652fb932ca5bd3f3351a48df11e58f2dc)
Change-Id: I0a7f17a05decdd0a9ef1ff72d7bf73153db95bed
Reviewed-on: http://gerrit.openafs.org/11365 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit fixes a vrequest leak introduced by change
I1c60701d4e4f85aedfea6be58a03468ab34edb96. On master, the corresponding
changes appear in the opposite order.
Change-Id: I1f7a5794f19abb1495bbab6014c3ccde99cf0e1d
Reviewed-on: http://gerrit.openafs.org/11381 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Sun, 19 Jan 2014 22:04:08 +0000 (17:04 -0500)]
libafs: separate source and header compile_et rules
Use the new compile_et -emit flag to generate source and header
files separately to support parallel make.
Export afs_trace.h since it is required to build libafs. Before the
compile_et -emit flag was available, The afs_trace.h file was
generated as a side-effect of creating afszcm.cat.
Reviewed-on: http://gerrit.openafs.org/10729 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 4e6b7ab904d38d38da1b80a7342bd815668a8c09)
Change-Id: Ic1474aff86e49d8df0ba151ed0e53932aa96d1ed
Reviewed-on: http://gerrit.openafs.org/11239 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Sat, 1 Mar 2014 19:52:48 +0000 (14:52 -0500)]
compile_et macros to generate source and headers separately
Common makefile macros to generate headers and source files
separately using the new compile_et -emit option.
Reviewed-on: http://gerrit.openafs.org/10869 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit be36376b244d1d94b24cb8fce44810fb31b7b5ce)
Change-Id: Ic9cf078f6a013e7529ae8f11b0378173e64ee680
Reviewed-on: http://gerrit.openafs.org/11237 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Sun, 19 Jan 2014 04:03:44 +0000 (23:03 -0500)]
libadmin: add missing bubasics dependency
bubasics is a dependency of libadmin. Add it to the top level
makefile.
This missing dependency was found by analyzing the libadmin header
file includes.
Reviewed-on: http://gerrit.openafs.org/10727 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit b8589f1b59e520aae8d412170b663ff3bc214667)
Change-Id: Ie879c29a72bbf194bf48dea73380521dc89c4c38
Reviewed-on: http://gerrit.openafs.org/11236 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Sun, 19 Jan 2014 03:40:12 +0000 (22:40 -0500)]
libadmin: rework compilation rules
Change I47b3b184a3284b56c4047e27b58b6cb3a8e16cef will add
dependencies on the header files to the library targets. Before
this can be done, we have to avoid the use of $? in compilation
rules because on AIX and OS X this causes the headers to be added
to the compilation command, making builds fail.
Michael Meffie [Sun, 19 Jan 2014 03:01:59 +0000 (22:01 -0500)]
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.
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>
(cherry picked from commit 9b1ffeeeb62cd9535dc2fc1522400abb428a0ac2)
Change-Id: Ib526d18227a6c37eac08def5ab88eb1717a848f1
Reviewed-on: http://gerrit.openafs.org/11233 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Fri, 22 Nov 2013 17:23:17 +0000 (12:23 -0500)]
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.
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>
(cherry picked from commit c8e83f0e826bc0a56321408b1c7a2afa137bab05)
Change-Id: I8a85c0e288f2231a3bf693319a8f5fcd618464e8
Reviewed-on: http://gerrit.openafs.org/11229 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Fri, 22 Nov 2013 16:50:11 +0000 (11:50 -0500)]
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.
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>
(cherry picked from commit 52fe3f52de95b698c93ca5da3c1ed59447817610)
Change-Id: I1ed7e92b8e27f3df8fc76ccaa6bac4199e40c180
Reviewed-on: http://gerrit.openafs.org/11228 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Wed, 1 Aug 2012 21:26:33 +0000 (17:26 -0400)]
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.
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>
(cherry picked from commit 9df43aacab0f311c15837b230761a11750f8b9cb)
Change-Id: Id560fcec356a4b36c0e311440f74a97a670c07d1
Reviewed-on: http://gerrit.openafs.org/11227 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Marc Dionne [Tue, 29 Apr 2014 16:48:03 +0000 (12:48 -0400)]
libafs: Speed up afs_CheckTokenCache
On systems with a large number of PAGs and files in use, the
periodic daemon job that checks for expired credentials and
cleans up the axs cache can run for a very long time. This
can lead to kernel soft lockups and eventually hang processes
and file access because of unavailable locks.
Rework the scanning logic in afs_CheckTokenCache to make the
scanning more efficient in most real world cases. On a test
system accessing ~4000 files from processes in 1000 PAGs, this
has been observed to reduce the runtime of afs_CheckTokenCache
from a problematic ~70s down to about 0.7s.
Additionally, this changes the conditions in which an axscache is
discarded. uid+cell (rather than just uid) must now match, and
if no matching unixuser is found, it will also be discarded.
Adapted from code from Jeffrey Altman who provided the original
loop algorithm and code.
Reviewed-on: http://gerrit.openafs.org/11123 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit de74227d9c925206cd6d46496ec4682569d3105b)
Change-Id: I72e501cf1cb3e312d17a518666d2d638f1d52ead
Reviewed-on: http://gerrit.openafs.org/11307 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: D Brashear <shadow@your-file-system.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Wed, 30 Jul 2014 16:12:39 +0000 (11:12 -0500)]
ptserver: Fix RemoveFromSGEntry hentry memcpy
In this function, hentry is the "previous" continuation entry that we
looked at, and centry is the "current" continuation entry. We keep
track of the previous continuation entry in case we need to update its
'next' pointer, which we do if we free one of the continuation entries
because it is empty after the removal.
So, this memcpy is supposed to copy the current entry to the previous
one, but the arguments are flipped, so we just copy zeroes to centry
(since hentry is initialized to zeroes early on in the function), and
hentry never gets set to anything besides zeroes.
The effect of this is that whenever a ptdb entry has more than one
continuation entry, and we free up any of them after the first one via
RemoveFromSGEntry, the previous continuation entry becomes blanked
(though the 'next' pointer should still be correct). This means the
membership information for that group is not recorded correctly, as it
loses a chunk of the IDs that it is a member of. The reverse mapping
should still be intact (the parent groups have a pointer to the
sub-group), but the group probably doesn't function correctly.
The reason this happened is because of the confusing conversion from
bcopy to memcpy. Most of the instances of bcopy/bcmp/bzero/etc were
converted (correctly) back in commit c5c521af, but the supergroups
implementation was added afterwards, in 8ab7a909, and contained a
bcopy reference. This bcopy was converted to memcpy in 58d5f38b, but
the argument order was not corrected, causing this bug.
To fix this, just flip the first two arguments of the memcpy. Just get
rid of the casts here, too, to match the code in the non-supergroups
RemoveFromEntry and elsewhere.
Reviewed-on: http://gerrit.openafs.org/11340 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 2d89d447c8b00a40d3fc559813fe31c177da164b)
Change-Id: I78b80cb7b043c9d1562b543906a593a985020b43
Reviewed-on: http://gerrit.openafs.org/11352 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Mon, 14 Apr 2014 20:07:53 +0000 (16:07 -0400)]
libafs: api to create and free vrequests
Add a pair of functions to allocate and free struct vrequests, which
are to be used to avoid having struct vrequests on the stack.
Reviewed-on: http://gerrit.openafs.org/11074 Reviewed-by: D Brashear <shadow@your-file-system.com> Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 76ad941902c650a4a716168d3cbe68f62aef109f)
Change-Id: I08932256af58aeba31b2d5c11008658c419cf008
Reviewed-on: http://gerrit.openafs.org/11164 Reviewed-by: Perry Ruiter <pruiter@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Gergely Madarasz <madaraszg@gmail.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Perry Ruiter [Sat, 22 Mar 2014 07:52:32 +0000 (00:52 -0700)]
afs: Define afs_warnall routine
In a Linux environment afs_warn and afs_warnuser both go to
the same spot, resulting in duplicated messages if both are
invoked back to back. Define a new function afs_warnall
for use when identical messages are directed to both warn
and warnuser. In a Linux environment it will do the right
thing and present only one copy of the message.
Reviewed-on: http://gerrit.openafs.org/10943 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit a70f8e1a7e3fcbc13c9a60f8a7409dd01d014afb)
Change-Id: I264633cd4a30cfb7f7264e56512f318cfb23ef3e
Reviewed-on: http://gerrit.openafs.org/11182 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Perry Ruiter [Sat, 22 Mar 2014 06:31:21 +0000 (23:31 -0700)]
afs: restructure afs_warn and afs_warnuser
Restructure afs_warn.c to provide an afs_vwarn and afs_vwarnuser
that accepts a va_list rather than a variadic parameter
specification. afs_warn and afs_warnuser continue to be
variadic functions but now call afs_vwarn and afs_vwarnuser.
This is a preparatory change. A subsequent update will
further exploit afs_vwarn and afs_vwarnuser.
Reviewed-on: http://gerrit.openafs.org/10942 Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit c3d4c109305b2db8a63b754c1894ad37326dc340)
Change-Id: Ica9c3c8a0ae2c5b680b2e11bc85c747cfd11d30a
Reviewed-on: http://gerrit.openafs.org/11181 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Sat, 21 May 2011 16:38:03 +0000 (12:38 -0400)]
volinfo: fix volume aux totals output
Do not print the volumes aux totals prematurely when running
volinfo with the -headers flag on an namei fileserver. Instead
print the aux totals only once after the link table size is found.
AFSFetchStatus is rather large and is in the stack twice. Allocating with
osi_AllocSmallSpace will save about 160 bytes of stack.
Reviewed-on: http://gerrit.openafs.org/10964 Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Tested-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 972585c24b5c193a982570ff9264a1971760f48f)
Change-Id: I5ee4441cd1c09646051e148a67147a2663768d44
Reviewed-on: http://gerrit.openafs.org/11162 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Perry Ruiter <pruiter@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>