openafs.git
8 years agoMake OpenAFS 1.6.14.1 openafs-stable-1_6_14_1 openafs_stable_1_6_14_1
Stephan Wiesand [Fri, 14 Aug 2015 06:46:36 +0000]
Make OpenAFS 1.6.14.1

Update configure version strings for 1.6.14.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.14.1.
Switch to 1.6.15 dev 1 for macos.

Change-Id: I733de0ef5d359bffdb7ffe6a7c12cf60f18618c0
Reviewed-on: http://gerrit.openafs.org/11982
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoUpdate NEWS for 1.6.14.1
Stephan Wiesand [Mon, 31 Aug 2015 19:48:19 +0000]
Update NEWS for 1.6.14.1

Release notes for OpenAFS 1.6.14.1 .

Change-Id: I61fcb122eba98a3d5e2180b9de4bcdc611678cc6
Reviewed-on: http://gerrit.openafs.org/11993
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux: Only use automount for volume roots
Marc Dionne [Wed, 29 Jul 2015 12:03:14 +0000]
Linux: Only use automount for volume roots

As long as we avoid using directory aliases when crossing
a mount point (at the volume root), we should always get
to a given non root directory with the same dentry.
The mechanism added by commit de381aa0 ("Linux: Make dir
dentry aliases act like symlinks") is therefore only really
necessary for a volume root.

With kernel 4.2 it is not possible to tweak the "total link
count", resulting in ELOOP errors when looking up a path
with 40 or more directories that are being looked up for
the first time.  With this change, only mountpoints will
count against the limit.

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

Change-Id: I16e855c8322174604288b7d440b342951dd3a015
Reviewed-on: http://gerrit.openafs.org/11989
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux 4.2: Changes in link operation APIs
Marc Dionne [Mon, 6 Jul 2015 16:01:38 +0000]
Linux 4.2: Changes in link operation APIs

The follow_link and put_link operations are revised.
Test for the new signature and adapt the code.

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

Change-Id: I779fe8a29ec75a5db545b5d370927b810c1165c9
Reviewed-on: http://gerrit.openafs.org/11951
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux: Add AC_CHECK_LINUX_OPERATION configure macro
Marc Dionne [Mon, 6 Jul 2015 15:00:10 +0000]
Linux: Add AC_CHECK_LINUX_OPERATION configure macro

Add a new macro to check the signature of a particular
operation against a provided typed argument list.
One of the arguments is an arbitrary label that is used
to construct the pre-processor define name.  This will
allow for testing of different forms for the same
operation.

This can be used to replace many of the remaining odd
checks in src/cf/linux_test4.m4.

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

Change-Id: Id929412d87bb9fc38b2b599abbe3fddca3cda4b1
Reviewed-on: http://gerrit.openafs.org/11950
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux 4.2: total_link_count is no longer accessible
Marc Dionne [Mon, 6 Jul 2015 14:00:13 +0000]
Linux 4.2: total_link_count is no longer accessible

The value is now stored in the nameidata structure which
is private to fs/namei.c, so we can't modify it here.

The effect is that using a path that contains 40+ directories
may fail with ELOOP, depending on which directories in the
path were previously used.  After a directory is accessed once
its D_AUTOMOUNT flag is reset and it will no longer count
against the symlink limit in later path lookups.

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

Change-Id: Ib6282f3029c4112c510217eacf270a56d679fccd
Reviewed-on: http://gerrit.openafs.org/11949
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux 4.2: Pass namespace to sock_create_kern
Marc Dionne [Wed, 8 Jul 2015 17:32:31 +0000]
Linux 4.2: Pass namespace to sock_create_kern

sock_create_kern gains an additional network namespace
argument.

Pass in the default system namesapce.

Reviewed-on: http://gerrit.openafs.org/11925
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit e597b879677d023165298adadfb88db031883ff4)

Change-Id: I8e4341a6b4c33c5226b9307827932f577e08d5b2
Reviewed-on: http://gerrit.openafs.org/11948
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux CM: Use kernel allocator directly
Simon Wilkinson [Sun, 17 Apr 2011 22:43:51 +0000]
Linux CM: Use kernel allocator directly

In another few locations within the Linux portion of the cache
manager, directly use the kernel allocator. We can do so here
because we can guarantee that the amount of memory being allocated
is less than the page size, and there is a kfree() in all of the
exit paths, so we don't need the magic freeing behaviour, either.

Reviewed-on: http://gerrit.openafs.org/4752
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 7a70c2907b0435653098a611a140fea1ac0b2fac)

Change-Id: I72fd6a2109022af5e14d90ce147705da7ccec587
Reviewed-on: http://gerrit.openafs.org/11933
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoMake OpenAFS 1.6.14 openafs-stable-1_6_14
Stephan Wiesand [Tue, 4 Aug 2015 12:13:38 +0000]
Make OpenAFS 1.6.14

Update version strings for release 1.6.14.

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

8 years agoUpdate NEWS for 1.6.14
Stephan Wiesand [Thu, 13 Aug 2015 10:44:44 +0000]
Update NEWS for 1.6.14

Release notes for OpenAFS 1.6.14

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

8 years agovlserver: ListAttributesN2 volume name safety
Jeffrey Altman [Sat, 1 Aug 2015 13:32:35 +0000]
vlserver: ListAttributesN2 volume name safety

The vlserver ListAttributesN2 RPC permits filtering the result set
by volume name in addition by site or volume id.

Two issues identified by Andrew Deason (Sine Nomine Associates) are
addressed by this patch.  First, the size of the volumename[] buffer
is insufficient to store the valid input read over the network.  The
buffer needs to be able to store VL_MAXNAMELEN characters of the volume
name, two characters for the regular expression '^' and '$', and the
trailing NUL.

Second, sprintf() is used to write to the buffer and even with valid
input from the caller SVL_ListAttributesN2 can overflow the buffer
when ".backup" and ".readonly" are appended to the volume name.  If
there is an overflow the search name is invalid and there can not be
a valid match.

This patch increases the size of volumename[] to VL_MAXNAMELEN+3.

It also uses snprintf() instead of sprintf() and performs error
checking.  The error VL_BADNAME is returned when the network input is
invalid.

Reviewed-on: http://gerrit.openafs.org/11969
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Nathaniel Filardo <nwfilardo@gmail.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit c9f430fd8f479bbfe28829f7032ecd325a4f833d)

Change-Id: I1b48cc8ed1a52afc36465f2fbd5bfd5345e90c41
Reviewed-on: http://gerrit.openafs.org/11976
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agovlserver: limit use of regex to admins always
D Brashear [Fri, 18 Jul 2014 20:00:12 +0000]
vlserver: limit use of regex to admins always

allow regexes only if the querying user is a superuser.
if the superuser uses up all the resources, well, they could just do
whatever damage directly anyway. means even in unrestricted mode
we are not vulnerable

Reviewed-on: http://gerrit.openafs.org/11968
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 049323e7e03c64f534a73ff452d218f19d5b8132)

Change-Id: I1e3f11bd14b071be69eb6e00c26ea2209596c82a
Reviewed-on: http://gerrit.openafs.org/11975
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoRevert "vlserver: Disable regex volume name processing in ListAttributesN2"
Stephan Wiesand [Tue, 4 Aug 2015 14:05:06 +0000]
Revert "vlserver: Disable regex volume name processing in ListAttributesN2"

This reverts commit 63087b338e3d0fbbb26ee183a039052bf07aaaec.

Change-Id: I4bb759893224b8c53a1deb50f34e8395ed44fb4a
Reviewed-on: http://gerrit.openafs.org/11971
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoMake OpenAFS 1.6.13 openafs-stable-1_6_13
Stephan Wiesand [Mon, 13 Jul 2015 10:56:44 +0000]
Make OpenAFS 1.6.13

Update version strings and NEWS for release 1.6.13

Change-Id: I0383e39658420f710e6ab8c20e7ce080f51b1bc0

8 years agovlserver: Disable regex volume name processing in ListAttributesN2
Andrew Deason [Wed, 8 Jul 2015 18:37:16 +0000]
vlserver: Disable regex volume name processing in ListAttributesN2

For the interim and until it is needed, this is most prudently
simply disabled.

FIXES 131890

(cherry picked from commit 22481ab3705522ac1988b7de038c4dbc1e5009a9)

Change-Id: I612ea4a1c85fdb895acc6a71801e659869e849c2

8 years agoSolaris: setpag should verify that ngroups will not overflow
Mark Vitale [Wed, 8 Jul 2015 18:28:50 +0000]
Solaris: setpag should verify that ngroups will not overflow

