openafs.git
6 years agoMake OpenAFS 1.6.5.2 openafs-stable-1_6_5_x openafs-stable-1_6_5_2
Stephan Wiesand [Sun, 15 Dec 2013 22:37:43 +0000]
Make OpenAFS 1.6.5.2

Update configure version strings for 1.6.5.2. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.5.2.
Use 1.6.6 dev 2 for macos.

Change-Id: I4ab3fca89c95ad331db4b0a9823138e87f823c3b
Reviewed-on: http://gerrit.openafs.org/10586
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.5.2
Stephan Wiesand [Sun, 15 Dec 2013 22:54:15 +0000]
Update NEWS for 1.6.5.2

Release notes for 1.6.5.2

Change-Id: I59f5aa9a6887e3d23288672a08e67e0d676e239c
Reviewed-on: http://gerrit.openafs.org/10587
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux: Remove extra "goto out" from tmpfs fix
Marc Dionne [Wed, 29 May 2013 14:33:44 +0000]
Linux: Remove extra "goto out" from tmpfs fix

Remove a stray "goto out" that should not have been applied in
this spot along with the tmpfs fix.

Thanks to Stephan Wiesand for pointing it out.

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

Reviewed-on: http://gerrit.openafs.org/10193
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 86ce4dcac924440c29024906bfda89e8d6f030a7)

Change-Id: Ic81399e7ac9c2034f02e95b9cbc335d79d0f00fa
Reviewed-on: http://gerrit.openafs.org/10613
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux: Fix tmpfs cache support
Marc Dionne [Wed, 22 May 2013 13:26:57 +0000]
Linux: Fix tmpfs cache support

As of kernel 3.1, tmpfs no longer has a readpage() operation in its
address space operations.  Some of the cache manager code relies on
this, causing an oops if tmpfs is used as backing store for the
cache.

As a minimal fix, detect that there is no readpage() and disable
the optimizations that depend on it.

Reviewed-on: http://gerrit.openafs.org/9949
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 3767cf8bf420bd59c3426a4287259b1e97178e96)

Reviewed-on: http://gerrit.openafs.org/9950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 7a40c83337cb4ff07646ea7c2cc0d6d98be94bff)

Change-Id: I063428ba5a177b57eccf883c2019dbc670a6c080
Reviewed-on: http://gerrit.openafs.org/10612
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

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

The current code has afs_putname defined as

    kmem_cache_free (names_cachep, (void *) name);

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

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

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

Reviewed-on: http://gerrit.openafs.org/10547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit d40ed7391670010db0df2202d770341b2ca82f32)

Reviewed-on: http://gerrit.openafs.org/10578
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit d68e6c24f53b6878733e28909e23e44a0fdfae1d)

Change-Id: Ic8055a6ed7aa955266c0f3112817924ef8ba591b
Reviewed-on: http://gerrit.openafs.org/10604
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

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

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

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

Reviewed-on: http://gerrit.openafs.org/10542
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 77826dd3eeb5355834e073553462856df64b9e81)

Change-Id: Ib609dfbaa337f0e5046e9a0d03aebbbfdf26873a
Reviewed-on: http://gerrit.openafs.org/10610
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

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

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

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

Reviewed-on: http://gerrit.openafs.org/10541
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 33edca62271ed4c5e50e1990adfb9cc262d8468e)

Change-Id: I452f743074c3e5635df45e815840273a2e2188bc
Reviewed-on: http://gerrit.openafs.org/10609
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoFix DARWIN build with clang
Ben Kaduk [Tue, 26 Mar 2013 21:42:38 +0000]
Fix DARWIN build with clang

In 1d8937b86050 we added a function call to kauth_cred_unref in the
DARWIN100 case (replacing a macro), but added the inclusion of
sys/kauth.h only when using versions older than DARWIN80.
On DARWIN100 and above, clang detects that the now-implicit function
declaration is in conflict with the actual prototype, which is included
later through afs/sysincludes.h when compiling the kernel rx code.

Since including sys/kauth.h seems to have been harmless for old versions,
just include it always.

Reviewed-on: http://gerrit.openafs.org/9676
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 6ad2cc0275cd1074316d6bc70cd8758d25f94467)

Reviewed-on: http://gerrit.openafs.org/10549
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit e4b2242f3a29832e1df389ceea6ec4ca41c06306)

Change-Id: I5e3b28bbf513d47792dbf7808d6d88db6457ed33
Reviewed-on: http://gerrit.openafs.org/10608
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoDARWIN: Make crfree() an inline function
Simon Wilkinson [Fri, 30 Mar 2012 18:09:36 +0000]
DARWIN: Make crfree() an inline function

On Darwin 100, we have
   #define crfree(X) kauth_cred_unref(&X)
which expands in one place to
   kauth_cred_unref(&(afs_ucred_t *)avc->linkData)

clang warns about this in -Werror mode, because arguments to the
address-of operator must be lvalues.

To fix this make crfree an inline function, which will then let us do
the indirection required.

Reviewed-on: http://gerrit.openafs.org/7073
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 1d8937b860509fcaabb041bc14faf7aa3023f3c9)

Reviewed-on: http://gerrit.openafs.org/10548
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 931d1a8bea393ba3df69b163cb4d05c35f3c948e)

Change-Id: Iba1def8ae4004e918185109767bd8a0f0a263813
Reviewed-on: http://gerrit.openafs.org/10607
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

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

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

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

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

Reviewed-on: http://gerrit.openafs.org/10543
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit e54a0902fb4ed09d955a2cb9c3d091da28b8f21a)

Change-Id: I1dc8a50bb28f5656bc05b261870b6e01684034a5
Reviewed-on: http://gerrit.openafs.org/10606
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

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

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

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

Reviewed-on: http://gerrit.openafs.org/10474
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 3f4c1099b7b2d1467b1f5b701ea2f953fec20dc0)

Reviewed-on: http://gerrit.openafs.org/10519
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 192536d62b085bb14f54ffc958e6303810cca624)

Change-Id: I01b319c43ee74d220cccc6c0defbe1a8cd38b9c4
Reviewed-on: http://gerrit.openafs.org/10605
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.5.1 openafs-stable-1_6_5_1
Stephan Wiesand [Wed, 9 Oct 2013 13:15:09 +0000]
Update NEWS for 1.6.5.1

Update the release notes for 1.6.5.1 with information about the change in
gerrit 10331.

Change-Id: I0bd8d7aa3fa7aeb9a1a44f0aed06f85d6dcdcc06
Reviewed-on: http://gerrit.openafs.org/10332
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agolinux-kernel-module: move keyring-specific
Christof Hanke [Tue, 8 Oct 2013 09:53:17 +0000]
linux-kernel-module: move keyring-specific

function afs_set_session_keyring into
if defined(LINUX_KEYRING_SUPPORT)
block. Otherwise compilation fails.

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

Reviewed-on: http://gerrit.openafs.org/10325
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Christof Hanke <christof.hanke@rzg.mpg.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 994da1669293c7c341b5f73fdb7eaebbe530ec90)

Change-Id: I266cb65d60c814bdb333f8193f95b5b61955b544
Reviewed-on: http://gerrit.openafs.org/10331
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoMake OpenAFS 1.6.5.1
Stephan Wiesand [Wed, 2 Oct 2013 09:14:37 +0000]
Make OpenAFS 1.6.5.1

Update configure version strings for 1.6.5.1. Note that macos kext
can be of form XXXX.YY[.ZZ[(d|a|b|fc)NNN]] where d dev, a alpha,
b beta, f final candidate so we have no way to represent 1.6.5.1.
Switch to 1.6.6 dev 1 for macos.

Change-Id: I44a34f5c8ac3f3518da51e179db05723d3ad754a
Reviewed-on: http://gerrit.openafs.org/10317
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoUpdate NEWS for 1.6.5.1
Stephan Wiesand [Wed, 2 Oct 2013 09:03:22 +0000]
Update NEWS for 1.6.5.1

