9888 Commits

Author SHA1 Message Date
Michael Meffie
7e2734c6d7 volinfo: release volume header ihandles when done
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>
2014-08-13 14:23:26 -04:00
Andrew Deason
b5f3af8650 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>
2014-08-13 14:21:21 -04:00
Michael Meffie
042239d03e volinfo: clean up headers
Remove unneeded includes.

Reviewed-on: http://gerrit.openafs.org/5098
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit be152a00a7e4043592094be30f4a811c67a4ac32)

Change-Id: Ieb59affdc63f47d0adb35c89a2fc9d2ea72ba462
Reviewed-on: http://gerrit.openafs.org/11261
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>
2014-08-13 14:20:39 -04:00
Michael Meffie
1c739bf298 volinfo: fix false good magic line
Fix false report of good magic/version numbers in volume
header file.

Reviewed-on: http://gerrit.openafs.org/4817
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 36f6eed2b458995ab973102acf74375bf0a66931)

Change-Id: Id5972430ae8e2fe374a854c3c33d2837aac48185
Reviewed-on: http://gerrit.openafs.org/11260
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>
2014-08-13 14:19:05 -04:00
Andrew Deason
7914d83509 volinfo: PrintFileNames is namei-only
PrintFileNames only exists on namei, so make sure it's inside a namei
ifdef.

Reviewed-on: http://gerrit.openafs.org/4830
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit fc087f187759398a2646480eca25c1195ed23d22)

Change-Id: Id9cfacd35248389cb513a5470dd75ed5a2a30fb9
Reviewed-on: http://gerrit.openafs.org/11259
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>
2014-08-13 14:18:12 -04:00
Michael Meffie
eed61c2f86 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).

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>
2014-08-13 14:17:29 -04:00
Michael Meffie
dfaa659823 volinfo: accept vice partition id for -part option
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>
2014-08-13 14:16:35 -04:00
Michael Meffie
5a1c61b955 volinfo: comments
Add doxygen style comment headers.

Reviewed-on: http://gerrit.openafs.org/4738
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 6b0ad5786d09446d6ecf723c892c11d6cce4493c)

Change-Id: I69165f41bcfc5aa5fcb94bcaad8d31b7a0349179
Reviewed-on: http://gerrit.openafs.org/11256
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>
2014-08-13 14:15:49 -04:00
Michael Meffie
0db20a591a volinfo: fix file size data type
Use afs_sfsize_t for file size instead of int.

Reviewed-on: http://gerrit.openafs.org/4737
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 8eddff4b785a196b2aae8be2d3a0e75fa3b6c0cf)

Change-Id: I670949abbb9ebfd652bb8baddcef47c7bad1b211
Reviewed-on: http://gerrit.openafs.org/11255
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>
2014-08-13 14:15:19 -04:00
Michael Meffie
a7bc83f677 volinfo: avoid exit on errors
Instead of exiting on errors, try to carry on.

Reviewed-on: http://gerrit.openafs.org/4736
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 59a1c40efbd3326a210776a0253f4f6c656a65ee)

Change-Id: If5f461ac4c1d35ae27336eeab844e6706fcd5bbe
Reviewed-on: http://gerrit.openafs.org/11254
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>
2014-08-13 14:14:40 -04:00
Michael Meffie
d1ef6347e8 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.

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>
2014-08-13 14:14:06 -04:00
Michael Meffie
df53d451cb 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.

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>
2014-08-13 14:13:09 -04:00
Andrew Deason
54c61781e2 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>
2014-08-13 11:30:11 -04:00
Andrew Deason
81f1814b56 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:

  $ 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>
2014-08-13 11:29:44 -04:00
Michael Meffie
a4483520ea libafs: fix error location code in LINUX/osi_export
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>
2014-08-13 11:28:46 -04:00
Michael Meffie
0dc4722d7e libafs: allocate vattrs in LINUX to reduce stack used
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>
2014-08-13 11:28:22 -04:00
Michael Meffie
f1303a1f4f libafs: api to create and free vattrs
Add a pair of functions to allocate and free struct vattrs,
to avoid having struct vattrs on the stack.