Our ngroups management (since PAGs are still encoded as 2 groups) needs
to ensure that we do not overflow what we are prepared to handle,
and do not panic due to misheld mutexes if we have to return an error
when handling it.

FIXES 131878 (CVE-2015-3286)

(cherry-picked from commit 8ce4a3905268385d3f5a0e11f20594875467cae6)

Change-Id: I34a298ab776f69d52c8f621f79aafc79199f9cc4

8 years agoafs: Use correct output buffer for FSCmd pioctl
Andrew Deason [Wed, 8 Jul 2015 18:20:13 +0000]
afs: Use correct output buffer for FSCmd pioctl

MRAFS added the FsCmd pioctl for passing messages to the fileserver;
a bug causes it to write into the wrong memory and potentially panic
clients.

FIXES 131896 (CVE-2015-3285)

(cherry picked from commit ef671f497e9161ec2759446d594789495d3346f1)

Change-Id: I1ee1fa7dff1d2594cfe9fab5ae0b7fc9245803de

8 years agoafs: Clear pioctl data interchange buffer before use
Daria Brashear [Wed, 8 Jul 2015 18:16:41 +0000]
afs: Clear pioctl data interchange buffer before use

Avoid leaking data in pioctl interchange buffers; clear the memory
when one is allocated.

FIXES 131892 (CVE-2015-3284)

(cherry picked from commit 592a99d6e693bc640e2bdfc2e7e5243fcedc8f93)

Change-Id: I90fef404978bd7aae3eb88836bcd4f95587fd45c

8 years agobos: Use crypt for commands where spoofing could be a risk
Daria Brashear [Wed, 8 Jul 2015 18:11:33 +0000]
bos: Use crypt for commands where spoofing could be a risk

bos defaults to not requiring crypt in a lot of cases, instead using clear.

As the simplest way to secure the channel is to enable crypt, do so.

FIXES 131782 (CVE-2015-3283)

(cherry picked from commit 62926630a82b8635d1cb1514b852f9f7a2609311)

Change-Id: Ib9e2514c4d14a77eead69677da1dabf86e526ebc

8 years agovos: Clear nvldbentry before sending on the wire
Daria Brashear [Wed, 8 Jul 2015 17:51:47 +0000]
vos: Clear nvldbentry before sending on the wire

Don't leak stack data onto the wire. Clear nvldbentry before use.

FIXES 131907 (CVE-2015-3282)

(cherry picked from commit 415a2aad4c1e9ab5d034b62989e4c16a37b5dcc7)

Change-Id: Ic245a2b5ef5cc54a2a5fdfb5d458b6892c4bcf34

8 years agoMake OpenAFS 1.6.12 openafs-stable-1_6_12
Stephan Wiesand [Thu, 4 Jun 2015 09:11:31 +0000]
Make OpenAFS 1.6.12

Update version strings and NEWS for release 1.6.12

Change-Id: If3ecee369ad1fe1e5866e3ffccc233ad4085684a
Reviewed-on: http://gerrit.openafs.org/11884
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoMake OpenAFS 1.6.12pre2 openafs-stable-1_6_12pre2
Stephan Wiesand [Thu, 7 May 2015 07:57:50 +0000]
Make OpenAFS 1.6.12pre2

prerelease for 1.6.12

Change-Id: I139d2533e76b480b789eada9e049a1dbd2321d2c
Reviewed-on: http://gerrit.openafs.org/11864
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoUpdate NEWS for 1.6.12pre2
Stephan Wiesand [Wed, 27 May 2015 12:52:41 +0000]
Update NEWS for 1.6.12pre2

Preliminary release notes for 1.6.12.

Change-Id: I12349fb2a8b29e031e33f7105aa66887ef460ff0
Reviewed-on: http://gerrit.openafs.org/11881
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux: mmap: Apply recursion check only to recursion cases
Marc Dionne [Wed, 22 Apr 2015 18:06:12 +0000]
Linux: mmap: Apply recursion check only to recursion cases

The CPageWrite flag was originally added to prevent a scenario
where a thread doing "writepage" would realize that the cache
was too full and that some of its contents need to be written
back to the server.  Before writing back it would ask the OS to
flush any dirty VM associated with the vcache entries that are
to be written, to make sure the data is not stale.  This flush
could itself trigger writeback, leading to deadly recursion.
One such scenario is a process doing mmap writes to a file larger
than the cache.

With some kernel versions and some callers of writepage, this
can cause the mapping to be marked as being in an error state,
leading to EIO errors passed back to user space.

Make the recursion check more specific to only bail when the
calling thread is one that was originally seen writing.  A list
of current writers is maintained instead of a single state flag.

This lets other threads (like the flusher thread) go on with
writeback to the same file, and limits the WRITEPAGE_ACTIVATE
return case to call sites that can deal with it.

In testing this helps avoid EIO errors when writing large
chunks of data through mmap.

Thanks to Yadav Yadavendra for extensive analysis and testing.

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

Change-Id: I08ced97c4f58f95375fda2ed9c707cdf7657e493
Reviewed-on: http://gerrit.openafs.org/11877
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux 4.1: Don't define or use ->write directly
Marc Dionne [Mon, 20 Apr 2015 13:41:53 +0000]
Linux 4.1: Don't define or use ->write directly

We no longer have to define a ->write operation, and we can't
expect the underlying disk cache filesystem to have one.  Use
the new __vfs_read/write helpers that will select the operation
to use based on what's available for that particular filesystem.

Reviewed-on: http://gerrit.openafs.org/11849
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 5c1237432edf4600111845d175c92252430d5f76)

Change-Id: I21bca85637e07d0e03ef471896d0454eeef68a14
Reviewed-on: http://gerrit.openafs.org/11873
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoLinux 4.1: No need for do_sync_read
Marc Dionne [Mon, 20 Apr 2015 13:37:40 +0000]
Linux 4.1: No need for do_sync_read

Make the test here a bit more specific. do_sync_read no longer
exists, but we don't use it for new kernels.  Trying to define it
here in terms of generic_file_read is not helpful as that doesn't
exist anymore.

Reviewed-on: http://gerrit.openafs.org/11848
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit fcfa5ae2468d878db962a93d6013fcd3042e6c13)

Change-Id: I87bf0fc856d244d15bdae300f0cd6b80ecb63797
Reviewed-on: http://gerrit.openafs.org/11872
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoafsio: switch BreakUpPath to strdup
Benjamin Kaduk [Wed, 20 May 2015 14:57:53 +0000]
afsio: switch BreakUpPath to strdup

The current version of BreakUpPath is slightly broken, since
commit 4e68282e26b0c4569d25d076d54274f0da47a691 -- it has two
output parameters but takes only one length parameter for the
size of the output buffers passed in.  The callers ended up using
the shorter of the buffer lengths in question, so there is not
a risk of a buffer overrun, but long paths would not be properly
handled.

There is not really any need to pass in a length at all, since
what is going on is conceptually strdup, and there is no real
need to use strlcpy at all.  Make the change from strlcpy to
str(n)dup, and adjust callers to free the outputs as appropriate.

While here, convert writeFile() to use goto and a cleanup handler
to avoid leaks.

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

Change-Id: I13d4ffd4ef46cbb7423d229cf6a6e85f7a42ecc1
Reviewed-on: http://gerrit.openafs.org/11879
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoafsio: process windows file paths consistently
Jeffrey Altman [Mon, 12 Nov 2012 03:00:07 +0000]
afsio: process windows file paths consistently

Windows file paths can use either '\' or '/' as a path
separator.  libafscp on the other hand requires '/' and argv[0]
will always use '\'.

Introduce a new function ConvertAFSPath() which converts the
input path to '/' and converts \\afs to /afs.  A future commit
should access the registry and make use of the NetbiosName and
MountRoot values to perform the conversion correctly.

Reviewed-on: http://gerrit.openafs.org/8430
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 0bef3159d3698a941154bd21352eb35bd94edb8c)

Change-Id: Id174313afae9c64a27133477e43e13731c0ac6b7
Reviewed-on: http://gerrit.openafs.org/11878
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agovenus: Make clang happy with strlcpy use
Simon Wilkinson [Fri, 30 Mar 2012 18:35:51 +0000]
venus: Make clang happy with strlcpy use

clang now expects that strlcpy will always be used to prevent overflow
of the destination string, and gives a warning if the size parameter is
based solely on the length of the source string.

Modify the BreakUpPath function so that it takes the size of the
destination string as an argument, and uses this to limit the amount of
data pasted into it.

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

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

8 years agolibafscp: Use strdup, rather than rolling our own
Simon Wilkinson [Fri, 30 Mar 2012 18:18:47 +0000]
libafscp: Use strdup, rather than rolling our own

   A = malloc(strlen(B)+ 1);
   memset(A, 0, strlen(B) + 1);
   strlcpy(A, B, strlen(B) + 1);