Release notes for 1.6.5.1 .

Change-Id: I06ae7a885f59b1b38fc21b27b57b3d843c203a73
Reviewed-on: http://gerrit.openafs.org/10316
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agorx: Always call rxi_StartListener
Andrew Deason [Fri, 20 Sep 2013 20:13:43 +0000]
rx: Always call rxi_StartListener

Commit c10f5296 made rx_Init only call rxi_StartListener in the kernel
if we have RXK_LISTENER_ENV. But this doesn't make any sense, since
rxi_StartListener only does anything if RXK_LISTENER_ENV is _not_
defined. As a result, for any non-rxk-listener non-rx-upcall platform,
we never receives rx packets in the kernel, since we never set up our
rx packet callback. The only such platform appears to be AIX, since
while other platforms (HPUX, FBSD, IRIX) have a non-rxk-listener mode,
they also implement an rxk-listener mode that we always turn on.

So, just always call rxi_StartListener, and let the ifdef guards for
the various implementations of rxi_StartListener do the right thing.

FIXES 131725

Reviewed-on: http://gerrit.openafs.org/10263
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 2aa26fcb4e3cf5fa85a3aee3263893a0443a2b75)

Reviewed-on: http://gerrit.openafs.org/10272
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit ccc7a46b419141d7c28e89e2292f4e5d8cdb7683)

Change-Id: I4589ac14e8039c7201d169652ca2f16650522f57
Reviewed-on: http://gerrit.openafs.org/10280
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agolinux: core dump requires write fop
Derrick Brashear [Fri, 13 Sep 2013 15:13:05 +0000]
linux: core dump requires write fop

turns out not just writev is unhappy with aio_write (only); core dumping
wants a write file op. always provide it.

FIXES 131729

Reviewed-on: http://gerrit.openafs.org/10251
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 13165c05836bcd4b3f5655ab2bcc979ff859efa2)

Reviewed-on: http://gerrit.openafs.org/10254
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 8cef9359cd3ff5bd7c36465e09a6d616f70f3cd0)

Change-Id: Id0f0e3f56d29d8739b875f794a3204f551aac7a4
Reviewed-on: http://gerrit.openafs.org/10279
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLINUX: Keyring deal with suse-specific key_type op
Christof Hanke [Thu, 12 Sep 2013 07:25:31 +0000]
LINUX: Keyring deal with suse-specific key_type op

instantiate_prep used for checking for
STRUCT_KEY_TYPE_HAS_PREPARSE

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

Reviewed-on: http://gerrit.openafs.org/10252
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 51af11f297b54d79c3b54c9e6a0316db732d1047)

Change-Id: I0b29b8b57fe1f975663108bd295723d0916c73af
Reviewed-on: http://gerrit.openafs.org/10278
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agolinux: provide read and write ops even when we have aio
Derrick Brashear [Thu, 12 Sep 2013 12:09:34 +0000]
linux: provide read and write ops even when we have aio

read/write will fall back to aio ops but e.g. writev will
fail if there is not either a write or writev op explicitly.

force the fallback via do_sync_read/do_sync_write

required with 2.6.18-348.x rhel kernels but probably not newer ones

Reviewed-on: http://gerrit.openafs.org/10246
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit e6af2ffc86af17c4be427384467c4122fc5301b3)

Reviewed-on: http://gerrit.openafs.org/10248
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jason Edgecombe <jason@rampaginggeek.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit ae8c311e207712e87421967749c79250a89d27ff)

Change-Id: I1062a768c5a4e48a054ce0b86cba893f77d5eaf1
Reviewed-on: http://gerrit.openafs.org/10277
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux 3.11: Adapt to d_count changes
Marc Dionne [Tue, 3 Sep 2013 11:55:14 +0000]
Linux 3.11: Adapt to d_count changes

In preparation for upcoming changes in the 3.12 cycle, d_lockref
was introduced late in the 3.11 cycle.  The dentry's d_lock and
d_count are moved to this new structure.  A new d_lock macro makes
the change transparent for locking, but direct users of d_count
must adapt.  A new d_count() helper function is provided and
should now be used.

Use the new d_count() helper function if available, and move
some of the ifdef logic into a helper compatibility function.

Reviewed-on: http://gerrit.openafs.org/10219
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 1f577e41b65e9bd213a915a296ecf5bedd17fcc1)

Reviewed-on: http://gerrit.openafs.org/10241
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 8e14537c605b3b6867c923dfef782492191939c7)

Change-Id: Ia16740e45824971dc8016971429c7926e1378f6c
Reviewed-on: http://gerrit.openafs.org/10276
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agoLinux 3.11: Convert from readdir to iterate file operation
Marc Dionne [Mon, 8 Jul 2013 14:53:00 +0000]
Linux 3.11: Convert from readdir to iterate file operation

Convert the readdir function so that it can be used as the new
"iterate" file operation.  This new operation is passed a context
that contains a pointer to the filldir function and the offset.
The context is passed into the new dir_emit function that will
call the function specified by the context.

The new dir_emit function returns true on success, so we must be
careful about how we check for failure since this is different
behaviour from what filldir currently does.

Reviewed-on: http://gerrit.openafs.org/10051
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 902b8809f03533ffa7731919930bb5178f77df6c)

Change-Id: I12dc2517af66b66b2de6b2cb01d39e3a0cbc5fe2
Reviewed-on: http://gerrit.openafs.org/10118
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agodirpath: update keytab strings in windows
Derrick Brashear [Thu, 25 Jul 2013 11:51:04 +0000]
dirpath: update keytab strings in windows

this was missed in the pullup from 33eecea7db14d06c59e1081b970d4caf0af773ca

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

6 years agoMerge branch 'rxkad-kdf-1.6' into origin/openafs-stable-1_6_x
Simon Wilkinson [Wed, 24 Jul 2013 15:10:28 +0000]
Merge branch 'rxkad-kdf-1.6' into origin/openafs-stable-1_6_x

Merge the changes necessary for OpenAFS-SA-2013-003 and
OpenAFS-SA-2013-004 back into the stable branch.

6 years agoubik: Fix encryption selection in ugen openafs-stable-1_6_5
Michael Meffie [Wed, 17 Jul 2013 22:10:42 +0000]
ubik: Fix encryption selection in ugen

Make sure that we encrypt when requested to by the application

Change-Id: If4c2ba2257bf060d3e9169ccdbcae54f54dfe5d7

6 years agoMake OpenAFS 1.6.5
Simon Wilkinson [Tue, 16 Jul 2013 18:37:00 +0000]
Make OpenAFS 1.6.5

Change-Id: I693297ef6e20358966930cb29116d45b9151811f

6 years agoAdd support for deriving DES keys to klog.krb5
Ben Kaduk [Sat, 13 Jul 2013 09:49:27 +0000]
Add support for deriving DES keys to klog.krb5

(cherry picked from commit e79102e7918ce5196e870a806879135743ec3abb)

Change-Id: Ia7ebfdd10dcfd6cd164b10275016147630748bac

6 years agoReload rxkad.keytab on CellServDB modification
Andrew Deason [Wed, 10 Jul 2013 17:52:28 +0000]
Reload rxkad.keytab on CellServDB modification

Make the reloading of rxkad.keytab keys occur in the same way that
KeyFile keys are reloaded. That is, we only try to reload them if the
CellServDB mtime has changed. This is intended to have exactly the
same reloading behavior as KeyFile reloads.

I would have triggered this from afsconf_Check, but that approach
has annoyances. (Calling ticket5_keytab functions directly from
cellconfig pulls in libkrb5 dependencies for everything that uses
cellconfig, and we'd have to trigger an afsconf_Check call by calling
some other cellconfig function.)

9102f49a3bdc67ed74e254349eb55b529472f45c