Reviewed-on: http://gerrit.openafs.org/11169
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
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 9630c075409a262424805411ed473178814b412c)

Change-Id: I7746ee69f7fde8760c066458ecfe44da46edbf81
Reviewed-on: http://gerrit.openafs.org/11338
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-13 11:27:56 -04:00
Michael Meffie
38a4a13c32 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>
2014-08-13 11:27:33 -04:00
Michael Meffie
7426a78d1a libafs: reduce stack space in LINUX
Allocate temporary vrequests to reduce the amount
of stack space used.

Reviewed-on: http://gerrit.openafs.org/11005
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 1ac4eb1b84db2732b9c2645492daff9e25417475)

Change-Id: I5d982afce489fbcf82cbcb69bd2677fcb0236237
Reviewed-on: http://gerrit.openafs.org/11167
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Gergely Madarasz <madaraszg@gmail.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-13 11:27:03 -04:00
Michael Meffie
c87e0cd81c libafs: fix vrequest leak in afs_lookup
Fix vrequest leak introduced in commit
9930567bcf9655d3f562b210b2dc4b4a99226691.

Thanks to Andrew Deason for finding this error.

Reviewed-on: http://gerrit.openafs.org/11337
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: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 51c97beb3f3bb68704d33e126561b8c2866ddab3)

Change-Id: If903c7863ac2ac6420a74e6bea1012c8cbf41913
Reviewed-on: http://gerrit.openafs.org/11364
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>
2014-08-13 11:25:57 -04:00
Andrew Deason
6041ddf65c afs: Use common cleanup code for lockctl EINVAL
afs_lockctl has common cleanup code in the 'done' label. Use it here,
instead of trying to duplicate it.

Currently this code path appears to not be dropping the discon lock,
which this rectifies.

Reviewed-on: http://gerrit.openafs.org/8196
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit eae608d99a5ae94624200f91af6ed818c9f6612b)

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>
2014-08-13 11:24:49 -04:00
Michael Meffie
9f692e653b libafs: reduce stack space in VNOPS
Allocate temporary vrequests to reduce the amount
of stack space used.

Reviewed-on: http://gerrit.openafs.org/11004
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 9930567bcf9655d3f562b210b2dc4b4a99226691)

Change-Id: I1c60701d4e4f85aedfea6be58a03468ab34edb96
Reviewed-on: http://gerrit.openafs.org/11166
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>
2014-08-13 11:23:17 -04:00
Andrew Deason
8b201a35c6 budb: Fix objdir builds
Reviewed-on: http://gerrit.openafs.org/4030
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 153cb5a3ca34c07a899841ae917b7b882e7ae433)

Change-Id: I46475c58265df9ec2b43241eb244b7d1164ad182
Reviewed-on: http://gerrit.openafs.org/11367
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-13 10:25:02 -04:00
Michael Meffie
7c451fab11 build: separate source and header compile_et rules
Generate source and header files separately to support parallel make
without contortions.

Add a complete list of dependencies for each generated header file
to avoid build errors during parallel make.

Reviewed-on: http://gerrit.openafs.org/10370
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 c01236beb5a6ad55cd424f0ccc3a836d737f78f3)

Change-Id: Ib0e3c3b8e0a268f7db741243ce78fed9f6c342c7
Reviewed-on: http://gerrit.openafs.org/11242
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-13 10:22:43 -04:00
Garrett Wollman
73b6ed21c7 FBSD: 10.1 is coming out soon
The 10.1 release cycle is starting in a month, so let's get ahead of
the curve by adding the config bits now.

Reviewed-on: http://gerrit.openafs.org/11328
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 2809bae58851ce9168ca8b18c94360392b8a609f)