can be more simply written as
   A = strdup(B);

Doing so also avoids a warning from clang that strlcpy isn't checking
for A overflowing.

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

Change-Id: I886bef77fdedb63d1c83e657c25d112e0a635db2
Reviewed-on: http://gerrit.openafs.org/11844
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoRemove spurious NULL checks
Ben Kaduk [Wed, 11 Feb 2015 22:47:10 +0000]
Remove spurious NULL checks

clang 3.5 is more aggressive about these checks than the previous
FreeBSD system compiler, so new warnings (which became errors)
appeared on FreeBSD 11-CURRENT.

In afs_dcache.c, checking &tdc->f for NULL-ness has no effect.
The struct fcache f member of struct dcache is an ordinary structure
element; its address will be the value of tdc plus the offset of
f within struct dcache, which will not be NULL even if tdc is NULL.

In ubik_db_if.c, udbHandle is a file-scope global and thus has
allocated storage; the address of a member variable will never
be NULL.  The 0 it was compared against was spelled RX_SECIDX_NULL,
which shows the intended check, which is for the value of the
uh_scIndex member variable, not its address.

In afscp_server.c, srv->conns can never be NULL since conns is a member
variable of struct afscp_server (of array type, containing pointers
to struct rx_connection).  Comparing the array member variable against
NULL is comparing the address of the array, which is never NULL since
it is not allocated separately from struct afscp_server.

In fssync-debug.c, state.vop->partName is never NULL because
common_volop_prolog always allocates for state.vop, and the
partName member variable of struct fssync_state is of array type,
and thus is not separately allocated from the containing structure.

Reviewed-on: http://gerrit.openafs.org/11739
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit fb499c2406450fa5dc423a0b038266d3b8e79e33)

Change-Id: I13799a3362508672136f8c603eabdfc0f3ee072d
Reviewed-on: http://gerrit.openafs.org/11843
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agokauth: fix clock skew detection
Benjamin Kaduk [Wed, 22 Apr 2015 17:43:43 +0000]
kauth: fix clock skew detection

Commit 5b3c1042969daec38ccb260e61d665eda0c713ea changed/removed some
uses of abs() on unsigned time values. While the previous use of abs()
was indeed incorrect, the result wasn't necessarily much better, even
though it built with recent compilers, since it only checked for skew
in one direction.

Define and use a  macro to correctly evaluate the conditionals in 64-bit
precision, avoiding C's integer promotion rules which prefer unsigned types
(Date) to signed types of the same width (time_t on 32-bit systems).

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

Change-Id: I29337e1ecd410fcf7733408287930c50c055ff90
Reviewed-on: http://gerrit.openafs.org/11863
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoFix incorrect uses of abs()
Ben Kaduk [Fri, 13 Feb 2015 14:47:20 +0000]
Fix incorrect uses of abs()

abs(3) is a function of one variable of type int returning int.
labs(3) is a function of one variable of type long returning long.

labs(3) should be used when the input is of type long, as in
kaprocs.c.

Calling anything from the abs(3) family on a variable of unsigned
type is a bogus type pun, and a logical operation which is a no-op.
(Unsigned values are never negative and thus the absolute value
function is the identity over the entire range of values representable
in an unsigned type.)  Just remove the use of abs() for unsigned
values, as in kaprocs.c, krb_udp.c, and vldb_check.c

While in kaprocs.c, wrap a long line that was touched for the
conversion to labs(3), spell the argument to time(3) as NULL
instead of 0, remove unneeded parentheses, and correct the spelling
of "reserved".

Reviewed-on: http://gerrit.openafs.org/11745
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 5b3c1042969daec38ccb260e61d665eda0c713ea)

Change-Id: I82038e41346479dad39466907b95f2d7540f6258
Reviewed-on: http://gerrit.openafs.org/11842
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoAdd defines for recent darwin sysctl constants
Daria Brashear [Thu, 21 May 2015 20:34:09 +0000]
Add defines for recent darwin sysctl constants

These were accidentally omitted from commit
ab9bb6363ca95f658764fbb9fb68ec88f89a5b3f.

Reviewed-on: http://gerrit.openafs.org/11875
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 9076cbd58dd48801ad212f803f586fdc53d7b886)

Change-Id: I5a2ff768e0faec955c6ed7dafb4231fd3885e5bd
Reviewed-on: http://gerrit.openafs.org/11876
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

8 years agoosx: update afssettings for yosemite
Daria Brashear [Thu, 16 Apr 2015 17:12:05 +0000]
osx: update afssettings for yosemite

handle deprecated functions

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

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

9 years agoMake OpenAFS 1.6.12pre1 openafs-stable-1_6_12pre1
Stephan Wiesand [Thu, 5 Mar 2015 10:17:46 +0000]
Make OpenAFS 1.6.12pre1

prerelease for 1.6.12

Change-Id: Id73f0d7daa82ea51e7e62a497b1604f5ee658cc0
Reviewed-on: http://gerrit.openafs.org/11796
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoUpdate NEWS for 1.6.12pre1
Stephan Wiesand [Mon, 13 Apr 2015 11:01:51 +0000]
Update NEWS for 1.6.12pre1

Preliminary release notes for 1.6.12.

Change-Id: Ic54f4720c85ca819680d91d5329acc7aaa0d1960
Reviewed-on: http://gerrit.openafs.org/11832
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoaklog: Correct size used for strlcpy()
Nathan Dobson [Fri, 20 Mar 2015 22:32:22 +0000]
aklog: Correct size used for strlcpy()

When copying into the 'cell' array, use the size of cell, not
the size of some other array that is copied into a few lines previously.

(cherry picked from commit 777870da86e9ed66756e01e858a54e959959482d)

Change-Id: Ib8b523901dd8008038c5a95a7c315b899cff8cee
Reviewed-on: http://gerrit.openafs.org/11807
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-on: http://gerrit.openafs.org/11808
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoubik: DISK_UpdateInterfaceAddr == server restart
Jeffrey Altman [Wed, 11 Feb 2015 06:25:04 +0000]
ubik: DISK_UpdateInterfaceAddr == server restart

If a DISK_UpdateInterfaceAddr RPC is received the server that sent
it restarted.  Force the urecovery code to verify the server state.

Change-Id: I465863dc3a52d844b56d576bd55229435556cfd6
Reviewed-on: http://gerrit.openafs.org/11738
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 30667a5d7b86b29f9aafe2b490d89b8e01bfc541)
Reviewed-on: http://gerrit.openafs.org/11774
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoubik: SDISK_Begin no quorum, wrong db, no transaction
Jeffrey Altman [Thu, 22 Jan 2015 06:14:28 +0000]
ubik: SDISK_Begin no quorum, wrong db, no transaction

When processing an DISK_Begin RPC verify that there is an active quorum
and that the local database is current.  Otherwise, fail the RPC with
a UNOQUORUM error.

The returned error must be UNOQUORUM instead of USYNC becase the returned
error code will be returned by the coordinator's ContactQuorum_iterate()
to the client that triggered the write transaction.  Most ubik clients
will only retry if the error is UNOQUORUM.

FIXES 131997

Change-Id: Icaa30e6aca82e7e7d33e9171a4f023970aba61df
Reviewed-on: http://gerrit.openafs.org/11689
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Hutzelman <jhutz@cmu.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit d47beca13236c64ed935fabeff9d1001e8a8871f)
Reviewed-on: http://gerrit.openafs.org/11773
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agolibafs: remove "Please install afsd with check server daemon" warning
Michael Meffie [Fri, 14 Nov 2014 03:28:08 +0000]
libafs: remove "Please install afsd with check server daemon" warning

Apparently, ancient versions of afsd did not start the check server
daemon (AFSOP_START_CS). The afs_Daemon tries to detect when the check
server daemon is not running and issues a warning to upgrade afsd.  The
afs_Daemon waits for the cache initialization to complete (AFSOP_GO)
before detecting if the cache server daemon is started.

Unfortunately, when running with memcache, the cache initialization is
fast enough to race with the start of the check server daemon, and the
"Please install afsd with check server daemon" message is sometimes
printed to the syslog.

Since all modern versions of afsd do start the check server daemon, this
error message is no longer needed, so just remove the message and the
flag used to print it on only once.

Reviewed-on: http://gerrit.openafs.org/11602
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 8ce37d0d4aa4e6107f79efaf5027f31ea5a17604)

Change-Id: I292052c9ba629c85ddc4b76c4b3db7d54ce1d852
Reviewed-on: http://gerrit.openafs.org/11680
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agodoc: Document fs listquota 2TB partition limit
Andrew Deason [Tue, 10 Jun 2014 19:47:31 +0000]
doc: Document fs listquota 2TB partition limit