6 years agoAvoid calling afsconf_GetLatestKey directly
Andrew Deason [Mon, 10 Jun 2013 22:49:12 +0000]
Avoid calling afsconf_GetLatestKey directly

Don't call afsconf_GetLatestKey to determine whether we can print our
own local tokens, since we may have keytab 'local' keys, but no DES
keys. Just try to construct them and see if it fails, using
afsconf_PickClientSecObj or afsconf_ClientAuth{,Secure} as
appropriate.

6 years agoauth: Do not always fallback to noauth
Andrew Deason [Mon, 10 Jun 2013 22:15:27 +0000]
auth: Do not always fallback to noauth

Make afsconf_PickClientSecObj error out if we can't construct
localauth tokens (unless the caller explicitly requested rxnull
fallback). afsconf_ClientAuth{,Secure} still falls back, as always.

6 years agoClean up akimpersonate and use for server-to-server
Ben Kaduk [Tue, 14 May 2013 23:37:59 +0000]
Clean up akimpersonate and use for server-to-server

Since a6d7cacfd, aklog has been able to print a krb5 ticket to
itself for an arbitrary client principal, allowing a user with
access to the cell's krb5 key to get tokens as an arbitrary user.

Now that it is possible to use native krb5 tickets with non-DES
enctypes for authentication, and akimpersonate is available from libauth,
use printed native krb5 tickets for server-to-server communication (as well
as the -localauth versions of the client utilities).

Remove the early call to afsconf_GetLatestKey() in
afsconf_PickClientSecObj() so that we do not end up picking an old DES
key before we try to find a better key to use.

Before doing so, refactor the akimpersonate code to be more usable
and readable, and eliminate some dead code.  For example, we always printed
addressless tickets, so that code could be removed.  Other code had excessive
stack usage for a library routine, which is eliminated.  Use a start time
of 0 instead of 300 so that the printed ticket will always be
detected as infinite-lifetime.

In order to ensure usability on all platforms (in particular Solaris),
provide a couple more compat shims to implement routines which are not
always available from the krb5 library, in particular encode_krb5_ticket
and encode_krb5_enc_tkt_part.  Thanks to Andrew Deason for implementing
these compatability routines.

UKERNEL doesn't need this stuff.

6 years agoMove akimpersonate to libauth
Alexander Chernyakhovsky [Tue, 14 May 2013 22:12:08 +0000]
Move akimpersonate to libauth

Give it its own source file and header, install the header at
depinstall time, and have aklog get the akimpersonate functionality
from libauth.

Keep the linux box copyright from aklog_main.c (but strip the trailing
whitespace), as that block was added with the akimpersonate code.

Remove all calls to afs_com_err() as is fitting for library code,
to let it build.  Do not bother removing curly braces which are
no longer needed; a future cleanup commit will catch that.

6 years agoDerive DES/fcrypt session key from other key types
Chaskiel Grundman [Mon, 18 Mar 2013 01:58:47 +0000]
Derive DES/fcrypt session key from other key types

If a kerberos 5 ticket has a session key with a non-DES enctype,
use the NIST SP800-108 KDF in counter mode with HMAC_MD5 as the PRF to
construct a DES key to be used by rxkad.

To satisfy the requirements of the KDF, DES3 keys are first compressed into a
168 bit form by reversing the RFC3961 random-to-key algorithm

Change-Id: I4dc8e83a641f9892b31c109fb9025251de3dcb27

6 years agoIntegrate keytab-based decryption into afsconf_BuildServerSecurityObjects
Chaskiel Grundman [Sun, 10 Feb 2013 18:27:03 +0000]
Integrate keytab-based decryption into afsconf_BuildServerSecurityObjects

Now all servers can have it.

authcon.o grows a krb5 dependency and needs to get KRB5_CPPFLAGS.

Change-Id: I95fecb3f88c19b3d5193ea8200fa20c86ec08ad7

6 years agoNew optional rxkad functionality for decypting krb5 tokens
Chaskiel Grundman [Sat, 9 Feb 2013 17:42:20 +0000]
New optional rxkad functionality for decypting krb5 tokens

An additional, optional mechanism for decrypting krb5-format tokens
is provided that uses the krb5 api with a key from a keytab
instead of using libdes and the AFS KeyFile.

The AIX compat stub for krb5_c_decrypt is contributed by Andrew Deason.

Change-Id: I97c08122c60482b84d602d6fa6482f1d5deef142

6 years agoAdd rxkad server hook function to decrypt more types of tokens
Chaskiel Grundman [Sat, 9 Feb 2013 17:01:37 +0000]
Add rxkad server hook function to decrypt more types of tokens

Allow tokens to be encrypted with algorithms other than DES.
The security object owner must provide an implementation
by calling rxkad_SetAltDecryptProc.

Make sure plainsiz is initialized before calling the alternate decrypt
proc.

6 years agoviced: Rename fs_rxstat_userok
Andrew Deason [Fri, 15 Jun 2012 21:55:16 +0000]
viced: Rename fs_rxstat_userok

The fs_rxstat_userok function can be used for other purposes; give it
a more general name.

Reviewed-on: http://gerrit.openafs.org/7571
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 7a875f639f61966f2d327f929305091d2678e99a)

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

6 years agomake openafs 1.6.4 openafs-stable-1_6_4
Stephan Wiesand [Tue, 18 Jun 2013 13:50:03 +0000]
make openafs 1.6.4

The wrong commit was tagged for the 1.6.3 release by accident.
Update the version strings to 1.6.4, and adapt the release notes.

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

6 years agomake openafs 1.6.3
Stephan Wiesand [Sun, 16 Jun 2013 19:15:53 +0000]
make openafs 1.6.3

update version strings for 1.6.3, finalize release notes

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

6 years agoUpdate release notes for 1.6.3 openafs-stable-1_6_3
Stephan Wiesand [Thu, 30 May 2013 14:52:26 +0000]
Update release notes for 1.6.3

As of pre3, we'll support Linux 3.10 clients (at least up to rc3).

Change-Id: I81b783ad563e4a7735638bde2aa77d11ea1ec83c
Reviewed-on: http://gerrit.openafs.org/9959
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

6 years agomake 1.6.3pre3 openafs-stable-1_6_3pre3
Stephan Wiesand [Thu, 30 May 2013 13:54:59 +0000]
make 1.6.3pre3

prerelease for OpenAFS 1.6.3

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

6 years agoLinux 3.10: Replace create_proc_entry() with proc_create()
Marc Dionne [Tue, 7 May 2013 00:20:07 +0000]
Linux 3.10: Replace create_proc_entry() with proc_create()

Add an afs_proc_create() compat function that uses the
appropriate kernel function based on a configure test.

Reviewed-on: http://gerrit.openafs.org/9854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 9b24013426e03a501fcaa6334ba5a9b48a8da3d1)

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

6 years agoLinux 3.10: Include linux/aio.h directly
Marc Dionne [Wed, 15 May 2013 19:19:22 +0000]
Linux 3.10: Include linux/aio.h directly

This file needs bits from linux/aio.h, but gets them indirectly
from the inclusion of aio.h by sched.h.  That gets removed for
Linux 3.10.

Since this header is not of general interest elsewhere, just include
it directly here.

Reviewed-on: http://gerrit.openafs.org/9912
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit fca4252621b80c5126e1ae3d84a54da5ebc677ba)

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

7 years agomake 1.6.3pre2 openafs-stable-1_6_3pre2
Stephan Wiesand [Wed, 15 May 2013 17:36:14 +0000]
make 1.6.3pre2

prerelease for OpenAFS 1.6.3

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

7 years agoUpdate release notes for 1.6.3
Stephan Wiesand [Wed, 15 May 2013 17:46:56 +0000]
Update release notes for 1.6.3

We merged another change, helping Linux 3.6+ clients. Mention it.

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