Change-Id: I71779d247725c48ee362e4ff8e9356ce060863d4
Reviewed-on: http://gerrit.openafs.org/11369
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>
2014-08-13 07:52:35 -04:00
Garrett Wollman
3d5eb8c467 FBSD: 9.3 has been released, so add config bits and sysname
Reviewed-on: http://gerrit.openafs.org/11327
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 6667399aa426009a841cdd6459dbfa498e562646)

Change-Id: I5eaa9316806da60699cdb194058613ff7671cb8a
Reviewed-on: http://gerrit.openafs.org/11368
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Tested-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-13 07:51:16 -04:00
D Brashear
9b827a8bfa auth: check for keytab before using in akimpersonate
Heimdal 1.5.2 happily tries to dereference a keytab file even if
none is there. if we have a FILE: type, stat it before use

1.6 only change: master uses KeyFileExt

FIXES 131852

Change-Id: I939eb9e47d2dbbef75c2a64724fdb9111f600150
Reviewed-on: http://gerrit.openafs.org/11075
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-12 13:23:13 -04:00
Chas Williams (CONTRACTOR)
6871d2375d auth: Fix library dependencies so that tests build again
Reviewed-on: http://gerrit.openafs.org/11311
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 668b1765478eb32b5d0895d25301773e412df7a0)

Change-Id: I581a23201832bdfbe7d14eb15d09409936e91eb0
Reviewed-on: http://gerrit.openafs.org/11350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-07 10:43:53 -04:00
Michael Meffie
3be9a451b5 rxkad: fix include quotes for generated headers
Reviewed-on: http://gerrit.openafs.org/10871
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 0408718b8108882d5fb70612e7e7e5d3184fb65f)

Change-Id: I880f6f6b872f913e42b370c51a0b0e92962de803
Reviewed-on: http://gerrit.openafs.org/11241
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-07 07:33:30 -04:00
Michael Meffie
ff0644c4cf auth: fix include quotes for generated headers
Reviewed-on: http://gerrit.openafs.org/10870
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 d3eed1e58a7605b320ec38d48ff1c185aa2d9806)

Change-Id: Iadabd45547b671e346eec262c50f2e6aef917258
Reviewed-on: http://gerrit.openafs.org/11240
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-07 07:18:27 -04:00
Michael Meffie
1c4dd27b89 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>
2014-08-07 07:17:00 -04:00
Michael Meffie
fb3ab52be5 libadmin: separate source and header compile_et rules
Use the new compile_et -emit option to generate source
and header files separately for parallel make support.

Remove unneed -h options, since there are no prolog
files and the header names match the error table names.

Reviewed-on: http://gerrit.openafs.org/10730
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 e97198372a8ddbdba4b5a58c0659f2aa5d2b2d56)

Change-Id: Ic8da7c3dea7953cb7ad33120df06ec1f7399bf2d
Reviewed-on: http://gerrit.openafs.org/11238
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>
2014-08-07 07:13:53 -04:00
Michael Meffie
2a5cb18789 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>
2014-08-07 07:11:32 -04:00
Michael Meffie
1dd845f669 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>
2014-08-07 07:09:52 -04:00
Michael Meffie
dd4abad371 libadmin: add header file deps
Add the missing header file dependencies to the library targets.
This is needed for parallel make.

Reviewed-on: http://gerrit.openafs.org/10726
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit d2084563648cc1e8ec697c61f593935a0b5804a3)

Change-Id: I47b3b184a3284b56c4047e27b58b6cb3a8e16cef
Reviewed-on: http://gerrit.openafs.org/11235
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>
2014-08-07 07:08:35 -04:00
Michael Meffie
82cf665449 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.

This is a 1.6-only change. The corresponding commit on the master
branch, f22ae5f7d8b3c143de21355f819ab872a0cf76fd, is no candidate
for a backport to 1.6.

Change-Id: Iefb432555c60bcfdf51436ebe76a267969280fe0
Reviewed-on: http://gerrit.openafs.org/11353
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: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-07 07:07:27 -04:00
Michael Meffie
e8f5739ec4 libadmin: use INSTALL_DATA to export headers
Use the INSTALL_DATA macro instead of cp to export
header files.