We have previously documented that volumes over 2TB can result in
inaccuracies, but this documentation does not say how the 'partition'
field in "fs listquota" can be inaccurate. It is confusing to see a
usage of 0% for a partition that you know is being used, so try to
briefly explain in what way this field is inaccurate.

The reason we _under_-report the partition usage is that the
fileserver actually gives back PartBlocksAvail and PartMaxBlocks (not
"blocks used" and "blocks total"). So 1TB used and 4TB total is
truncated to 2TB and given back as 2TB free and 2TB total. One we hit
3TB used we'll report it as 1TB free 2TB total (50%) when the actual
usage is 75%.

Reviewed-on: http://gerrit.openafs.org/11245
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit cd8f24d9a1ba8563c6bef2b8d30885a753e8d30c)

Change-Id: I2bd72cca994414a88073d26d44bef49e9cac3be1
Reviewed-on: http://gerrit.openafs.org/11626
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Chas Williams <3chas3@gmail.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoMake OpenAFS 1.6.11.1 openafs-stable-1_6_11_1
Stephan Wiesand [Wed, 1 Apr 2015 13:52:46 +0000]
Make OpenAFS 1.6.11.1

Update configure version strings for 1.6.11.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.11.1.
Switch to 1.6.12 dev 1 for macos.

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

9 years agoUpdate NEWS for 1.6.11.1
Stephan Wiesand [Wed, 1 Apr 2015 13:58:32 +0000]
Update NEWS for 1.6.11.1

Release notes for 1.6.11.1.

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

9 years agoLinux 4: struct address_space no longer has backing_dev_info
Anders Kaseorg [Mon, 23 Feb 2015 05:13:05 +0000]
Linux 4: struct address_space no longer has backing_dev_info

The backing_dev_info is only stored in the super_block now.

Reviewed-on: http://gerrit.openafs.org/11756
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 5cca05d1a1c9883e33c953b31c4cb32252474f77)

Change-Id: Id6f2f2dcc111c46ce1339595e145891758c46bab
Reviewed-on: http://gerrit.openafs.org/11761
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoTreat Linux 4 (and greater) as Linux 2.6/3
Anders Kaseorg [Mon, 23 Feb 2015 04:43:49 +0000]
Treat Linux 4 (and greater) as Linux 2.6/3

In an age where Linux version numbers are determined by Google+ polls,
it’s clear that they aren’t going to be very useful for marking major
API compatibility boundaries like they were in the days of 2.2/2.4.

Reviewed-on: http://gerrit.openafs.org/11755
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit a5b091e1ec69d4a43d6f1b1efc93134ef7ed2167)

Change-Id: I5b0da6b43e3cbf5d9a6fa883a09deccb359e53e9
Reviewed-on: http://gerrit.openafs.org/11760
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoFBSD: do not set -mno-align-long-strings
Benjamin Kaduk [Wed, 25 Mar 2015 04:26:42 +0000]
FBSD: do not set -mno-align-long-strings

The new clang imported for FreeBSD 10.1 has stopped accepting
this argument as a no-op.  Fix the kernel module build by
stopping passing it on the compiler command line.

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

9 years agoUpdate CellServDB to 20150119 snapshot openafs-stable-1_6_11
Stephan Wiesand [Thu, 26 Feb 2015 09:13:50 +0000]
Update CellServDB to 20150119 snapshot

Update all remaining copies of CellServDB in the tree, and make the
Red Hat packaging use it by default too.

Reviewed-on: http://gerrit.openafs.org/11764
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 8cb4a42496f71c3d47ebe30a96ec33478e203c82)

Change-Id: I77854bb86ae0d17c4094705e80586b53ba504956
Reviewed-on: http://gerrit.openafs.org/11767
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoMake OpenAFS 1.6.11
Stephan Wiesand [Wed, 25 Feb 2015 15:35:12 +0000]
Make OpenAFS 1.6.11

Update version strings and NEWS for release 1.6.11

Change-Id: I43770a355adc551b1bbd42ac3abc6b649b600532
Reviewed-on: http://gerrit.openafs.org/11762
Tested-by: BuildBot <buildbot@rampaginggeek.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>

9 years agoMake OpenAFS 1.6.11pre2 openafs-stable-1_6_11pre2
Stephan Wiesand [Wed, 4 Feb 2015 13:24:02 +0000]
Make OpenAFS 1.6.11pre2

prerelease for 1.6.11

Change-Id: I5418881f003b6cb1a74fad2397cd5d2c67613181
Reviewed-on: http://gerrit.openafs.org/11709
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoDocument --enable-linux-d_splice_alias-extra-iput
Stephan Wiesand [Tue, 17 Feb 2015 14:34:33 +0000]
Document --enable-linux-d_splice_alias-extra-iput

Even though we hope no one will actually ever need to use it, explain
this configure switch in the same place as the others.

Reviewed-on: http://gerrit.openafs.org/11749
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
(cherry picked from commit e02b852f05c0927d48b6467872378bae99df2760)

Change-Id: I4f7e42730afab2387d343880acc81d28b70ef5e9
Reviewed-on: http://gerrit.openafs.org/11752
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoUpdate NEWS for 1.6.11pre2
Stephan Wiesand [Fri, 13 Feb 2015 13:50:44 +0000]
Update NEWS for 1.6.11pre2

Preliminary release notes for OpenAFS 1.6.11

Change-Id: I5f23fcbe3ba8520ca4789984c26f84f966f70ff9
Reviewed-on: http://gerrit.openafs.org/11744
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agorx: Zero unitialized uio structs
Andrew Deason [Wed, 4 Feb 2015 16:25:38 +0000]
rx: Zero unitialized uio structs

We use some uio structures that were allocated on the stack, but we
only initialize them by initializing individual fields. On some
platforms (Solaris is one known example, but probably not the only
one), there are additional fields we do not initialize. Since we
cannot be certain of what any additional fields there may be, just
zero the whole thing.

This is basically the same change as
I0eae0b49a70aee19f3a9ec118b03cfb3a6bd03a3, but in the rx subtree.

Reviewed-on: http://gerrit.openafs.org/11711
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
(cherry picked from commit a762e6871ad6837ee126cec9e63d99388b4bf119)

Change-Id: Ie6a2cce500d6a0a7a09c305296f4b34d122d3108
Reviewed-on: http://gerrit.openafs.org/11714
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLinux: d_splice_alias may drop inode reference on error
Marc Dionne [Thu, 18 Dec 2014 13:43:22 +0000]
Linux: d_splice_alias may drop inode reference on error

d_splice_alias now drops the inode reference on error, so we
need to grab an extra one to make sure that the inode doesn't
go away, and release it when done if there was no error.

For kernels that may not drop the reference, provide an
additional iput() within an ifdef.  This could be hooked up
to a configure option to allow building a module for a kernel
that is known not to drop the reference on error.  That hook
is not provided here.  Affected kernels should be the early
3.17 ones (3.17 - 3.17.2); 3.16 and older kernels should not
return errors here.

[kaduk@mit.edu add configure option to control behavior, which
is mandatory on non-buildbot linux systems]

Reviewed-on: http://gerrit.openafs.org/11643
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 15260c7fdc5ac8fe9fb1797c8e383c665e9e0ccd)

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

9 years agoafs: Zero uninitialized uio structs
Andrew Deason [Fri, 30 Jan 2015 19:29:57 +0000]
afs: Zero uninitialized uio structs

In several places in the code, we allocate a 'struct uio' on the
stack, or allocate one from non-zeroed memory. In most of these
places, we initialize the structure by assigning individual fields to
certain values. However, this leaves any remaining fields assigned to
random garbage, if there are any additional fields in the struct uio
that we don't know about.

One such platform is Solaris, which has a field called uio_extflg,
which exists in Solaris 11, Solaris 10, and possibly further back.
One of the flags defined for this field in Solaris 11 is UIO_XUIO,
which indicates that the structure is actually an xuio_t, which is
larger than a normal uio_t and contains additional fields. So when we
allocate a uio on the stack without initializing it, it can randomly
appear to be an xuio_t, depending on what garbage was on the stack at
the time. An xuio_t is a kind of extensible structure, which is used
for things like async I/O or DMA, that kind of thing.

One of the places we make use of such a uio_t is in afs_ustrategy,
which we go through for cache reads and writes on most Unix platforms
(but not Linux). When handling a read (reading from the disk cache
into a mapped page), a copy of our stack-allocated uio eventually gets
passed to VOP_READ. So VOP_READ for the cache filesystem will randomly
interpret our uio_t as an xuio_t.