7 years agoOpenBSD 5.3: Replace use of copyinstr for setting mount point name.
Antoine Verheijen [Tue, 9 Apr 2013 02:29:58 +0000]
OpenBSD 5.3: Replace use of copyinstr for setting mount point name.

As a result of a realignment of kernel memory in OpenBSD 5.3,
the copyinstr() routine no longer works for copying the mount
point name into the internal mount table structure. It also
fails silently, so it's not noticed until someone looks at
the mount table and discovers that the mount point name for
AFS is missing.

This patch replaces the use of copyinstr() with strlcpy() for
copying the mount point name in OpenBSD 5.3.

Note that this is consistent with how other similar device
support has addressed the same issue in OpenBSD 5.3.

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

Change-Id: I5e9a3d0871360e0e3b19cdb2b4a609baeed050f8
Reviewed-on: http://gerrit.openafs.org/9908
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>

7 years agoLinux: osi_TryEvictVCache: Don’t skip the first dentry if D_ALIAS_IS_HLIST
Anders Kaseorg [Tue, 7 May 2013 04:27:33 +0000]
Linux: osi_TryEvictVCache: Don’t skip the first dentry if D_ALIAS_IS_HLIST

An hlist doesn’t begin with a sentinel like a list does, so the old
code would skip the first dentry or crash with a NULL dereference if
there wasn’t one.  Use the kernel’s list_for_each_entry or
hlist_for_each_entry macros instead of trying to do it manually.

Should fix a crash observed by Alex Chernyakhovsky on kernel 3.6 and
newer.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/9857
Reviewed-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: Alex Chernyakhovsky <achernya@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit ad6e31d5fea221bf5eefcd35a416667bc7c1f9be)

Change-Id: Id8b31246067b5a718af91c8c206d5abd5210c558
Reviewed-on: http://gerrit.openafs.org/9898
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agomake openafs 1.6.3pre1
Stephan Wiesand [Tue, 7 May 2013 16:45:53 +0000]
make openafs 1.6.3pre1

prerelease for 1.6.3

Change-Id: I8eb600cdc0ed55d15e928a9f165f68d3ff924f82
Reviewed-on: http://gerrit.openafs.org/9858
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoPreliminary release notes for 1.6.3
Stephan Wiesand [Tue, 7 May 2013 18:46:47 +0000]
Preliminary release notes for 1.6.3

Change-Id: Ie4a6a984cfd9b819b0a3170acce7817998307157
Reviewed-on: http://gerrit.openafs.org/9859
Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoppc64_linux26: build binaries as 64-bit by default
chas williams - CONTRACTOR [Mon, 5 Sep 2011 13:26:32 +0000]
ppc64_linux26: build binaries as 64-bit by default

lwp doesnt work since ucontext/setjmp are incomplete when running 32-bit
binaries with the 64-bit kernel.

Reviewed-on: http://gerrit.openafs.org/5365
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 39b788eeafe27d21ae6b4fd3cfeb59ce5dc70077)

Change-Id: Ic4fd5c1a861db8e96dd58a79d7fb2ea73ab4f0d6
Reviewed-on: http://gerrit.openafs.org/9605
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafsio: Pass KRB5_LDFLAGS along with KRB5_LIBS
Andrew Deason [Thu, 28 Mar 2013 18:03:40 +0000]
afsio: Pass KRB5_LDFLAGS along with KRB5_LIBS

We need this in case e.g. the krb5 library we're using is in an
alternate location, so we can pass -L. aklog already does this, so do
it for afsio, too.

This is a 1.6-only change. On master, this problem went away when the
krb5 ldflags/cflags/etc were standardized in commit
6f9443e702745d1e371eb72ad7fcba5cac47f3db.

Thanks to Måns Nilsson for reporting this.

Change-Id: I79aeb1f4de123b7550b64c1890a2773a44ff8d1e
Reviewed-on: http://gerrit.openafs.org/9692
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agodoc: quote list items in POD
Ken Dreyer [Wed, 1 May 2013 03:59:32 +0000]
doc: quote list items in POD

Recent versions of Pod::Simple complain if we use integers or other
special characters in an =item list. We have a couple bulleted lists
that happen to have integers or other special characters as the list
values. Quote the items with C<> so that Pod::Simple can correctly parse
them again.

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

Change-Id: Ie3e5c792d64f1d2e973e3a5f68b8466986cde0d7
Reviewed-on: http://gerrit.openafs.org/9842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jason Edgecombe <jason@rampaginggeek.com>
Tested-by: Jason Edgecombe <jason@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: Do not invalidate all dcaches on startup
Andrew Deason [Tue, 30 Apr 2013 19:37:54 +0000]
afs: Do not invalidate all dcaches on startup

Commit 20b0c65a289e2b55fb6922c8f60e873f1f4c6f97 changed
afs_UFSGetDSlot to always treat a dslot entry as invalid if
'datavalid' was 0. This was to force the invalidation of the given
dslot if we were reading in a dslot from the free or discard list,
since the data in that dslot is not valid.

However, 'datavalid' is also 0 when we read in dcache entries from
disk on startup. So, this means that we invalidated all cache entries
when the client started up, effectively making our persistent cache
worthless.

Fix this by only forcing this invalidation when we are reading from a
free or discarded dcache, and not during the initial cache scan. That
is, when 'indexvalid' is 1, and 'datavalid' is 0.

The parameters for these Get*DSlot variants should maybe be changed to
be a little more clear, but for now, this is a targeted fix for this
specific issue.

FIXES 131655

Reviewed-on: http://gerrit.openafs.org/9833
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 479c34614f33859131258e330e7a3f8494e0bc80)

Change-Id: I72b7ad41658c51b81aa9844327372724a0f3151e
Reviewed-on: http://gerrit.openafs.org/9837
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoMake ihandle sync behavior runtime-configurable
Andrew Deason [Fri, 29 Mar 2013 18:40:41 +0000]
Make ihandle sync behavior runtime-configurable

The actual behavior of FDH_SYNC has changed a bit over the years, and
some people want one behavior, and some want another. Make it possible
to make this choice at runtime with the new -sync option, instead of
making this decision by running with different patches.

Note that FDH_SYNC is not a macro anymore, nor is it an inline
function. While it could be a macro, it would look a bit complex, and
there are some oddities with trying to use vol_io_params inside the
FDH_SYNC expansion (vol_io_params is not declared for LWP, for
example). And having it be an inline function causes problems with
some odd linking dependencies. For example, vlib.a contains volume.o,
but does not contain a definition for DFlushVolume (dir/buffer.c),
which is referenced in volume.o.  'vos' uses vlib.a, but does not
bring in anything that defines DFlushVolume. Currently this appears to
not cause a problem because 'vos' uses nothing from volume.o, so the
dependencies of volume.o don't matter. Adding an inline FDH_SYNC for
platforms that don't support 'static inline' would add a dependency to
volume.o (via vol_io_params), which causes an error for the lack of a
DFlushVolume.

Those are possibly just some problems, and may not be all. So instead,
make it so we don't have to deal with that and just have a normal
function. While FDH_SYNC may be called in a performance-critical
section, the overhead of a real function call is nowhere near the
delay of an actual fsync(), so presumably any overhead doesn't matter.

Reviewed-on: http://gerrit.openafs.org/9694
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit eb5190eb4a7cd95166866a89e0a8f3a69bbc6e8f)

Change-Id: I7a6c99d00eff3400423440db91a350053ed099ea
Reviewed-on: http://gerrit.openafs.org/9695
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLINUX: Sometimes let dentry_open handle refcounts
Andrew Deason [Wed, 17 Apr 2013 23:04:58 +0000]
LINUX: Sometimes let dentry_open handle refcounts

When Linux changed dentry_open to use a 'path' argument, they also
changed it so dentry_open handles incrementing the relevant ref
counts. So now, sometimes we need to inc the dentry and vfsmount
refcounts ourselves, and sometimes we need to leave them alone.