Reviewed-on: http://gerrit.openafs.org/10515
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 66093e4a2db297afea755d164cca7a6080909bda)

Change-Id: Icc1fb62fd68903fcf5a1f756800b0281669f59fa
Reviewed-on: http://gerrit.openafs.org/11234
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>
2014-08-07 07:06:22 -04:00
Michael Meffie
a49323a5a6 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>
2014-08-07 07:04:36 -04:00
Michael Meffie
be7b641464 libadmin: remove duplicate dependency
afs_AdminPtsErrors.h was listed twice in the dependency
afs_utilAdmin.o dependency list.

Reviewed-on: http://gerrit.openafs.org/10725
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 9b105c5586a2e9c5c55dce7785e681f73ea0a759)

Change-Id: Ibf01dd6c67ecb6a89e30bd93eef82afae5eb84c4
Reviewed-on: http://gerrit.openafs.org/11232
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
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>
2014-08-07 07:02:34 -04:00
Michael Meffie
9e51525995 tvolser: fix makefile clean target
Remove generated source files with the clean makefile target.

Reviewed-on: http://gerrit.openafs.org/10724
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit e39e226a13e38bfe0fb12b73633b6415c790c569)

Change-Id: Ie1159d2bfb05e274623b0985660e05ed9ce78ccc
Reviewed-on: http://gerrit.openafs.org/11231
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
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>
2014-08-07 07:00:44 -04:00
Michael Meffie
b1f177a920 config: use the standard INSTALL_DATA makefile macro
Replace the custom INST makefile macro with the standard
INSTALL_DATA macro for installing and exporting files.

Reviewed-on: http://gerrit.openafs.org/10723
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 31d6467aa058a2b49c22188dfb0ca70b766d127f)

Change-Id: I7b7cc1d74c84090c9042b624af1c4e4b5c61ac6d
Reviewed-on: http://gerrit.openafs.org/11230
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>
2014-08-07 06:59:12 -04:00
Michael Meffie
0f33b205b5 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>
2014-08-07 06:57:17 -04:00
Benjamin Kaduk
cf4e99a3a4 Install afscp.h from srcdir, not the build dir
That header is not a generated file, and is not found in the
object directory.  make install would fail from a separate objdir
prior to this change.

Reviewed-on: http://gerrit.openafs.org/11160
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 7a701239d8327ae738124edb5e11f3bcbb08a76b)

Change-Id: I738adc464aa36b68403b69912253faf17cb01621
Reviewed-on: http://gerrit.openafs.org/11342
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>
2014-08-07 06:54:00 -04:00
Michael Meffie
e7e2cff642 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>
2014-08-07 06:52:57 -04:00
Michael Meffie
45190b44db 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>
2014-08-07 06:50:26 -04:00
Marc Dionne
94f1d49af0 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>
2014-08-07 05:24:53 -04:00
Andrew Deason
c1223f1119 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>
2014-08-07 04:19:08 -04:00
Stephan Wiesand
fcbcce6640 cmd: List version in help for commands
List version in help for commands using cmd library

Reviewed-on: http://gerrit.openafs.org/10956
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 4b4d44b3dd62c2a36908f20eeff345b666e7858d)

Change-Id: I1c4881de710f5c48af5645bce64fbee4fb4854f2
Reviewed-on: http://gerrit.openafs.org/11214
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
2014-08-05 08:56:45 -04:00
Michael Meffie
fb32fcf4f7 libafs: reduce stack space
Allocate temporary vrequests to reduce the amount
of stack space used.

Reviewed-on: http://gerrit.openafs.org/11003
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 027e2bbb1191c31dbbe968a925c192b064d52c47)

Change-Id: I2dc6d49c7d3b7578359930f7fd922f177729281f
Reviewed-on: http://gerrit.openafs.org/11165
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
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>
2014-08-05 08:36:49 -04:00
Michael Meffie
17bf59ae6e 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>
2014-08-05 08:31:49 -04:00