In many scenarios, this (amazingly) does not cause any problems, since
generally, Solaris code will not notice if something is flagged as an
xuio_t, unless it is specifically written to handle specific xuio_t
types. ZFS is one of the apparent few filesystem implementations that
can handle xuio_t's, and will detect and specially handle a
UIOTYPE_ZEROCOPY xuio_t differently than a regular uio_t.

If ZFS gets a UIOTYPE_ZEROCOPY xuio_t, it appears to ignore the uio
buffers passed in, and supplies its own buffers from its cache. This
means that our VOP_READ request will return success, and act like it
serviced the read just fine. However, the actual buffer that we passed
in will remain untouched, and so we will return the page to the VFS
filled with garbage data.

The way this typically manifests is that seemingly random pages will
contain random data. This seems to happen very rarely, though it may
not always be obvious what is going on when this occurs.

It is also worth noting that the above description on Solaris only
happens with Solaris 11 and newer, and only with a ZFS disk cache.
Anything older than Solaris 11 does not have the xuio_t framework
(though other uio_extflg values can cause performance degradations),
and all known non-ZFS local disk filesystems do not interpret special
xuio_t structures (networked filesystems might have xuio_t handling,
but they shouldn't be used for a cache).

Bugs similar to this may also exist on other Unix clients, but at
least this specific scenario should not occur on Linux (since we don't
use afs_ustrategy), and newer Darwin (since we get a uio allocated for
us).

To fix this, zero out the entire uio structure before we use it, for
all instances where we allocate a uio from the stack or from
non-zeroed memory. Also zero out the accompanying iovec in many
places, just to be safe. Some of these may not actually need to be
zeroed (since we do actually initialize the whole thing, or a platform
doesn't have any additional unknown uio fields), but it seems
worthwhile to err on the side of caution.

Thanks to Oracle for their assistance on this issue, and thanks to the
organization experiencing this issue for their patience and
persistence.

1.6 note: This differs noticeably from the master commit in two
places:

 - src/afs/NBSD/osi_vnodeops.c: On master there is no stack-allocated
   uio struct here.

 - src/afs/VNOPS/afs_vnop_write.c and afs_vnop_read.c: On master,
   these code paths are structured quite differently, and are handled
   in afs_osi_uio.c instead.

Reviewed-on: http://gerrit.openafs.org/11705
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
(cherry picked from commit 5ef1de5eddccce0e7b135bb9ed4decaa62fc19ce)

Change-Id: I8dbf60637774dff81ff839ccd78f58b3b1e85c5b
Reviewed-on: http://gerrit.openafs.org/11713
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoSOLARIS: Avoid uninitialized caller_context_t
Andrew Deason [Fri, 30 Jan 2015 19:08:19 +0000]
SOLARIS: Avoid uninitialized caller_context_t

Currently we pass a caller_context_t* to some of Solaris' VFS
functions (VOP_SETATTR, VOP_READ, VOP_WRITE, VOP_RWLOCK,
VOP_RWUNLOCK), but the pointer we pass is to uninitialized memory.

This code was added in commit 51d76681, and this particular argument
is mentioned in
<https://lists.openafs.org/pipermail/openafs-info/2004-March/012657.html>,
where the author doesn't really know what the argument is for.

Over 10 years later, it's still not obvious what this argument does,
since I cannot find any documentation for it. However, browsing
publicly-available Illumos/OpenSolaris source suggests this is used
for things like non-blocking operations for network filesystems, and
is only interpreted by certain filesystems in certain codepaths.

In any case, it's clear that we're not supposed to be passing in an
uninitialized structure, since the struct has actual members that are
sometimes interpreted by lower levels. Other callers in
Illumos/OpenSolaris source seem to just pass NULL here if they don't
need any special behavior. So, just pass NULL.

I am not aware of any issues caused by passing in this uninitialized
struct, and browsing Illumos source and discussing the issue with
Oracle engineers suggest there would currently not be any issues with
the cache filesystems we would be using.

However, it's always possible that issues could arise from this in the
future, or there are issues we don't know about. Any such issues would
almost certainly appear to be non-deterministic and be a nightmare to
track down. So just pass NULL, to avoid the potential issues.

Reviewed-on: http://gerrit.openafs.org/11704
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
(cherry picked from commit b9647ac1062509d6a3997ca575ab1542d04677a2)

Change-Id: I5d247cfa6ada3773d20e3938957dcc31c8664bb2
Reviewed-on: http://gerrit.openafs.org/11712
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.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>

9 years agolibafs/LINUX: avoid leaks due to corrupt dir
Jeffrey Hutzelman [Wed, 12 Jun 2013 20:22:36 +0000]
libafs/LINUX: avoid leaks due to corrupt dir

When a corrupt directory is discovered, scanning stops immediately and
readdir returns ENOENT.  Currently, the vcache lock is unlocked and the
dcache containing the directory is released, but that's not enough.
It's also necessary to unlock the dcache, on which we hold a read lock,
and to clear the vcache state which records an in-progress readdir.

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

Change-Id: Id648822cd45087e5c0d320e8cfdcd6659bb33559
Reviewed-on: http://gerrit.openafs.org/11707
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLINUX: Avoid mvid NULL deref in check_bad_parent
Andrew Deason [Mon, 1 Dec 2014 16:23:23 +0000]
LINUX: Avoid mvid NULL deref in check_bad_parent

check_bad_parent dereferences vcp->mvid, assuming it is not NULL (vcp
is a root vcache here, so mvid refers to the parent fid). However, in
some situations, vcp->mvid can be NULL.

When we first afs_GetVCache the fid, we try to set mvid by setting
mvid to the 'dotdot' structure in the volume struct. But we get that
volume struct from afs_GetVolume, which can fail (at the very least,
this can fail on network failure when looking up vldb information). If
it fails, then we do not set the mvid parent. On future lookups for
the fid, afs_GetVCache will return early for a fastpath, if the vcache
is already in memory. So, mvid will never get set in such a situation.

We also set the mvid parent fid in afs_lookup if we resolved a
mountpoint to the root vcache. However, this is skipped if CMValid is
not set on the vcache, so if CMValid is cleared right after resolving
the mountpoint (say, perhaps done by some other thread e.g. a callback
break or other reasons), then the mvid parent fid will not be set.

To avoid crashing in these situations, if vcp->mvid is NULL in
check_bad_parent, don't check the mvid, and assume it does not match
(since we don't know what it is).

This is a 1.6-only change. On the master branch, the problem is
addressed by commit 69e84bd8a2ccc6065c3a06b7239c855207b92e4d .

Change-Id: I3550cf5a01811ede17d74770161326667a6e8628
Reviewed-on: http://gerrit.openafs.org/11616
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoOpenBSD: Add support for OpenBSD 5.4
Antoine Verheijen [Wed, 7 May 2014 20:57:26 +0000]
OpenBSD: Add support for OpenBSD 5.4

Add param header files and other config info to provide
support for OpenBSD 5.4.

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

Change-Id: Ibdde973cf2a542fc89eba025b7210f8b0c843b95
Reviewed-on: http://gerrit.openafs.org/11700
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoLinux 3.19: struct nameidata becomes opaque
Marc Dionne [Mon, 5 Jan 2015 12:17:14 +0000]
Linux 3.19: struct nameidata becomes opaque

With kernel 3.19 struct nameidata becomes opaque.  As a result
we cannot rely on STRUCT_NAMEIDATA_HAS_PATH being true for
new kernels.

Rework the conditions here so that STRUCT_NAMEIDATA_HAS_PATH
is only tested when we're using a nameidata structure and
the result matters.

Also modify a configure test to use a nameidata pointer
instead of an actual structure.

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

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

9 years agoLinux 3.19: Use mgs_iter in struct msghdr
Marc Dionne [Mon, 5 Jan 2015 12:13:37 +0000]
Linux 3.19: Use mgs_iter in struct msghdr

struct msghdr gets msg_iov replaced by msg_iter.  Add a configure
test and adjust the affected code.

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

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

9 years agoLinux 3.19: No more f_dentry
Marc Dionne [Mon, 5 Jan 2015 12:03:16 +0000]
Linux 3.19: No more f_dentry

Back in kernel 2.6 .20 struct file lost its f_dentry field
which was replaced by f_path.To ease transition f_dentry
was defined as f_dpath.dentry in the same header.This
define finally gets removed with kernel 3.19.

Keep using f_dentry in the code, but add a configure test
for the presence of f_path and the absence of the f_dentry
macro so we can add it if its missing.

Change - Id:I8e8a7e4d3ddd861018de50af1eb7315e730ad529

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

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

9 years agoLinux: d_alias becomes d_u.d_alias
Marc Dionne [Thu, 18 Dec 2014 12:13:46 +0000]
Linux: d_alias becomes d_u.d_alias

The fields in struct dentry are re-arranged so that d_alias
shares space wth d_rcu inside the d_u union.  Some references
need to change from d_alias to d_u.d_alias.

The kernel change was introduced for 3.19 but was also backported
to the 3.18 stable series in 3.18.1, so this commit is required
for 3.19 and current 3.18 kernels.

Reviewed-on: http://gerrit.openafs.org/11642
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit d6f29679098aff171e69511823b340ccf28e5c31)

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

9 years agoLinux: Move code to reset the root to afs/LINUX
Marc Dionne [Thu, 18 Dec 2014 11:57:22 +0000]
Linux: Move code to reset the root to afs/LINUX

Move the Linux specific bit of code to reset the root to
afs/LINUX platform specific files.  Things that play with
the Linux vfs internals should not be exposed here.

No functional change, but this helps cleanup some ifdef
mess.

Reviewed-on: http://gerrit.openafs.org/11641
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
(cherry picked from commit 6ca324e565c34d9d04f3c553b7d0febe675ae538)

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

9 years agoafs: Fix some afs_conn overcounts
Andrew Deason [Sun, 14 Sep 2014 19:10:11 +0000]
afs: Fix some afs_conn overcounts

The usual pattern of using afs_Conn looks like this:

  do {
      tc = afs_Conn(...);
      if (tc) {
          code = /* ... */
      } else {
          code = -1;
      }
  } while (afs_Analyze(...));

The afs_Analyze call, amongst other things, puts back the reference to
the connection obtained from afs_Conn. If anything inside the do/while
block exits that block without calling afs_Analyze or afs_PutConn, we
will leak a reference to the conn.

A few places currently do this, by jumping out of the loop with
'goto's. Specifically, in afs_dcache.c and afs_bypasscache.c. These
locations currently leak references to our connection object (and to
the underlying Rx connection object), which can cause problems over
time. Specifically, this can cause a panic when the refcount overflows
and becomes negative, causing a panic message that looks like:

  afs_PutConn: refcount imbalance 0xd34db33f -32768

To avoid this, make sure we afs_PutConn in these cases where we 'goto'
out of the afs_Conn/afs_Analyze loop. Perhaps ideally we should cause
afs_Analyze itself to be called in these situations, but for now just
fix the problem with the least amount of impact possible.

FIXES 131885

Reviewed-on: http://gerrit.openafs.org/11464
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 54c0ee608f4afd2b178c9b60eabfc3564293d996)

Change-Id: Ic02ede4f8177863e8079b4a92c9bad492d6dc97b
Reviewed-on: http://gerrit.openafs.org/11645
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

9 years agoUnix CM: Avoid using stale DV in afs_StoreAllSegments
Marc Dionne [Fri, 19 Dec 2014 15:11:53 +0000]
Unix CM: Avoid using stale DV in afs_StoreAllSegments

It was reported in RT 131976 that on Linux some file
corruption was observed when doing mmap writes to
a file substantially larger than the cache size.

osi_VM_StoreAllSegments drops locks and asks the OS to flush
any dirty pages in the file 's mapping.  This will trigger
calls into our writepage op, and if the number of dirty
cache chunks is too high (as will happen for a file larger
than the cache size), afs_DoPartialWrite will recursively
call afs_StoreAllSegments and some chunks will be written
back to the server.  After potentially doing this several
times, control will return to the original afs_StoreAllSegments.

At that point the data version that was stored before
osi_VM_StoreAllSegments is no longer correct, leading to
possible data corruption.

Triggering this bug requires writing a file larger than the
cache so that partial stores are done, and writing enough
data to exceed the system's maximum dirty ratio and cause
it to initiate writeback.

To fix, just wait until after osi_VM_StoreAllSegments to
look at and store the data version

FIXES 131976

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

Change-Id: I32a2f6f32d432fe4a2e21ebd4bb278a9d7e5499f
Reviewed-on: http://gerrit.openafs.org/11656
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoFix --without-krb5
Andrew Deason [Tue, 26 Apr 2011 19:32:25 +0000]
Fix --without-krb5

Currently, specifying --without-krb5 causes the AM_CONDITIONAL
KRB5_USES_COM_ERR to not be defined, which makes configure refuse to
run successfully. Fix this by forcing KRB5_USES_COM_ERR to always be
false if we are running explicitly without krb5.

Reviewed-on: http://gerrit.openafs.org/4576
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit 9b405a7b082a8498fb6e918df73482ad05e251ea)