To accommodate this, change afs_dentry_open to also handle refcounting
itself, and 'get' the given dentry and vfsmount if necessary.

Also note that currently, afs_linux_raw_open can call afs_dentry_open
twice in the case of an error, but it does not dget(dp). This means
that dp could be undercounted, since dentry_open on older kernels will
dec the refcount on the given dentry in the case of an error. This
change should also fix this so dp is not undercounted in that case.

FIXES 131613

Reviewed-on: http://gerrit.openafs.org/9801
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit e31240732cbe449fedea5095037ac08d1d513fa9)

Change-Id: I082063d324d99c3d02ed372a1c20462f13bb4a26
Reviewed-on: http://gerrit.openafs.org/9803
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLINUX: Avoid duplicate mntget in afs_dentry_open
Andrew Deason [Wed, 17 Apr 2013 06:27:47 +0000]
LINUX: Avoid duplicate mntget in afs_dentry_open

Our caller already got a ref to 'mnt'; getting another one here will
overcount refs on 'mnt'.

This can make it impossible to unmount the filesystem the cache
resides on (even after the client is stopped), since it's ref count
will be very high.

FIXES 131613

Reviewed-on: http://gerrit.openafs.org/9790
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit e019429d4548348c6ab8674305d985feee040476)

Change-Id: If88e108bb3e67602cf9e6bbe7646f9862228b684
Reviewed-on: http://gerrit.openafs.org/9792
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoOpenBSD: Add config headers for new(er) OS versions.
Antoine Verheijen [Wed, 23 Jan 2013 02:24:25 +0000]
OpenBSD: Add config headers for new(er) OS versions.

The OS-specific config header files have not kept up with the
newer releases of OpenBSD. This patch corrects that by adding
header files for OpenBSD versions from 4.9 to 5.3 (the newest
version currently under development).

Reviewed-on: http://gerrit.openafs.org/8927
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 20a54b02521b40b07e4ec87df55a1e9a2549c881)

Change-Id: I9ee66dbba300d5a68bc294a14dd9463441143371
Reviewed-on: http://gerrit.openafs.org/9661
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoubik: Do not count votes from error'd connections
Andrew Deason [Tue, 20 Nov 2012 21:00:15 +0000]
ubik: Do not count votes from error'd connections

If the given connection has a connection-wide error on it, the vote we
got from that site is probably not valid, and we could easily be
interpreting an error code as a vote time. So instead, treat the host
as if we got a network error from it.

Reviewed-on: http://gerrit.openafs.org/8487
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 23092acce5d2d71a5ad6402119973c7c2c2f5e89)

Change-Id: Id320b33bb6662d7867ae1f4a8d0a29808f16b59d
Reviewed-on: http://gerrit.openafs.org/8947
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoubik: Try to detect VOTE_Beacon errors
Andrew Deason [Tue, 20 Nov 2012 20:18:47 +0000]
ubik: Try to detect VOTE_Beacon errors

Currently the way ubik dbsites vote for each other is via the "return
value" of the Beacon VOTE RPC. Since this is really an Rx abort, this
can easily collide with actual errors on the wire, such as rxkad
errors.

Try to detect these by detecting vote times that are very different
than the current timestamp (more than an hour in the future or past),
and treat it like a network error.

If we do not do this, a single site reporting an error can cause us to
never reach quorum, since we calculate our sync site expiration based
on the oldest 'yes' vote, which for most known Rx aborts will be far
in the past.

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

Change-Id: Iaca12506a35e924631754b638f99cb12faa84479
Reviewed-on: http://gerrit.openafs.org/8946
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agovol: remove duplicate stmp declaration
Jeffrey Altman [Fri, 15 Mar 2013 03:27:25 +0000]
vol: remove duplicate stmp declaration

Patchset 38cf31463e3f3c675de727c1e793e117a90e6d20 added a definition of
afs_ino_str_t stmp which should have replaced the b64_string_t stmp
declaration that was already present.

Thanks to Jason Madar for noticing.

FIXES 131620

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

Change-Id: Ia0a43f64183b47b6df30495673907d176d95799a
Reviewed-on: http://gerrit.openafs.org/9771
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agovos: Restore some VNOVOL error messages
Andrew Deason [Wed, 3 Apr 2013 21:39:07 +0000]
vos: Restore some VNOVOL error messages

Many places in vos/vsprocs have code to delete a volume. Commit
f4e73067cdef990262c69c38ac98761620a63f25 tried to refactor them by
consolidating the common "delete" code into DoVolDelete. However, not
all of the removed code had exactly the same behavior, and some of
these variants were not handled by DoVolDelete.

One such variation is that DoVolDelete always printed an error message
if the target volume did not exist. But for some call sites this
condition is not an error, and prior to the refactoring they did not
print such an error message. Commit
1092cbe34fc8519826b3fa0565505b7bd81bc922 tried to correct this by
suppressing the error message if the target volume does not exist.
However, this means that all DoVolDelete calls do not print such an
error, where some should and some should not print an error. This
means that in some edge cases when we encounter an unexpected VNOVOL
error, we now skip printing the specific error we got and instead go
right to cleanup/recovery/exit. For a few other cases, we used to
print an error and continue (because it is a non-fatal error or a
warning), but now we print nothing when we encounter a VNOVOL error.

Fix this by specifically printing an error for the VNOVOL error for
DoVolDelete call sites that used to print such an error. Do this for
all such sites except ones where we obviously print an error
immediately afterwards anyway.

This is just a quick targeted fix. A future more robust fix should
involve altering DoVolDelete to handle all of the different behaviors
expected by its various callers.

Reviewed-on: http://gerrit.openafs.org/9704
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 0a063815cc27ed065bcc9e4a91fb3a7b280818bb)

Change-Id: Ia333b2257b9fdc39f7bcc9ba8ed3c98254d2e76a
Reviewed-on: http://gerrit.openafs.org/9770
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agovos: noise messages when attempting to delete non-existent volume
Mark Vitale [Thu, 7 Mar 2013 14:34:55 +0000]
vos: noise messages when attempting to delete non-existent volume

With vos refactor commit f4e73067cdef990262c69c38ac98761620a63f25,
some formerly conditional volume deletes are now unconditional.
This regresses 'vos move' output with harmless "error" messages
when AFSVolTransCreate() returns VNOVOL:
  "Failed to start transaction on <volume>"
  "Volume not attached, does not exist, or not online"

Modify DoVolDelete() to return early (and silently) with VNOVOL
in this case, allowing the caller to handle this appropriately.

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

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

7 years agoRework set_header_word macros
Marc Dionne [Sat, 22 Dec 2012 12:54:54 +0000]
Rework set_header_word macros

Rework the set_header_word macros so that all compilers are
happy:
- the use of offsetof() is avoided, as it has an issue on IRIX
when the result is not constant
- the assignment within the macro is explicitely sequenced before
the function call to avoid a gcc sequence-point warning

Reviewed-on: http://gerrit.openafs.org/8816
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 7f96084969d3082842a9575ee8ff7da8c52a0796)

Change-Id: Iefdf7f6dbb60ffc569b67b3c89893fb43527eb02
Reviewed-on: http://gerrit.openafs.org/8818
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agomacos: get more packets if requested
Derrick Brashear [Tue, 17 Jul 2012 19:34:07 +0000]
macos: get more packets if requested

analogous to eead07418f13cd87a90770f03ea5118c546d8f1a for ukernel,
this is for macos' upcall procedure

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

Change-Id: I1b59c802717393758370c376f95569467dc61049
Reviewed-on: http://gerrit.openafs.org/9747
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoviced: Sanity check file link count during CoW
Andrew Deason [Wed, 19 Dec 2012 00:49:49 +0000]
viced: Sanity check file link count during CoW

A few ihandle bugs in the past have caused the CopyOnWrite code to
open cached file handles for files which have been deleted. When we
CoW, both of the files we're dealing with had better actually be on
disk, so bail out and flag an error if either of them appear unlinked.

