Checking if the returned vcache is NULL or not is a bit of an indirect
way to check if an error occurred. Just check the return code itself,
to make sure we notice if any kind of error is reported.
Suggested by Chas Williams.
Reviewed-on: http://gerrit.openafs.org/11321
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 2edf5c0382385f898a017fd8e0e2429f8b2b3520)
Change-Id: I7e123ab1cf88570a6b18e438e01409ed7804e014
Reviewed-on: http://gerrit.openafs.org/11558
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
In 3.17 the logic in d_splice_alias has changed. Of interest to
us is the fact that it will now return an EIO error if it finds
an existing connected directory for the dentry, where it would
previously have added a new alias for it. As a result the end
user can get EIO errors when accessing any file in a volume
if the volume was first accessed through a different path (ex:
RO path vs RW path).
This commit just restores the old behaviour, adding the directory
alias manually in the error case, which is what older versions
of d_splice_alias used to do.
Reviewed-on: http://gerrit.openafs.org/11492
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 5815ee92a41cdcf105741d834042a5617dc4c219)
Change-Id: Ie86009ede93255c85fcf640af14c598fe1e42ca9
Reviewed-on: http://gerrit.openafs.org/11550
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
The typedef has been removed so we need to use the structure
directly.
Note that the API for register_sysctl_table has also changed
with 3.17, but it reverted back to a form that existed
before and the configure tests handle it correctly.
Reviewed-on: http://gerrit.openafs.org/11455
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 6a23ca5b6e8bcaf881be7a4c50bfba72d001e6cd)
Change-Id: Ifb8fc0b9b01d2578c65407608f0e1b3f3b254459
Reviewed-on: http://gerrit.openafs.org/11549
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
The krb5_524_conv_principal() function should fail whenever the Kerberos
v5 principal cannot safely be mapped onto a Kerberos v4 principal, and
does fail on some Kerberos v5 principals used in real-world AFS
deployments.
Prior to this patchset a failure was treated as a fatal error that
in turn prevents an AFS token from being generated or set into the
cache manager.
Prior to b1f9b4cb5dd295162ae51704310e9d6058008f0a the
krb5_524_conv_principal() function wasn't used and a local client
mapping was created. b1f9b4cb5dd295162ae51704310e9d6058008f0a
replaced the local mapping with the krb5 function because the local
mapping could be wrong and confusing.
The krb5_524_conv_principal() function as applied to AFS tokens is
just a local guess. How the username in the token is interpreted by
the AFS server is up to the server.
krb5_524_conv_principal() is only used for Krb5 native tokens. For Krb4
tokens the krb5_524_convert_creds() function is used to obtain both the
Kerberos v4 ticket and the converted names from the KDC. Many
organizations used the krb524d service to perform name translation. When
the krb524d service is used, the name translation is performed by the KDC,
so there is no local call to krb5_524_conv_principal() which might fail.
As a result, disallowing the use of a native Krb5 token due to a failed
local name translation is a needless loss of functionality; the local name
translation is not an essential part of obtaining a token.
This patchset modifies the behavior such that krb5_524_conv_principal()
errors are non-fatal.
1. If -noprdb is not specified the error message is generated
and a NULL username is used.
2. If the username is NULL the prdb lookup is disabled.
3. If the username is NULL the informational messages do not
include a username.
4. If the username is NULL the username info provided to the
cache manager in the token description is the nul string.
This patchset is an openafs-stable-1_6_x specific version of
the patch. The master version was submitted to
http://gerrit.openafs.org/#change,11542
Credit to Ben Kaduk for assistance with the wording of this commit
message.
Change-Id: If12ae69394321fa7b7a182c9db95716bc66e489c
Reviewed-on: http://gerrit.openafs.org/11538
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Add the change number of the late aklog fix. Also state that we
support Linux clients up to 3.16 only, since we already know that
3.17 needs a few tweaks, probably to ship with 1.6.10.1 .
Change-Id: I5904d366611e329dbf06e1b6f2ba3ebf366e7d05
Reviewed-on: http://gerrit.openafs.org/11531
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Commit 2fac53522e7ef5b3a376e191bffdc1f6784e6995 “aklog: Fix improper
use of readlink” inadvertently changed the meaning of int link from a
boolean flag (length > 0) to just a length. This caused ‘aklog -path
(anything)’ to segfault.
Update the type of link and the condition of the while loop to account
for this change.
FIXES 131930
Reviewed-on: http://gerrit.openafs.org/11517
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit fbea3265b3bc042b97be17229839ccf7d11a0bf9)
Change-Id: I6eb0126c574665507be923102c3fa812c3716352
Reviewed-on: http://gerrit.openafs.org/11530
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Update version strings and NEWS for 1.6.10
Change-Id: Idc59095829a7b8a1f882b46d9228d524820fc6fc
Reviewed-on: http://gerrit.openafs.org/11486
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
The current semantics are that gop_lookupname() returns an unlocked
vnode; the previous code was written to a different semantic that
a locked vnode should be returned.
This makes a disk cache more likely to work on FreeBSD, but such
configurations remain not very tested.
Reviewed-on: http://gerrit.openafs.org/11317
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 774d77e056515ae3e87c8f0be8e133c3cdb36bbb)
Change-Id: I4ae9c269412c2ce6b9ec39a841ea87f27630591e
Reviewed-on: http://gerrit.openafs.org/11448
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Fix a couple of printf format errors that bite on FreeBSD 10 for i386.
Since time_t might be an int, it can't be printed with a long format.
Since time_t might be a long in general, cast to it to long when
printing.
Reviewed-on: http://gerrit.openafs.org/11385
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 9dd67783bb2bd9ef8a972a1aac47b1925069a655)
Change-Id: Icda432863a36169857a20300ab936a1a72de7891
Reviewed-on: http://gerrit.openafs.org/11404
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
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>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
On platforms where size_t is unsigned int, the type of
cacheFiles * sizeof(AFSD_INO_T) is not an unsigned long as the format
string requires. Casting cacheFiles to unsigned long ensures that the
result is at least unsigned long, although it will still be wrong if
any architecture makes size_t be long long. Fixes build for FreeBSD
10 on i386.
Reviewed-on: http://gerrit.openafs.org/11384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit f02beb8d644ec2a52bf21737a040321905a39e20)
Change-Id: I1e874f7f049e2fdfdfbe9e6413d421a5e1a5b249
Reviewed-on: http://gerrit.openafs.org/11403
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
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>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
When printing a pointer's value for debugging purposes, use the
dedicated printf format specifier for pointers instead of assuming
that unsigned int ('x') is good enough.
Found by clang on FreeBSD 10.0.
Reviewed-on: http://gerrit.openafs.org/10820
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 758ec15f9391c296f1caa042385148f1a5e0bc84)
Change-Id: Ibe88c38d0563ac125486d0ae7f16882a7989ee98
Reviewed-on: http://gerrit.openafs.org/11402
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
In commits ff0644c4cf5a54747bf3af2cc9605163e1debcb7,
3be9a451b523cd955cd5b3e68ee3a44ab083c14f, and
7c451fab11b65dd5e2860715b939e5de33c7645e, some includes were changed
from e.g. <afs/auth.h> to "auth.h". This means that src/auth must be
in the include path for that file. For a file like src/auth/ktc.c,
that's usually fine, since '.' is added to the include path.
However, several of these files are also compiled from different
directories, such as src/libafsauthent. These need to also have the
relevant include path added, or else we cannot include the relevant
file. So, add the needed include paths.
This commit is 1.6-specific. The build system on the master branch
differs greatly, and these files are not build separately in these
directories.
Change-Id: I502b99b9411aff9660b50f0f4d9a4fb4f6a1106a
Reviewed-on: http://gerrit.openafs.org/11392
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Add volscan and the manual page to the files in the server package.
Reviewed-on: http://gerrit.openafs.org/11370
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 80f4939a3b9e1d48c03d0797a21c9e77a844cf7f)
Change-Id: I48012e78cb0155162677a44191fbc57c64b30a3c
Reviewed-on: http://gerrit.openafs.org/11387
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
These are new files and new content; fix the copyright notice and
license to reflect.
Reviewed-on: http://gerrit.openafs.org/11362
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 1283226ccb638be47ead6cc4d9a47381aa6b08d1)
Change-Id: I4026bba6a10459ca0eb7b63666fe8e278949ca78
Reviewed-on: http://gerrit.openafs.org/11388
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
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>
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>
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>
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>
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>
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>
When invoked with -header option, print the header inode
number, and namei filename, even if the header file cannot
be opened.
Reviewed-on: http://gerrit.openafs.org/7190
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Tom Keiser <tkeiser@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit b71f4ffa7c58ef7b27eb6e28d00892906aec49ec)
Change-Id: Ibd68433ea778d5359c873e3764800d60fa7ae95d
Reviewed-on: http://gerrit.openafs.org/11274
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>
Option to ignore directory vnode magic when looking
up the path names. Print which vnode failed when
doing the checks.
Reviewed-on: http://gerrit.openafs.org/6979
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry-picked from commit 22fbed08a6f23dbbc05fd567e6e8e21e4d1a9709)
Change-Id: Ia9b61b8c0e812fbaa680f62b4b924d818135dc87
Reviewed-on: http://gerrit.openafs.org/11272
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Currently, volscan ignores the -delim command-line option,
using the hardcoded default. This patch adds processing
for this option, allowing alternative characters.
Corrects an error in a08c3207255756c825ab69a19e04f79dd879c646
Reviewed-on: http://gerrit.openafs.org/6894
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit d62456255e13beef41770ad90ee6cb58068007b9)
Change-Id: Ic5e253c2c1ae6fcdba79b70bf43ba16883389ccd
Reviewed-on: http://gerrit.openafs.org/11271
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Patchset a08c3207255756c825ab69a19e04f79dd879c646 broke the suse
and windows builds by relying on C99 language syntax. Fix it.
Reviewed-on: http://gerrit.openafs.org/6337
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 37a0c3d00a6e2d072faf7c2958ef0c7224add161)
Change-Id: I34963c4e941ee3d580494a87b244c67bc3806ac7
Reviewed-on: http://gerrit.openafs.org/11268
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
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.
Reviewed-on: http://gerrit.openafs.org/5102
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit a08c3207255756c825ab69a19e04f79dd879c646)
Change-Id: Icd7c572d09fd5a5e82bd8a1d09c6fbbe229b6b1c
Reviewed-on: http://gerrit.openafs.org/11267
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Implement the -checkout option using the FSSYNC communication
channel with the fileserver.
Reviewed-on: http://gerrit.openafs.org/5101
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 752daf71cd75aa707fabb1b4598dd8ef1f51f973)
Change-Id: Ic6614d0a28b968e261c5916e607ac8fd9d00f4d1
Reviewed-on: http://gerrit.openafs.org/11266
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>
we need a format string; currently here we have none, which is no good
Reviewed-on: http://gerrit.openafs.org/5591
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0676dc9e0c59e8aee3db5e0a7b4acf7229da7b88)
Change-Id: I665eabadee79c358562b831bf15d513e4f945f75
Reviewed-on: http://gerrit.openafs.org/11265
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>
At program startup, register procedures to be called
when scanning vnodes.
Reviewed-on: http://gerrit.openafs.org/5100
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 11f54962f638c8ae48d5193f6b695c252fbb9937)
Change-Id: Iafee77acb6b175c6ba3983889c8c4adad17aaf79
Reviewed-on: http://gerrit.openafs.org/11264
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
After scanning the volume, release the header ihandles
for the volume.
Reviewed-on: http://gerrit.openafs.org/5099
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 4aa72b4308bae8e1d789682e7ead83bcadded862)
Change-Id: I7a24892fc5f6d77b4aaff4a280063bc13cf4d81e
Reviewed-on: http://gerrit.openafs.org/11263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
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>
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).
Reviewed-on: http://gerrit.openafs.org/4741
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 1a4262253e78aa7a4e8c58006abd3301f71bab89)
Change-Id: Ic630a7c0b29bd62525dd2211a7771c647e1be8df
Reviewed-on: http://gerrit.openafs.org/11258
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Accept a partition id for the -part option. For example, -part a
is the same as -part /vicepa.
Reviewed-on: http://gerrit.openafs.org/4739
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8fc3d6dfe196771a38f2bfe7275e90a73f742931)
Change-Id: I9a52dc881e6b77526656ca94e4f175241a79551b
Reviewed-on: http://gerrit.openafs.org/11257
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>
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.
Reviewed-on: http://gerrit.openafs.org/4735
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 277a8ad658572b60e7e460c945adee78cc04038d)
Change-Id: I9d5d9e9b2b65d703f5b35091f072b31072485d83
Reviewed-on: http://gerrit.openafs.org/11253
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
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.
Reviewed-on: http://gerrit.openafs.org/4734
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 56714e9a4d01d1718bbca9f3930c2993e4b7d094)
Change-Id: I96da8a2824af7283fa2d3fb34622d06715c058cb
Reviewed-on: http://gerrit.openafs.org/11252
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
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>
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:
$ sleep 9999 < /afs/localcell/testvol.ro/dir1/file1 &
$ mv /afs/localcell/testvol.rw/dir1 /afs/localcell/testvol.rw/dir1.moved
$ mkdir /afs/localcell/testvol.rw/dir1
$ touch /afs/localcell/testvol.rw/dir1/file2
$ vos release testvol
$ ls -l /afs/localcell/testvol.ro/dir1
total 0
-rw-rw-r--. 1 1235 adeason 0 Jul 23 11:09 file1
$ kill %1
$ ls -l /afs/localcell/testvol.ro/dir1
total 0
-rw-rw-r--. 1 1235 adeason 0 Jul 23 11:10 file2
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>
Fix the missing error location code introduced in commit
40fb2650b783fbafe51aefd3d0af7a6b0536c265
libafs: allocate vattrs in LINUX to reduce stack used
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>
Allocate temporary vattrs in LINUX to reduce the amount
of stack space used.
Reviewed-on: http://gerrit.openafs.org/11170
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 40fb2650b783fbafe51aefd3d0af7a6b0536c265)
Change-Id: I1f19c07a2ad0f8cdddd88e4528584caccaa403e0
Reviewed-on: http://gerrit.openafs.org/11339
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>