Change-Id: I4e706a828e205cf649f09d770986bdfb27f984aa
Reviewed-on: http://gerrit.openafs.org/11636
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>

9 years agoMake OpenAFS 1.6.11pre1 openafs-stable-1_6_11pre1
Stephan Wiesand [Thu, 6 Nov 2014 13:40:17 +0000]
Make OpenAFS 1.6.11pre1

prerelease for 1.6.11

Change-Id: I2c8592ae5aa2d3d7e20283064305ce5b6fc74e60
Reviewed-on: http://gerrit.openafs.org/11593
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoUpdate NEWS for 1.6.11pre1
Stephan Wiesand [Mon, 24 Nov 2014 10:26:04 +0000]
Update NEWS for 1.6.11pre1

Preliminary release notes for OpenAFS 1.6.11

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

9 years agoLinux: Refine openafs-client.service dependencies
Anders Kaseorg [Wed, 3 Sep 2014 22:26:36 +0000]
Linux: Refine openafs-client.service dependencies

Make sure that openafs-client is started after the network is online,
and before services that need remote-fs at startup.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/11441
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit cadaea4f86427c4dc74f56fc66707e8cfb0166cb)

Change-Id: I42aea5dff364e1005808b6ae926f6cf1bf2e0d61
Reviewed-on: http://gerrit.openafs.org/11534
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoAppease compile_et for objdir builds
Benjamin Kaduk [Wed, 27 Aug 2014 16:23:20 +0000]
Appease compile_et for objdir builds

The argument we pass to -p needs to be in the source tree, not
the object tree -- compile_et will not find the input files it
wants in the objdir tree.

For tbudb we can do this as is done on master, by just including
it in the local variable BUDB, but for tptserver and tvlserver
that is a rather invasive change.

This fixes the build with a separate objdir, which was broken by
commit 7c451fab11b65dd5e2860715b939e5de33c7645e.

Change-Id: If90f170ef3777a9987a0ba91747041abb89b2b65
Reviewed-on: http://gerrit.openafs.org/11435
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoBuild fix for recent FreeBSD -current
Benjamin Kaduk [Thu, 30 Oct 2014 23:51:29 +0000]
Build fix for recent FreeBSD -current

r273707 added a flags argument to syscall_register(), so
add the appropriate version check in param.generic_fbsd.h
and ues that in the main code.

Reviewed-on: http://gerrit.openafs.org/11565
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit f39dd54e11dff5e2b4da3eec419ae7c0825c210f)

Note that the 1.6 branch does not have param.generic_fbsd.h, so
the patch was modified for backport to just use AFS_FBSD110_ENV
as the conditional.

Change-Id: Id2934d83940caff4f64c2a7f2187b0eca5881c8f
Reviewed-on: http://gerrit.openafs.org/11610
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoUpdate CellServDB to 20141117 snapshot
Benjamin Kaduk [Wed, 19 Nov 2014 19:14:07 +0000]
Update CellServDB to 20141117 snapshot

This should be all the locations we keep it in-tree.

Reviewed-on: http://gerrit.openafs.org/11607
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit ce0cad182cddd21ccdebbf05a3e2379c7fcbe8fe)

Change-Id: If63c9540beb81485d3e0c2934096f4d0aaee12ad
Reviewed-on: http://gerrit.openafs.org/11608
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoPackaging support for MacOS X 10.10 "Yosemite"
Christer Grafström [Wed, 29 Oct 2014 07:05:06 +0000]
Packaging support for MacOS X 10.10 "Yosemite"

This is just the packaging part of the patch submitted in the
RT ticket. The configuration part is in the preceding change.

FIXES 131946

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

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

9 years agofix whitespace errors in acinclude.m4
Michael Meffie [Sat, 1 Nov 2014 03:45:13 +0000]
fix whitespace errors in acinclude.m4

Use tabs instead of spaces in the sysname lookup case
statement for the macos cases.

Reviewed-on: http://gerrit.openafs.org/11566
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 7ae5b73a90940fe693fd5a726aa31408bd7aec39)

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

9 years agoAdd support for configuration of MacOS 10.10 "Yosemite"
Christer Grafström [Wed, 29 Oct 2014 06:56:35 +0000]
Add support for configuration of MacOS 10.10 "Yosemite"