FIXES 131530

Reviewed-on: http://gerrit.openafs.org/8839
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 752514bd1c8eaae487d25116dc59853552f77d12)

Change-Id: I2aa70145b12e9babd1a1eb881bf7f48151c20f6c
Reviewed-on: http://gerrit.openafs.org/9508
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoihandle: Add FDH_ISUNLINKED
Andrew Deason [Fri, 21 Dec 2012 18:30:24 +0000]
ihandle: Add FDH_ISUNLINKED

Add the FDH_ISUNLINKED functionality to ihandle. This lets the caller
know if the file for the underlying file descriptor has been deleted
out from under us. This is useful for sanity checks in some callers.

Reviewed-on: http://gerrit.openafs.org/8838
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 9cf9a0e978ece2b0afb8ba5947455f307a424cab)

Change-Id: If5cde825a2e7413c47409c69f15507d6df1934c3
Reviewed-on: http://gerrit.openafs.org/9507
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agovolser: Check vnode length on dump
Andrew Deason [Fri, 14 Dec 2012 21:05:53 +0000]
volser: Check vnode length on dump

Commit aadf69eabb1962496fa93745ab560a5b48cacd61 adds length checks on
vnodes during fileserver read/write operations. Do the same thing when
we dump volume data from the volserver, to ensure that we don't
transmit incorrect data e.g. to other RO sites when releasing.

FIXES 131530

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

Change-Id: Ia49e7310f2e143d4eed965a5090e687be55864e4
Reviewed-on: http://gerrit.openafs.org/9505
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoafs: Add a little more info on SLVC loop panic
Andrew Deason [Fri, 28 Dec 2012 21:49:20 +0000]
afs: Add a little more info on SLVC loop panic

If we panic due to a perceived infinite loop, log a little more info
about our loop iterations.

Reviewed-on: http://gerrit.openafs.org/8850
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 2f087dc434f62cfa7888434427eaac6803b563ab)

Change-Id: Ie4a02a40fafa88f8b54b05b8a0926f258ae7cf7a
Reviewed-on: http://gerrit.openafs.org/9509
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: Apply VLRU safety check for Linux too
Andrew Deason [Wed, 28 Nov 2012 21:12:12 +0000]
afs: Apply VLRU safety check for Linux too

This invariant should apply to all platforms, not just those with
dynamic vcaches. Since this prevents an infinite loop if the list os
corrupt or something, having this around everywhere seems useful. So,
drop the check for afsd_dynamic_vcaches.

Reviewed-on: http://gerrit.openafs.org/8555
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 696db8667d12b1c5639515840f69c9a46d2b866d)

Change-Id: I81e4c7c7678a9f4a3e02952e243735d59b3af35c
Reviewed-on: http://gerrit.openafs.org/9502
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoviced: fix log message for MapName_r
Michael Meffie [Sat, 3 Mar 2012 15:05:01 +0000]
viced: fix log message for MapName_r

Do not log a code of zero if the name plus instance length exceeds
the max pr name buffer.

Reviewed-on: http://gerrit.openafs.org/6861
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit ef6ae1e7eda56e1d6ff7b9ade25b290c855e5780)

Change-Id: If644670ed522eaba575e7246084f106231649991
Reviewed-on: http://gerrit.openafs.org/9474
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoviced: Ignore client loopback alternate addresses
Andrew Deason [Thu, 8 Jul 2010 16:25:19 +0000]
viced: Ignore client loopback alternate addresses

When we receive interface information from a client to determine its
alternate IP addresses, ignore any addresses that look like loopback.

Reviewed-on: http://gerrit.openafs.org/2368
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 2a6ddae62e4fac5eecdf4634746e7294405393d6)

Change-Id: Idcdaabd3aad62f0e84efbaf1d8523338bc683924
Reviewed-on: http://gerrit.openafs.org/9466
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agosalvager: Remove PrintVolumeSummary
Andrew Deason [Wed, 22 Feb 2012 00:03:24 +0000]
salvager: Remove PrintVolumeSummary

Nothing uses this function; remove it.

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

Change-Id: Ibca098550a073013228c4907fbbeab7f3c0333ae
Reviewed-on: http://gerrit.openafs.org/9460
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoudebug: Fix endianness when fudging lastYesHost
Andrew Deason [Tue, 29 Nov 2011 18:07:49 +0000]
udebug: Fix endianness when fudging lastYesHost

hostAddr is in NBO, lastYesHost is in HBO.

Reviewed-on: http://gerrit.openafs.org/6136
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 073edd3fbdf442249920acea8f3ee90b6346bf23)

Change-Id: Iea4f7799c8f5500010448d6104cc9f701663d826
Reviewed-on: http://gerrit.openafs.org/9437
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoConfigure: Tidy up AC_CHECK_FUNCS
Simon Wilkinson [Fri, 20 Aug 2010 12:17:53 +0000]
Configure: Tidy up AC_CHECK_FUNCS

Move all of our AC_CHECK_FUNCS calls into a single, ordered, list
so that it's easier to see what's being checked for and what's not.

Reviewed-on: http://gerrit.openafs.org/2598
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 3fc5863f062c14c346bcc50c82b8d15971750e55)

Change-Id: I167b42d84c9ddbb8b35aee6b4ced3c7a809e72dc
Reviewed-on: http://gerrit.openafs.org/9423
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoautoconf: Tidy up header includes
Simon Wilkinson [Mon, 3 Jan 2011 10:40:56 +0000]
autoconf: Tidy up header includes

Tidy up our list of header includes so it's easier to see what
we're testing for. The list is now one-per-line, in alphabetically
sorted order.

Note that this won't affect our use of the default include set, as
autoconf will already have tested for all of those before it starts
this CHECK_HEADERS run.

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

Change-Id: I0b507dcd9578d1c041731f7f7923f27e33fc89df
Reviewed-on: http://gerrit.openafs.org/9411
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agofix garbage counters in supergroup prdb_check
Simon Wilkinson [Wed, 3 Apr 2013 11:09:03 +0000]
fix garbage counters in supergroup prdb_check

This is a backport of one hunk of commit
9efc255ab8de7ad90c7d599fea7bd1956bfd48c2, where a calloc fixes an
incorrectly sized memset. The original memset clears the size of the
pointer, not the sizeof the structure.

Change-Id: I40250e0346345fe9b4b43d14e76ea5fb23c8c04b
Reviewed-on: http://gerrit.openafs.org/9701
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoaklog: Only try to use krb5-weak.conf if it exists
Andrew Deason [Tue, 26 Mar 2013 18:27:33 +0000]
aklog: Only try to use krb5-weak.conf if it exists

The logic we use for using krb5-weak.conf to allow 'weak crypto'
requires us to know where the default krb5.conf is. The default
krb5.conf local can vary significantly depending on the platform, and
we don't have a good way of figuring out what it is, so we guess. We
may guess wrong.

To limit the cases where we guess wrong, only try to do this
workaround if the krb5-weak.conf file actually exists.

Reviewed-on: http://gerrit.openafs.org/9667
Reviewed-by: Derrick 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 95240a5a5030a1053ce9966b54037eda2d37140b)

Change-Id: I02313b2cc37da05adc0529e685abf6a8546bb3de
Reviewed-on: http://gerrit.openafs.org/9687
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoaklog: Search for /etc/krb5/krb5.conf
Andrew Deason [Tue, 26 Mar 2013 18:14:30 +0000]
aklog: Search for /etc/krb5/krb5.conf

aklog tweaks the KRB5_CONFIG environment var when performing one of
our 'weak crypto' workarounds. We assume that the default krb5.conf is
/etc/krb5.conf, but for Solaris 11 libkrb5, krb5.conf is in
/etc/krb5/krb5.conf. Although this file could be anywhere, try
/etc/krb5/krb5.conf too, so we at least work on stock Solaris.

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