This is just the configuration part of  the patch submitted
in the RT ticket. The packaging part will will follow in the
next change.

FIXES 131946

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

Change-Id: I5800a89ef06bfad31ee284637fc0685b82e9693f
Reviewed-on: http://gerrit.openafs.org/11571
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLINUX: Avoid check for key_type.match existence
Andrew Deason [Wed, 5 Nov 2014 16:22:00 +0000]
LINUX: Avoid check for key_type.match existence

Commit b5de4a9f removed our key_type 'match' function for kernels that
do not have such a 'match' function pointer. However, this added a
configure test where we are supposed to fail for the "new" behavior,
which is discouraged.

This causes an actual problem, because this test will fail on at least
RHEL5, due to arguably unrelated reasons (the header file for the
relevant struct is in key.h instead of key-type.h). And so, in that
situation we avoid defining a 'match' function callback, meaning our
'match' function callback is NULL, which causes a panic when we try to
actually look up keys for a PAG.

To fix this, transform the 'match' config test into one where we
succeed for the "new" behavior. We do this by testing for the
existence of the new functionality that replaced the old 'match'
function, which is the match_preparse function (specifically, the
'cmp' field in the structure accepted by match_preparse). This should
cause unrelated compilation errors to cause us to revert to the "old"
behavior instead of the "new" behavior. At worst, this should cause
build issues if we get the config test wrong (since we will try to use
the 'match' function definition that does not exist), instead of
panicing at runtime.

Note that while we test for key_type.match_preparse, we don't actually
use that function, since our 'match' functionality is the same as the
default behavior (according to b5de4a9f). So, we can avoid defining
any such function for newer kernels.

Thanks to Stephan Wiesand for bisecting this issue.

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

Change-Id: I59f40258c5ea35a59681f436095922d111e344f6
Reviewed-on: http://gerrit.openafs.org/11595
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLinux 3.18: key_type no longer has a match op
Marc Dionne [Thu, 23 Oct 2014 15:27:55 +0000]
Linux 3.18: key_type no longer has a match op

Structure key_type no longer has a match op, and
overriding the default matching has to be done
differently.

Our current match op doesn't do anything special so there's
no need to try to override the defaults; just remove the
assignment of .match and the associated function.

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

Change-Id: I7baca4a7f02eac45671e1e9ebf48534cdd5830be
Reviewed-on: http://gerrit.openafs.org/11570
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLinux 3.18: d_invalidate can no longer return an error
Marc Dionne [Thu, 23 Oct 2014 15:12:57 +0000]
Linux 3.18: d_invalidate can no longer return an error

d_invalidate is now defined as void and does not have
a return value to check.

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

Change-Id: I8542404771c4a7962238efd9a53d7dfcf4011c96
Reviewed-on: http://gerrit.openafs.org/11569
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLINUX: Avoid d_revalidate failure on mtpt mismatch
Andrew Deason [Tue, 28 Oct 2014 05:10:56 +0000]
LINUX: Avoid d_revalidate failure on mtpt mismatch

Currently, if afs_linux_dentry_revalidate is given an inode that
corresponds to a mtpt vcache ('vcp'), it resolves the mtpt to its root
dir if it's easy to do so (mvid and CMValid are set). Later on, we run
afs_lookup to see if looking up our dentry's name returns the same
vcache that we got; afs_lookup presumably will also resolve the mtpt
if it's easy to do so.

However, it is possible that afs_linux_dentry_revalidate and
afs_lookup will make different decisions as to whether or not they
resolve a mtpt to a dir. Specifically, if CMValid is cleared after
afs_linux_dentry_revalidate checks for it, but before afs_lookup does,
then afs_lookup will return a different vcache than
afs_linux_dentry_revalidate is expecting, even though the relevant
directory entry has not changed. That is, tvc is not equal to vcp, but
tvc could be a mtpt that resolves to vcp, or vice versa. CMValid can
be cleared by another thread at virtually any time, since this is
cleared in some situations when we're not sure if the mtpt resolution
is still valid (callbacks are broken, vldb cache entries expire, etc).

afs_linux_dentry_revalidate interprets this situation to mean that the
directory entry has changed, and so it eventually d_drop's the
associated dentry. The way that this manifests to users is that a
"fakestatted" mtpt can appear to be deleted effectively randomly, even
when nothing has changed. This can be a problem because this causes
the getcwd() syscall to return ENOENT when the working directory
involves such an affected directory.

To fix this situation, we just detect if afs_lookup returned either
'vcp' (our possibly-resolved vcache), or the original inode associated
with the dentry we are revalidating. If the returned vcache matches
either of these, then the entry is okay and we don't need to
invalidate or drop anything.

FIXES 131780

Reviewed-on: http://gerrit.openafs.org/11559
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit ba1cc838ab4a80b7a7787c441a79aca31d84808c)

Change-Id: I3273cc15ebe7fd94f3127840fdc5316bd7458e7c
Reviewed-on: http://gerrit.openafs.org/11568
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLINUX: Check afs_lookup return code explicitly
Andrew Deason [Thu, 24 Jul 2014 16:07:45 +0000]
LINUX: Check afs_lookup return code explicitly

Checking if the returned vcache is NULL or not is a bit of an indirect
way to check if an error occurred. Just check the return code itself,
to make sure we notice if any kind of error is reported.

Suggested by Chas Williams.

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

Change-Id: I7e123ab1cf88570a6b18e438e01409ed7804e014
Reviewed-on: http://gerrit.openafs.org/11558
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLinux 3.17: Deal with d_splice_alias errors
Marc Dionne [Thu, 25 Sep 2014 10:52:12 +0000]
Linux 3.17: Deal with d_splice_alias errors

In 3.17 the logic in d_splice_alias has changed.  Of interest to
us is the fact that it will now return an EIO error if it finds
an existing connected directory for the dentry, where it would
previously have added a new alias for it.  As a result the end
user can get EIO errors when accessing any file in a volume
if the volume was first accessed through a different path (ex:
RO path vs RW path).

This commit just restores the old behaviour, adding the directory
alias manually in the error case, which is what older versions
of d_splice_alias used to do.

Reviewed-on: http://gerrit.openafs.org/11492
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 5815ee92a41cdcf105741d834042a5617dc4c219)

Change-Id: Ie86009ede93255c85fcf640af14c598fe1e42ca9
Reviewed-on: http://gerrit.openafs.org/11550
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoLinux 3.17: No more typedef for ctl_table
Marc Dionne [Tue, 9 Sep 2014 13:39:55 +0000]
Linux 3.17: No more typedef for ctl_table

The typedef has been removed so we need to use the structure
directly.

Note that the API for register_sysctl_table has also changed
with 3.17, but it reverted back to a form that existed
before and the configure tests handle it correctly.

Reviewed-on: http://gerrit.openafs.org/11455
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit 6a23ca5b6e8bcaf881be7a4c50bfba72d001e6cd)

Change-Id: Ifb8fc0b9b01d2578c65407608f0e1b3f3b254459
Reviewed-on: http://gerrit.openafs.org/11549
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoaklog 1.6: make krb5_524 non-fatal for native K5 tokens
Jeffrey Altman [Mon, 13 Oct 2014 21:48:05 +0000]
aklog 1.6: make krb5_524 non-fatal for native K5 tokens

The krb5_524_conv_principal() function should fail whenever the Kerberos
v5 principal cannot safely be mapped onto a Kerberos v4 principal, and
does fail on some Kerberos v5 principals used in real-world AFS
deployments.

Prior to this patchset a failure was treated as a fatal error that
in turn prevents an AFS token from being generated or set into the
cache manager.

Prior to b1f9b4cb5dd295162ae51704310e9d6058008f0a the
krb5_524_conv_principal() function wasn't used and a local client
mapping was created.  b1f9b4cb5dd295162ae51704310e9d6058008f0a
replaced the local mapping with the krb5 function because the local
mapping could be wrong and confusing.

The krb5_524_conv_principal() function as applied to AFS tokens is
just a local guess.  How the username in the token is interpreted by
the AFS server is up to the server.

krb5_524_conv_principal() is only used for Krb5 native tokens. For Krb4
tokens the krb5_524_convert_creds() function is used to obtain both the
Kerberos v4 ticket and the converted names from the KDC.  Many
organizations used the krb524d service to perform name translation.  When
the krb524d service is used, the name translation is performed by the KDC,
so there is no local call to krb5_524_conv_principal() which might fail.
As a result, disallowing the use of a native Krb5 token due to a failed
local name translation is a needless loss of functionality; the local name
translation is not an essential part of obtaining a token.