Change-Id: I8eeb406107592bac6da415d25b688d936a385a87
Reviewed-on: http://gerrit.openafs.org/9686
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>

7 years agoafsd: Parse cacheinfo during argument parsing
Andrew Deason [Thu, 22 Dec 2011 03:00:12 +0000]
afsd: Parse cacheinfo during argument parsing

Currently we parse cacheinfo in afsd_run, when the client is
initialized and started. Parsing cacheinfo can change
afsd_cacheMountDir, however, which may be of interest to afsd.o users;
in particular, libuafs exposes this via uafs_MountDir(). This means
that if a mount dir is not explicitly specified in the libcmd
arguments to afsd, a libuafs-using program will see the mountpoint as
the empty string if it is queried after afsd_parse but before
afsd_run. For afsd.fuse, this causes the cryptic error message:

    fuse: bad mount point `': No such file or directory

since the mountpoint is the empty string if it is not specified
explicitly on the command line.

To fix this, move cacheinfo parsing to effectively near the end of
afsd_parse, so the mountpoint is calculated in afsd_parse().

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

Change-Id: Ibd087f52c9a6f1d98614f4fdbbc5b92ea0806506
Reviewed-on: http://gerrit.openafs.org/9453
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLWP: don't copy pid to a null pointer
Derrick Brashear [Mon, 20 Dec 2010 21:36:42 +0000]
LWP: don't copy pid to a null pointer

In LWP_CreateProcess we take a pid. if it's null, don't crash.

Reviewed-on: http://gerrit.openafs.org/3556
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5d218831f3186d0d1dc7d3b00dd4a3b6a4a8757c)

Change-Id: I96c0e2a8858fa929f0de22a774050aa63a200101
Reviewed-on: http://gerrit.openafs.org/9414
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux: crset should use passed credentials
Marc Dionne [Fri, 25 Jan 2013 02:38:28 +0000]
Linux: crset should use passed credentials

When copying credentials in crset, take the passed credentials as
the source instead of the current process credentials.

This doesn't cause any problems currently since crset always gets
called with the current credentials.

Reviewed-on: http://gerrit.openafs.org/8980
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 3b733db8bf2bc3a1366554ae97814cc722437149)

Change-Id: I4d0000a139d16fafe480f7ebccc6759da7dea6bb
Reviewed-on: http://gerrit.openafs.org/9333
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
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>

7 years agoubik: Avoid unlinking garbage
Simon Wilkinson [Wed, 27 Feb 2013 10:34:59 +0000]
ubik: Avoid unlinking garbage

If SDISK_SendFail fails before the pathname to the temporary file
has been constructed, then the failure handler will unlink stack
garbage, with variable results.

Initialise the string, and check to see if it has contents before
calling unlink

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

Change-Id: I366de3ce15a5e1ea855eb45110ff7acf1748c377
Reviewed-on: http://gerrit.openafs.org/9538
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoubik: cleanup DB lock usage in SDISK_SendFile
Marc Dionne [Sat, 29 Jan 2011 17:48:02 +0000]
ubik: cleanup DB lock usage in SDISK_SendFile

Some failure paths can return from SDISK_SendFile with the
database lock still held.  Other failure paths will cause
setlabel to be called without holding the lock.

Rework the failure paths so we always release the DB lock before
returning, and always hold it when calling setlabel.

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

Change-Id: I99cb359f108f604be75f19250fb697eb95b81947
Reviewed-on: http://gerrit.openafs.org/9418
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agobutc: clean xbsa shutdown on control C
Rainer Toebbicke [Wed, 19 Sep 2012 16:13:15 +0000]
butc: clean xbsa shutdown on control C

when we catch a control-c, do a clean shutdown

Reviewed-on: http://gerrit.openafs.org/8141
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit aea3c71e59ec30e84ca4e7383fd3b566ce94bbb6)

Change-Id: I89665c29a522909e126214abaec008a18acb59d7
Reviewed-on: http://gerrit.openafs.org/9495
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoihandle: Indent ifdef maze
Andrew Deason [Fri, 21 Dec 2012 11:11:00 +0000]
ihandle: Indent ifdef maze

According to the mesoamerican long count calendar, ifdef ladders will
destroy the world in 2012.

Reviewed-on: http://gerrit.openafs.org/8837
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit a04071e7940b26dc2a29ac3f0952b10321e7b786)

Change-Id: I1db449283c709cba48cc887757c9109cfc4bd253
Reviewed-on: http://gerrit.openafs.org/9506
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoafs: Do not avoid DNLC if fakestat is set
Andrew Deason [Fri, 18 May 2012 21:55:09 +0000]
afs: Do not avoid DNLC if fakestat is set

Currently in afs_lookup we avoid putting an entry in the DNLC if
'force_eval' is unset, in order to avoid populating the DNLC with
mountpoint symlinks (we want the target of the mountpoint to be in
there instead, the root dir). However, if -fakestat or -fakestat-all
are enabled, 'force_eval' is always false, since we only set it to
true under certain circumstances when evaluating mountpoints.

To fix this, populate the dnlc for non-mountpoints, even if force_eval
is unset.

Reviewed-on: http://gerrit.openafs.org/7431
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 35d5be2adf2456e26aa6b10935352dc19eb6b3f2)

Change-Id: I32f859c4478432de65025f35ae0c484ff7fa1bf0
Reviewed-on: http://gerrit.openafs.org/9494
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agocacheout: Perform authenticated RXAFS_FlushCPS
Andrew Deason [Mon, 18 Jun 2012 22:01:24 +0000]
cacheout: Perform authenticated RXAFS_FlushCPS

Fileservers may now require RXAFS_FlushCPS calls to be made with
administrator tokens. So, try to make the call with admin tokens, and
provide the usual -noauth and -localauth options.

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

Change-Id: I0d8e38d3cc1b0e55f63cfa0e50fd9cd4cebc8c30
Reviewed-on: http://gerrit.openafs.org/9486
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoviced: initInterfaceAddr_r regardless of ICBS code
Andrew Deason [Fri, 28 Dec 2012 18:16:49 +0000]
viced: initInterfaceAddr_r regardless of ICBS code

Currently we only call initInterfaceAddr_r for a host if a call to
RXAFS_InitCallBackState3 succeeds. However, this leaves the host
without a host->interface structure, which indicates that the host
does not support UUIDs, and is represented by just a single host,port
pair.

But this is not correct; the host probably does have the relevant UUID
associated with it, but it is just not responding. So, with the
current code, we create a uuid-less host structure for a host that
probably has a uuid; that host structure will probably never be used,
and will just get deleted later.

So instead, always call initInterfaceAdd_r. Do it before the ICBS
call, so the host will be findable via UUID as early as possible. If
the ICBS call fails, the host will be marked as 'down' later on.

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

Change-Id: I4847ec0350346d44883b5c5912867555292cf3db
Reviewed-on: http://gerrit.openafs.org/9380
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLINUX: Detect non-vectorized aio functions
Andrew Deason [Wed, 29 Aug 2012 19:14:39 +0000]
LINUX: Detect non-vectorized aio functions

In kernels before 027445c3, the functions generic_file_aio_read and
generic_file_aio_write, as well as the fs operations aio_read and
aio_write, do not deal with iovecs but rather just use a single
buffer. Detect this, so our aio_read and aio_write implementations
have the correct signatures.

This removes several warnings on such kernels.

Reviewed-on: http://gerrit.openafs.org/8020
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit e5ba359f64b5d8d874a31a50694398c17f27cfa1)

Change-Id: I8d8ee81c2bcff2dc85c2ff3e70452a0af5639921
Reviewed-on: http://gerrit.openafs.org/9493
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux: cleanup aio support
Marc Dionne [Fri, 22 Apr 2011 19:23:27 +0000]
Linux: cleanup aio support

Code that called directly into the aio operations (ex: readv/writev)
would bypass the AFS specific operations found in afs_linux_read
and afs_linux_write.

Rework the handlers:
- For newer kernels with aio, let the kernel use its default read
and write operations, and define the aio_read and aio_write operations,
with the AFS specific bits, calling into generic_file_aio_read/write.
The kernels default read/write operations are just wrappers around the
aio versions.
- For older kernels, leave things as is, pointing read and write to
afs_linux_read/write

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

Change-Id: I3c20064cc911aabfce576178c22fcdc1a99b8125
Reviewed-on: http://gerrit.openafs.org/9492
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agovol-salvage: Indent some ifdefs
Andrew Deason [Thu, 31 May 2012 21:08:00 +0000]
vol-salvage: Indent some ifdefs

Reviewed-on: http://gerrit.openafs.org/7513
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 80359f562a459ef1dba2cdf53ee486578b50752d)

Change-Id: I36fdd58895928fc82f9542e3c0d2ec1db7551e42
Reviewed-on: http://gerrit.openafs.org/9479
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoBeautify ubik_print()
Thorsten Alteholz [Sun, 3 Feb 2013 10:58:25 +0000]
Beautify ubik_print()

After lots of intermediate steps a call to ubik_print(), ubik_vprint()
and ubik_dprint*() ends in vFSLog() which adds a timestamp to the output.
So any call to ubik_print(), that does not contain a \n at the end,
makes a mess of the logfile.
The least invasive change will simply add this newline at the end
of any ubik_print() call.
This also prevents long lines in the log, which might appear on
multi-homed hosts with lots of interfaces.

FIXES 1446

Reviewed-on: http://gerrit.openafs.org/9059
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: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit dc32caae7768c486e610c4e56c6a78e9c918d975)

Change-Id: I05892d6d9c47517208e21a3ab00bad2f30d58ba9
Reviewed-on: http://gerrit.openafs.org/9522
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoxstat: print collection values in debug mode
Michael Meffie [Mon, 13 Dec 2010 19:53:50 +0000]
xstat: print collection values in debug mode

Print the values of the integers returned in the collection data
when the -debug option is given to xstat_fs_test and xstat_cm_test
test programs. This allows us to at least see what the unformatted
values are when there is a mismatch in timeval sizes between the
host and client (aka the 32/64 bit xstat bug). This change could
break scripts which call the xstat test programs with the debug
option. New debug output are prepended with 'debug:' to be
easily ignored.

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

Change-Id: Ief2f9346fad92e86aa2a214f1a462a10560c6e64
Reviewed-on: http://gerrit.openafs.org/9567
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agolibafs: Fix statistics for PrefetchFromTape pioctl
Simon Wilkinson [Wed, 13 Jul 2011 12:53:08 +0000]
libafs: Fix statistics for PrefetchFromTape pioctl

The PrefetchFromTape pioctl was overloading SetAcl's statistics. Give
it a slot of its own.

1.6-only: Also give a slot for the master-only PSetTokens2, so xstat
data will be more consistent across versions.

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

Change-Id: I718585a6ff6fcb39469bd6a007e6ebd2b59ef4fa
Reviewed-on: http://gerrit.openafs.org/9468
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoLinux 3.9: hlist iterator change
Marc Dionne [Wed, 6 Mar 2013 01:54:50 +0000]
Linux 3.9: hlist iterator change

hlist iterators have been reworked to not require a temporary
node parameter.

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

Change-Id: I47df8894467f4bb1c60cf239ec0ce0a4d6ca29aa
Reviewed-on: http://gerrit.openafs.org/9639
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoPrint "waiting for job termination" at most once.
Karl Ramm [Sun, 4 Dec 2011 18:56:29 +0000]
Print "waiting for job termination" at most once.

This message is useless, annoying, and is the UI equivalent of littering... but
it does explain why your backup command is just sitting there.

Reviewed-on: http://gerrit.openafs.org/6223
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit 6d6d52e18f3bd537331de6021a0fcc2e96fc48db)

Change-Id: Ide51c7ef7c40426f34a5f1cb6c23395b0d93886a
Reviewed-on: http://gerrit.openafs.org/9438
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoxstat_cm_test: Print all call info stats
Andrew Deason [Tue, 3 Apr 2012 23:13:17 +0000]
xstat_cm_test: Print all call info stats

For CM xstat collecton 0 (function call statistics), there are many
more stats given to us on the wire than we currently print. Change
this so we print out everything in the afs_CMCallStats struct.

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

Change-Id: Ib263a26829bc538009f605ebb502895628e66fc2
Reviewed-on: http://gerrit.openafs.org/9469
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoviced: Avoid dangling uuid hash table entry
Andrew Deason [Fri, 28 Dec 2012 17:58:33 +0000]
viced: Avoid dangling uuid hash table entry

Currently we add a given host to the uuid hash table, then call
RXAFS_InitCallBackState3, and then only initialize the host->interface
structure if the ICBS3 call succeeded.

If the ICBS3 call fails, we have added a host to the uuid hash table,
but the host structure does not contain that uuid. If the host is then
deleted, we will not remove the host from the uuid hash table (since
host->interface is NULL), and so the uuid hash table entry will still
point to the freed host. If that host is then later looked up via that
uuid, we can reference a freed host, which can cause all kinds of
undefined behavior.

So instead, add the host to the uuid hash table at the same time that
we initialize the host->interface structure, inside
initInterfaceAddr_r.

FIXES 131277

Reviewed-on: http://gerrit.openafs.org/8846
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 7b642173c7cd7b6b7130214c1a940501736abbf0)

Change-Id: I838b55244a9745dd07b7d633cb3091414162b0d5
Reviewed-on: http://gerrit.openafs.org/8868
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoCall rx_SetNoJumbo earlier
Andrew Deason [Fri, 4 May 2012 22:23:42 +0000]
Call rx_SetNoJumbo earlier

For ubik server processes, rx_SetNoJumbo needs to be called before
ubik initialization for it to effect the communication between
dbservers; otherwise, full database transfers may result in Rx
jumbograms on the wire regardless of the jumbo/nojumbo setting. Move
the call to rx_SetNoJumbo to before ubik initialization to avoid this.

Also move the call to rx_SetNoJumbo to immediately after rx_Init* for
all server processes, for consistency. Move similar calls to
rx_SetMaxMTU for the same reason.

Reviewed-on: http://gerrit.openafs.org/7350
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
(cherry picked from commit 0debf2d2274db1ea862bfdc2ef767372f1fa77e3)

Change-Id: Iacb1afa853281e856bbb70f39c6ac9a81f210d0d
Reviewed-on: http://gerrit.openafs.org/9121
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

7 years agoafscp: null-terminate root.cell dir if needed in dynroot mode
Derrick Brashear [Thu, 7 Mar 2013 11:53:16 +0000]
afscp: null-terminate root.cell dir if needed in dynroot mode

instead of doing a check for something which will never be true,
and then terminating, just terminate if it's not already
null-terminated.

Reviewed-on: http://gerrit.openafs.org/9439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit ceac74a6baad79155adaa692639b1d9f403525b6)

Change-Id: I14d3de25bca5b1ba1878048aac1973518f8c2359
Reviewed-on: http://gerrit.openafs.org/9583
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

7 years agoLinux: Add missing semi-colon
Marc Dionne [Mon, 11 Feb 2013 23:49:21 +0000]
Linux: Add missing semi-colon

Add a missing semi-colon in the error case when missing symbols
are detected.  The effect is strictly cosmetic - a few additional
error messages would follow the "undefined symbols" error.

Reviewed-on: http://gerrit.openafs.org/9095
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
(cherry picked from commit 50879d5727c183982a40bd242d6039ed470d835d)

Change-Id: If2c1be51969131794cb2ea30f96490fce95b0103
Reviewed-on: http://gerrit.openafs.org/9365
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>