This patchset modifies the behavior such that krb5_524_conv_principal()
errors are non-fatal.

 1. If -noprdb is not specified the error message is generated
    and a NULL username is used.

 2. If the username is NULL the prdb lookup is disabled.

 3. If the username is NULL the informational messages do not
    include a username.

 4. If the username is NULL the username info provided to the
    cache manager in the token description is the nul string.

This patchset is an openafs-stable-1_6_x specific version of
the patch.  The master version was submitted to

  http://gerrit.openafs.org/#change,11542

Credit to Ben Kaduk for assistance with the wording of this commit
message.

Change-Id: If12ae69394321fa7b7a182c9db95716bc66e489c
Reviewed-on: http://gerrit.openafs.org/11538
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoshlibafsrpc: correct double export in symbol map
D Brashear [Sat, 18 Oct 2014 17:24:46 +0000]
shlibafsrpc: correct double export in symbol map

afs_xdr_pointer was exported twice. remove one.
1.6-only fix.

Change-Id: I55c6663340d0b87331f18b3d120d5184b567f5e1
Reviewed-on: http://gerrit.openafs.org/11551
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoUpdate NEWS for 1.6.10 openafs-stable-1_6_10
Stephan Wiesand [Wed, 8 Oct 2014 14:47:13 +0000]
Update NEWS for 1.6.10

Add the change number of the late aklog fix. Also state that we
support Linux clients up to 3.16 only, since we already know that
3.17 needs a few tweaks, probably to ship with 1.6.10.1 .

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

9 years agoaklog: Fix segfault on aklog -path
Anders Kaseorg [Tue, 30 Sep 2014 17:52:31 +0000]
aklog: Fix segfault on aklog -path

Commit 2fac53522e7ef5b3a376e191bffdc1f6784e6995 “aklog: Fix improper
use of readlink” inadvertently changed the meaning of int link from a
boolean flag (length > 0) to just a length.  This caused ‘aklog -path
(anything)’ to segfault.

Update the type of link and the condition of the while loop to account
for this change.

FIXES 131930

Reviewed-on: http://gerrit.openafs.org/11517
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit fbea3265b3bc042b97be17229839ccf7d11a0bf9)

Change-Id: I6eb0126c574665507be923102c3fa812c3716352
Reviewed-on: http://gerrit.openafs.org/11530
Tested-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoMake OpenAFS 1.6.10
Stephan Wiesand [Wed, 24 Sep 2014 11:48:54 +0000]
Make OpenAFS 1.6.10

Update version strings and NEWS for 1.6.10

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

9 years agoFBSD: adhere to gop_lookupname() semantics
Ben Kaduk [Fri, 18 Jul 2014 19:19:24 +0000]
FBSD: adhere to gop_lookupname() semantics

The current semantics are that gop_lookupname() returns an unlocked
vnode; the previous code was written to a different semantic that
a locked vnode should be returned.

This makes a disk cache more likely to work on FreeBSD, but such
configurations remain not very tested.

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

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

9 years agoviced: time_t might not be long
Garrett Wollman [Wed, 13 Aug 2014 06:32:06 +0000]
viced: time_t might not be long

Fix a couple of printf format errors that bite on FreeBSD 10 for i386.
Since time_t might be an int, it can't be printed with a long format.
Since time_t might be a long in general, cast to it to long when
printing.

Reviewed-on: http://gerrit.openafs.org/11385
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 9dd67783bb2bd9ef8a972a1aac47b1925069a655)

Change-Id: Icda432863a36169857a20300ab936a1a72de7891
Reviewed-on: http://gerrit.openafs.org/11404
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoafsd: correct printf format mismatch in debugging printf
Garrett Wollman [Wed, 13 Aug 2014 06:20:02 +0000]
afsd: correct printf format mismatch in debugging printf

On platforms where size_t is unsigned int, the type of
cacheFiles * sizeof(AFSD_INO_T) is not an unsigned long as the format
string requires.  Casting cacheFiles to unsigned long ensures that the
result is at least unsigned long, although it will still be wrong if
any architecture makes size_t be long long.  Fixes build for FreeBSD
10 on i386.

Reviewed-on: http://gerrit.openafs.org/11384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit f02beb8d644ec2a52bf21737a040321905a39e20)

Change-Id: I1e874f7f049e2fdfdfbe9e6413d421a5e1a5b249
Reviewed-on: http://gerrit.openafs.org/11403
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agopointers are not castable to unsigned int
Benjamin Kaduk [Thu, 6 Feb 2014 21:22:49 +0000]
pointers are not castable to unsigned int

When printing a pointer's value for debugging purposes, use the
dedicated printf format specifier for pointers instead of assuming
that unsigned int ('x') is good enough.

Found by clang on FreeBSD 10.0.

Reviewed-on: http://gerrit.openafs.org/10820
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Perry Ruiter <pruiter@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 758ec15f9391c296f1caa042385148f1a5e0bc84)

Change-Id: Ibe88c38d0563ac125486d0ae7f16882a7989ee98
Reviewed-on: http://gerrit.openafs.org/11402
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoobjdir build: Add objdir include paths
Andrew Deason [Fri, 15 Aug 2014 06:34:03 +0000]
objdir build: Add objdir include paths

In commits ff0644c4cf5a54747bf3af2cc9605163e1debcb7,
3be9a451b523cd955cd5b3e68ee3a44ab083c14f, and
7c451fab11b65dd5e2860715b939e5de33c7645e, some includes were changed
from e.g. <afs/auth.h> to "auth.h". This means that src/auth must be
in the include path for that file. For a file like src/auth/ktc.c,
that's usually fine, since '.' is added to the include path.

However, several of these files are also compiled from different
directories, such as src/libafsauthent. These need to also have the
relevant include path added, or else we cannot include the relevant
file. So, add the needed include paths.

This commit is 1.6-specific. The build system on the master branch
differs greatly, and these files are not build separately in these
directories.

Change-Id: I502b99b9411aff9660b50f0f4d9a4fb4f6a1106a
Reviewed-on: http://gerrit.openafs.org/11392
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoMake OpenAFS 1.6.10pre1 openafs-stable-1_6_10pre1
Stephan Wiesand [Wed, 6 Aug 2014 09:36:41 +0000]
Make OpenAFS 1.6.10pre1

prerelease for 1.6.10

Change-Id: I952c26f1a211fdb3f2055eafce15d93d943e28a5
Reviewed-on: http://gerrit.openafs.org/11354
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agoUpdate NEWS for 1.6.10pre1
Stephan Wiesand [Thu, 31 Jul 2014 14:45:39 +0000]
Update NEWS for 1.6.10pre1

Release notes for OpenAFS 1.6.10

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

9 years agoredhat: package volscan
Stephan Wiesand [Fri, 8 Aug 2014 15:13:09 +0000]
redhat: package volscan

Add volscan and the manual page to the files in the server package.

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

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

9 years agovolscan: fix copyright and licence notice
Michael Meffie [Wed, 6 Aug 2014 19:08:33 +0000]
volscan: fix copyright and licence notice

These are new files and new content; fix the copyright notice and
license to reflect.

Reviewed-on: http://gerrit.openafs.org/11362
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 1283226ccb638be47ead6cc4d9a47381aa6b08d1)

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

9 years agodoc: volscan man page
Michael Meffie [Thu, 13 Mar 2014 16:40:17 +0000]
doc: volscan man page

Provide a man page for the volscan utility

Reviewed-on: http://gerrit.openafs.org/10905
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit a30b98c97d6fbf87018bcb6943e09c1c75a3918d)

Change-Id: I980dd7842bd1c606cb09ee838a584b83d004ccb1
Reviewed-on: http://gerrit.openafs.org/11280
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>

9 years agovol: Fix build with separate objdir
Benjamin Kaduk [Mon, 7 Apr 2014 21:55:09 +0000]
vol: Fix build with separate objdir

The volscan-main and volinfo-main source files are in the source
tree, not the object tree; refer to the objects in the Makefile
as dependencies, so that they will be picked up properly.  The
objects will be made just fine by the implicit .c.o rule.

Reviewed-on: http://gerrit.openafs.org/10988
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 074d745a02d80bfd2c16a4e2b7b4222022f8e641)

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

9 years agovolinfo: separate volscan binary
Michael Meffie [Wed, 12 Mar 2014 19:15:32 +0000]
volinfo: separate volscan binary

Refactor vol-info.c into several files and change the makefile to
build a separate volscan binary, instead of using the program name
to determine if the user is running volinfo or volscan.

This commit adds new source files for the volinfo and volscan main()
function and a common header file.

Reviewed-on: http://gerrit.openafs.org/10903
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>
(cherry picked from commit af2e3d81cff39ed06e3bfbfcbfff52163c503c54)

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