Commit Graph

573 Commits

Author SHA1 Message Date
Anders Kaseorg
a5b091e1ec 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.

Change-Id: I56e0e88eb178573c3eb280d5a5a01d8b8a20a363
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>
2015-02-24 19:27:32 -05:00
Marc Dionne
15260c7fdc 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]

Change-Id: Id1786ac2227b4d8e0ae801fe59c15a0ecd975bed
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>
2015-01-22 10:39:59 -05:00
Marc Dionne
ec9a7c2db8 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.

Change-Id: I9b9e3987e55a10e48087b318d98a5a7bb17a4612
Reviewed-on: http://gerrit.openafs.org/11647
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-01-08 06:43:33 -05:00
Marc Dionne
f9ca302b7a 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

Change-Id: I4b05aa3d37f01e0e675c420cbf941d682c49c69c
Reviewed-on: http://gerrit.openafs.org/11646
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2015-01-08 06:43:22 -05:00
Marc Dionne
d6f2967909 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.

Change-Id: I711a5a3a89af6e0055381dfd4474ddca2868bb9c
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>
2015-01-08 06:43:12 -05:00
Chas Williams (CONTRACTOR)
00a33b26d7 uss: always build uss
Revert change Ibab1dd189e7fbc41ca01e7ef7479421c056999f5 since uss
should always be safe to build now that its parser symbols are private.

Change-Id: I65fd2008b037dd36a2c7d3ef8817d4d7dda689d7
Reviewed-on: http://gerrit.openafs.org/11653
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Daria Brashear <shadow@your-file-system.com>
2015-01-07 12:37:41 -05:00
Nathaniel Wesley Filardo
c11c58646f Linux: get sysname even if kernel module disabled
Fall back to `uname -r` if we aren't probing for kernel sources,
as we still need to know for the rest of the build.  While this
could be worked around by explicitly passing the sysname as an
argument, this seems friendlier.

Change-Id: I0db75ba5fc7d1f5ec08d27dfce6858b968b6ce28
Reviewed-on: http://gerrit.openafs.org/11552
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2015-01-04 21:24:13 -05:00
Sami Kerola
a4dc1d8fc0 build-sys: make docbook path find easier to read
Additional gain, when horizontal lists are converted to vertical, is that
each item will be individually version controlled.

Change-Id: I4f12efac9c3d828fafdc7ab8a15740cfb0276538
Reviewed-on: http://gerrit.openafs.org/10014
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-04 18:54:36 -05:00
Sami Kerola
654f9e4ad4 build-sys: reindent AC_ARG_WITH section in acinclude.m4
Change-Id: I80b68eeecf9f72ac7f2ce133d9a5642a67dde22c
Reviewed-on: http://gerrit.openafs.org/10013
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-04 17:33:02 -05:00
Sami Kerola
aea3c2a327 build-sys: fix indentation in test code
Change-Id: If2c0c2a0b0b01bb425f8c1658cef9df232844b1c
Reviewed-on: http://gerrit.openafs.org/10012
Reviewed-by: D Brashear <shadow@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2014-12-01 18:43:48 -05:00
Sami Kerola
7d689390a8 build-sys: fix m4 quotation to make upstream autotools to work
Macro arguments for AC_ARG_WITH, such as AC_CHECK_PROGS, need to be
quoted.  Unless they are the latest version of autoconf will expand
macros slightly wrong way making the configure to fail at line where
there are only two ticks.

$ ./regen.sh
[...]
$ automake -a -f
[...]
automake: error: no 'Makefile.am' found for any configure output
$ ./configure
[...]
checking pkg-config is at least version 0.9.0... yes
./configure: line 13348: syntax error near unexpected token `newline'
./configure: line 13348: `    '''

Notice that the 'automake' run is needed in order to avoid later
configure error, which would look something like.

configure: error: cannot find install-sh, install.sh, or shtool in build-tools "."/build-tools

Change-Id: I39476270f351d2f5b332c5c945d6ac67fe16dd82
Reviewed-on: http://gerrit.openafs.org/9995
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2014-12-01 18:42:41 -05:00
Michael Meffie
7ae5b73a90 fix whitespace errors in acinclude.m4
Use tabs instead of spaces in the sysname lookup case
statement for the macos cases.

Change-Id: Iee03d1b593aee4f6c4bc2488b069b21e116c9f1d
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>
2014-11-06 13:26:20 -05:00
Andrew Deason
a9a3cb2eff 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.

Change-Id: If6f93d6b5340fa738a55adeb7778d26ff5dbacc1
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>
2014-11-06 13:25:49 -05:00
Michael Meffie
86cdf6daa7 roken: configure checks for inet_ntop and inet_pton
Change-Id: Idf2eee040235bbf1f34ed993c74dd5936ae063c6
Reviewed-on: http://gerrit.openafs.org/11584
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-11-05 08:23:54 -05:00
Marc Dionne
b5de4a9f42 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.

Change-Id: I0ee195e47f40688d9a71ea62a0b87a4265363f05
Reviewed-on: http://gerrit.openafs.org/11563
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-10-31 08:38:02 -04:00
Marc Dionne
a42f01d5eb 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.

Change-Id: Ief1b562db63877dde9f4a8ac4918b727a05b23bb
Reviewed-on: http://gerrit.openafs.org/11562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-10-31 08:37:48 -04:00
Christer Grafström
4109785a89 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

Change-Id: Ic8835b1ddf317600483505a2d94d9f3568720804
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>
2014-10-29 14:19:32 -04:00
Benjamin Kaduk
89febdba40 Warn at configure time about bitmap-later
It's superseded by DAFS and is slated for removal post-1.8.

Change-Id: Id2c870fb76eeb470bbf393e99654df434b1a1a86
Reviewed-on: http://gerrit.openafs.org/11525
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>
2014-10-15 11:05:35 -04:00
Benjamin Kaduk
f7ddab6606 Merge pam into the kauth configure option
Realistically, you shouldn't be using either kauth or pam.  The
pam functionality provided by the module in our tree is only
useful in a kaserver-style environment, so it makes sense to merge
the two knobs.

Retain a separate enable_pam variable so that it can be overridden
on a per-architecture basis where it is known to not work.  Consolidate
the two places where we did such checks, as well.

Change-Id: I6bf39ee5002f943548c51d089fe612f7e2f0501b
Reviewed-on: http://gerrit.openafs.org/11524
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>
2014-10-15 11:05:21 -04:00
Benjamin Kaduk
27cb0d3888 Adjust configure defaults for 1.8
Disable pam; enable pthreaded ubik.
(Pam is actually not installed by default anyway, since it is
functionally part of kauth.)

pthreaded ubik is believed to be stable, and we want to move away
from LWP moving forward.

Change-Id: I14d20e3157df625a9e04059534bbb59268384213
Reviewed-on: http://gerrit.openafs.org/11483
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>
2014-10-08 10:55:07 -04:00
Benjamin Kaduk
a6d7014187 Allow external hcrypto
Put the configure checks into a separate file in src/cf, following
the same general structure as the roken checks.

Allow explicitly requesting the internal version, or checking
what's in the default paths, or providing a specific hcrypto root
or lib/include dirs for Debian compatibility.

We must still always compile libafshcrypto_lwp.a for use by LWP
binaries, from the bundled sources, but other binaries will use
the system version.

The hcrypto headers have an unfortunately large number of dependencies,
including depending on being able to find each other by including
<hcrypto/foo.h> paths.  As such we must pass both the user-supplied
directory and $dir/hcrypto to the preprocessor in order for things
to work, and we also may need to revisit the includes used in the
configure check for use on non-linux systems due to the dependencies
on system headers.

Change-Id: Idcba1418a19a7b562335524c911d69dc84268177
Reviewed-on: http://gerrit.openafs.org/11481
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
Tested-by: D Brashear <shadow@your-file-system.com>
2014-10-08 10:54:40 -04:00
Chas Williams (CONTRACTOR)
eb5102e998 config: Refactor the FreeBSD configuration files
Use a common file for most of the platform specific settings.

Change-Id: If95ad44de99fc3320570d53d706fed4d760fe67d
Reviewed-on: http://gerrit.openafs.org/11346
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-08-06 10:18:39 -04:00
Marc Dionne
a303bb257e Linux 3.16: Convert to new write_iter/read_iter ops
Change read/write operations to the new write_iter/read_iter
operations.

Change-Id: Ia58e5f90182f3968d1a81cfc2f831e7a9cf35d93
Reviewed-on: http://gerrit.openafs.org/11303
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-06-25 10:24:03 -04:00
Marc Dionne
e284db57f9 Linux 3.16: Switch to iter_file_splice_write
Users of generic_file_splice_write need to switch to
using iter_file_splice_write.

Change-Id: If4801d27e030e1cb986f483cf437a2cfa7398eb3
Reviewed-on: http://gerrit.openafs.org/11302
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-06-25 10:23:19 -04:00
Michael Meffie
e2f666fe81 roken: configure checks for getaddrinfo and friends
Change-Id: Icb2ace89332024668c9dc4326b967a1015afc1e9
Reviewed-on: http://gerrit.openafs.org/11199
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-06-05 07:19:29 -04:00
Michael Meffie
1141d120a5 doxygen: make dox
Add an optional make target (make dox) and doxygen configuration to
generate doxygen output files.  Auto-detect when the doxygen and
graphviz dot tools are available.  When dot is present, configure
doxygen to create dependency graphs.

Since the graph generation can take a very long time, a new
configure option has been added to override the dot tool
auto-detection. To disable the graph generation (even if dot is
installed), run configure with the option: --without-dot

When graph generation is desired, but graphviz dot is not present in
the PATH, specify the path to dot with the configure option
--with-dot=<path-to-dot>.

The configure summary has been updated to show when doxygen document
and graph generation is configured.

Thank you Jason Edgecombe for providing the doxygen configuration
for OpenAFS.

Change-Id: Ie875fc2961877ee76e4c17631bbb95c29ef20b9e
Reviewed-on: http://gerrit.openafs.org/10970
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-05-28 10:08:16 -04:00
Michael Meffie
8050a005a3 configure: fix comment about unix variants
Remove vulgar comment, and remove commented out checks for
aix and minix.

Change-Id: I1ee6948bab3185a7855f1d9dc0e9557e27d4e1d2
Reviewed-on: http://gerrit.openafs.org/10969
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: D Brashear <shadow@your-file-system.com>
2014-05-28 10:07:58 -04:00
Antoine Verheijen
e1d0342326 OpenBSD: Add support for OpenBSD 5.4
Add param header files and other config info to provide
support for OpenBSD 5.4.

Change-Id: I56d2e716bd7fa4dee699f8d190cb4b60bb0f67a8
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>
2014-05-21 07:06:10 -04:00
Benjamin Kaduk
db00a2c8b5 Disable kauth by default
We should actively be discouraging the use of the kaserver and related
utilities.

The src/kauth/ directory will still be compiled, just not installed.
(If we stopped compiling it, it would likely bitrot very quickly so
as to become unbuildable, and having it still build seems a reasonable
goal given our obligations with respect to compatibility with IBM
AFS for the use of the AFS name.)

Change-Id: Ib710af3e177223d85cd9c6099ce75e700b6a2958
Reviewed-on: http://gerrit.openafs.org/10962
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2014-03-28 17:47:14 -07:00
Benjamin Kaduk
5c4e555f93 Add a routine to get the size of the current process
Use rusage when available, and fall back to the very old sbrk(0)
hack otherwise.

Change-Id: Ic986fd6b93476b80008908a95f8b8e0c76d9ed9a
Reviewed-on: http://gerrit.openafs.org/10695
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2014-01-17 10:38:14 -08:00
Andrew Deason
e988aa45d7 LINUX: Use sock_create_kern where available
Currently, we use sock_create to create our Rx socket. This means that
accesses to that socket (sendmsg, recvmsg) are subject to SELinux
restrictions. For all recvmsg accesses and some sendmsg accesses, this
doesn't matter, since the access will be performed by one of our
kernel threads (running as kernel_t or something similar, which is
unrestricted). Such as: the rx listener, a background daemon, the rx
event thread, etc.

However, sometimes we do run in the context of a normal user process.
For some RPCs like FetchStatus, we tend to run the RPC in the
accessing user thread, which can result in us sendmsg()ing the data
packets with the initial arguments in the user thread. We can also
send delayed ACKs via rx_EndCall, and possibly a variety of other
scenarios.

In any of these situations when we are sendmsg()ing from a user
thread, SELinux can prevent us from sending to the socket, if the
calling user thread context is not able to write to an afs_t
udp_socket. This will result in packets not being sent immediately,
but the packets will be resent later, so access will work, but appear
very slow. This can easily happen for processes that are specifically
constrained by SELinux; for example, webservers are often constrained,
even if most of the rest of the system is not. This can be noticed by
seeing the 'resends' and 'sendFailed' counters rising in 'rxdebug
-rxstat', as well as noticing SELinux access failures if 'dontaudit'
rules are ignored.

To avoid this, use sock_create_kern to create the Rx socket, to
indicate that this is a socket for use by kernel code, and not
accessible by a user. This should cause us to bypass any LSM
restrictions (SELinux, AppArmor, etc). Add a configure check for this,
since this function has not always existed, according to
<https://lists.openafs.org/pipermail/openafs-devel/2004-June/010651.html>

Change-Id: I77e7f87e93be4d750d398e01dc1634efd80657bc
Reviewed-on: http://gerrit.openafs.org/10594
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-12-18 07:35:17 -08:00
Jeff Layton
d40ed73916 Linux: stop trying to use getname/putname
The current code has afs_putname defined as

    kmem_cache_free (names_cachep, (void *) name);

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

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

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

Change-Id: I1cd58a7e528abfeb7473cf47ae4cff5b8c8f419c
Reviewed-on: http://gerrit.openafs.org/10547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-12-11 07:36:30 -08:00
Ken Hornstein
aac384b2ed Add support for configuration of MacOS 10.9 "Mavericks".
Based on work originally done by Matt Haught <dmhaught@ncsu.edu>

Change-Id: I331cfc0040fab526c32e24f6af970f352f0a0a8e
Reviewed-on: http://gerrit.openafs.org/10538
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-12-05 13:12:25 -08:00
Anders Kaseorg
d0a13fe678 Linux: Get rid of !STRUCT_KEY_UID_IS_KUID_T case
On the few kernel versions before struct key.uid was converted to
kuid_t (v3.7-rc1~147^2~76), it was not possible to enable both
CONFIG_KEYS and CONFIG_UIDGID_STRICT_TYPE_CHECKS, so this case was
impossible.  That’s good, because it also had a typo in its
implementation (and was confusing to deal with correctly).

Change-Id: I4ecd164ed3604558ed4419bf6f9d531bd5d1a9ff
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10443
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-11-13 07:55:11 -08:00
Michael Meffie
9f6f419b9a build: more configure summary
Improved configure summary, including a check for namei fileserver mode.

Change-Id: Id5117ae8c27126c56e28eb3ab7f6e8ef7fd0558d
Reviewed-on: http://gerrit.openafs.org/10372
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-11-10 06:13:11 -08:00
Anders Kaseorg
b7f4f2023b Linux: Fix build with CONFIG_UIDGID_STRICT_TYPE_CHECKS (user namespaces)
With CONFIG_UIDGID_STRICT_TYPE_CHECKS (a dependency of user namespace
support, CONFIG_USER_NS) turned on, uid_t and kuid_t are different
types, as are gid_t and kgid_t, and we need to use namespace-dependent
functions to convert between them.

We can’t use init_user_ns as the namespace because it’s GPL-only, so
instead we grab the current user_ns at module load time.

This is required to support kernels with user namespace support.  We
don’t yet have full support for independent AFS use by different users
in a multiuser container; that will need to wait for future work.

Change-Id: Icc03f9098dd25b483d406db5167264ba960cdcb7
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/10386
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-11-05 11:44:55 -08:00
Andrew Deason
8e32b11be6 Probe directly for com_err.h
com_err.h can be in com_err.h, et/com_err.h, or krb5/com_err.h (for
netbsd 6.1 and possibly other netbsd). aklog currently only includes
either com_err.h or et/com_err.h, depending on autoconf probes
performed by the krb5.m4 macros.

So, also look for krb5/com_err.h. The krb5.m4 macros currently only
look for com_err.h at all if certain other libkrb5 tests return
certain results, so just look for all of them directly in some of our
openafs-specific krb5 probing logic in configure.ac.

Also remove the duplicate check for et/com_err.h in acinclude.m4 while
we're here. We only use et/com_err.h if krb5 support is enabled, so
only check for it in the second of krb5 probes.

FIXES 131716

Change-Id: Ic454b9bf7043f91654dcd1c262ab3790bf2ad272
Reviewed-on: http://gerrit.openafs.org/10244
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-09-25 10:25:52 -07:00
Jonathan A. Kollasch
f785b7f662 Add config glue for amd64_nbsd70 and i386_nbsd70 sysnames
Change-Id: I2d0b6848f96aab8d68a41fb6d5892284fca987ad
Reviewed-on: http://gerrit.openafs.org/10257
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-09-18 18:44:37 -07:00
Derrick Brashear
13165c0583 linux: core dump requires write fop
turns out not just writev is unhappy with aio_write (only); core dumping
wants a write file op. always provide it.

FIXES 131729

Change-Id: If099f83973825981b4c568db7572bf30d399c089
Reviewed-on: http://gerrit.openafs.org/10251
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-09-13 10:00:07 -07:00
Christof Hanke
9db8b123e4 LINUX: Keyring deal with suse-specific key_type op
instantiate_prep used for checking for
STRUCT_KEY_TYPE_HAS_PREPARSE

Change-Id: Ia7411e85467ba418dfefa5cd7c2d570fe20a5a68
Reviewed-on: http://gerrit.openafs.org/10194
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-09-13 06:10:16 -07:00
Derrick Brashear
e6af2ffc86 linux: provide read and write ops even when we have aio
read/write will fall back to aio ops but e.g. writev will
fail if there is not either a write or writev op explicitly.

force the fallback via do_sync_read/do_sync_write

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

Change-Id: I773a8e38df435015e4bc9fc353d930d14b3e6791
Reviewed-on: http://gerrit.openafs.org/10246
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: Derrick Brashear <shadow@your-file-system.com>
2013-09-12 08:27:24 -07:00
Marc Dionne
1f577e41b6 Linux 3.11: Adapt to d_count changes
In preparation for upcoming changes in the 3.12 cycle, d_lockref
was introduced late in the 3.11 cycle.  The dentry's d_lock and
d_count are moved to this new structure.  A new d_lock macro makes
the change transparent for locking, but direct users of d_count
must adapt.  A new d_count() helper function is provided and
should now be used.

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

Change-Id: I32a21a174d763fb7df8f1e04da3bb7260684571d
Reviewed-on: http://gerrit.openafs.org/10219
Tested-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
2013-09-09 13:59:51 -07:00
Marc Dionne
902b8809f0 Linux 3.11: Convert from readdir to iterate file operation
Convert the readdir function so that it can be used as the new
"iterate" file operation.  This new operation is passed a context
that contains a pointer to the filldir function and the offset.
The context is passed into the new dir_emit function that will
call the function specified by the context.

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

Change-Id: I6b01b4c78a501bdf4f8d583b0d3b94d677c5d541
Reviewed-on: http://gerrit.openafs.org/10051
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-07-12 07:59:23 -07:00
Marc Dionne
9b24013426 Linux 3.10: Replace create_proc_entry() with proc_create()
Add an afs_proc_create() compat function that uses the
appropriate kernel function based on a configure test.

Change-Id: I4f3929849af032f2a483bc06bc5769f64085f1c4
Reviewed-on: http://gerrit.openafs.org/9854
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-05-28 07:15:06 -07:00
Marc Dionne
9cfd7f768c Linux 3.9: hlist iterator change
hlist iterators have been reworked to not require a temporary
node parameter.

Change-Id: Ibea1295163bd39ff2901a2194aa46c3d342f5128
Reviewed-on: http://gerrit.openafs.org/9403
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-03-20 08:12:51 -07:00
Antoine Verheijen
20a54b0252 OpenBSD: Add config headers for new(er) OS versions.
The OS-specific config header files have not kept up with the
newer releases of OpenBSD. This patch corrects that by adding
header files for OpenBSD versions from 4.9 to 5.3 (the newest
version currently under development).

Change-Id: I5e233cc7b96be2c1c52824653c42d3c6d77d6f50
Reviewed-on: http://gerrit.openafs.org/8927
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2013-02-05 05:49:28 -08:00
Andrew Deason
1b63689b99 SOLARIS: Use vn_renamepath as early as possible
Commit 6c509601 uses the vn_renamepath when we are building on Solaris
11. However, some recent patch level of Solaris 10 (more recent than
stock 10u10) has the same problem fixed by that commit, where
vn_setpath takes an additional argument. So instead, just test for the
existence of vn_renamepath itself, so we also use it on Solaris 10
when we can.

Thanks to Rich Sudlow for reporting this.

Change-Id: Ic1c0437d2438c6e19b8fff8278ecda9b96bd020b
Reviewed-on: http://gerrit.openafs.org/8920
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-23 11:33:22 -08:00
Marc Dionne
d0479bbaf4 Linux 3.8: vmtruncate removal
vmtruncate had been deprecated for a while and has now been
removed.  Do things the new way based on truncate_setsize.

Change-Id: If584329f7330f44be3909e4c8b935e4fe5e2b536
Reviewed-on: http://gerrit.openafs.org/8906
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:30:03 -08:00
Marc Dionne
c6d27e322a Linux 3.8: session_keyring changes
The session_keyring is now attached directly to the cred structure
and the thread_group_cred structure (cred->tgcred) no longer exists.

Adapt code that makes use of tgcred, and use the standard rcu based
mechanism to update session_keyring.

Change-Id: If4b88cbc7f9af6343353648837b28541a5088429
Reviewed-on: http://gerrit.openafs.org/8905
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-21 04:29:15 -08:00
Andrew Deason
81dd4878e7 SOLARIS: Look for ncurses in ncurses/ncurses.h
Solaris 11+ has ncurses.h in ncurses/ncurses.h. Look for it there.

Without this, on Solaris 11.1 we will detect libncurses automatically
(because it lives in /usr/lib), but not ncurses.h (since it is in
ncurses/ncurses.h, not ncurses.h). So, we will fall back to curses.h,
but will try to link to libncurses, which, as you might guess, fails
with various undefined symbols.

Change-Id: Ia174e2a3c97318d6db2a48a6098569aede93522c
Reviewed-on: http://gerrit.openafs.org/8874
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2013-01-05 06:28:22 -08:00
Ben Kaduk
5afe7a882b Add configure option to not install kauth
Per http://www.openafs.org/pages/no-more-des.html the kaserver
suite of utilities is deprecated and is not supposed to be built
anymore in this post-1.6 world.
Not building them at all requires some effort, but not installing
them is pretty easy.  Do the easy part for now, and leave the hard
parts for a follow-up commit.

Change-Id: I1c400a7398b8708e7c9dc6613cd183b9b67e7a7f
Reviewed-on: http://gerrit.openafs.org/8457
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-12-26 13:48:44 -08:00
Michael Laß
986a854151 Update configure help msg to match actual defaults
The defaults for LINUX_KERNEL_PATH and LINUX_KERNEL_BUILD in
acinclude.m4 were changed in 2cfd611, 94ff565 and 3f9d982 without updating
the output of ./configure --help. Change the description of
linux-kernel-headers and linux-kernel-build to show the correct defaults.

Change-Id: I41331f4d48a555e291a45ca56e788bc418c064d3
Reviewed-on: http://gerrit.openafs.org/8759
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-12-18 17:32:18 -08:00
Stephan Wiesand
3f9d982ec2 Linux: Restructure kernel header detection
As of kernel 3.7, version.h has moved, and hence utsrelease.h was
no longer found. Loop over candidate directories and locations
within, and look for the files we're actually after.

FIXES 131525

Change-Id: I686212a283b9e0ce769b1351e3cb75e08f4b110c
Reviewed-on: http://gerrit.openafs.org/8761
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-12-18 12:32:11 -08:00
Marc Dionne
aeb2763b74 Linux 3.7: key instantiate API change
Adapt to the new parameters for the instantiate key operation.

Change-Id: I25dea3489b68cad662e962a4973ee98ec7228cd3
Reviewed-on: http://gerrit.openafs.org/8470
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Hans-Werner Paulsen <hans@MPA-Garching.MPG.DE>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-11-19 04:22:11 -08:00
Marc Dionne
2bafb2f99d Linux: change test for new putname API
Replace the existing test with a more robust one that checks for
the existence of the new filename structure.  Since older kernels
are expected to fail this test, we'll get the correct result even
if there is unrelated failure, for instance a missing/different
header file.

Change-Id: Ie50abce37580eab803e9b07e636a1538f4a91a81
Reviewed-on: http://gerrit.openafs.org/8466
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-11-19 04:21:52 -08:00
Derrick Brashear
7fe30bd28e configure: check for poll()
if we have code which uses HAVE_POLL, check for poll().

Change-Id: I1baf61541b243f82b3acca112db2cbbca813182b
Reviewed-on: http://gerrit.openafs.org/8357
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-11-01 20:24:52 -07:00
Simon Wilkinson
3898f4d205 Fix mutex assertion
RX mutexes have two mechanisms for asserting ownership of a mutex:
MUTEX_ISMINE, which returns true if the caller is the owner of the
mutex in question, and osirx_AssertMutex which fires an assertion if
the calling thread doesn't own a specified mutex.

Neither of these work with pthread mutexes on all platforms, and the
kernel support for MUTEX_ISMINE is dubious in places. Because in some
implementations, MUTEX_ISMINE tries to lock the mutex in question, a
failing call to MUTEX_ISMINE can lead to the process holding an
additional, unexpected, lock.

This patch reworks all of this, and uses the new opr mutex framework
so that we can do mutex assertions in userspace, too. We remove the
unsafe MUTEX_ISMINE macro, and replace it with MUTEX_ASSERT which
simply asserts if the specified mutex is not held by the current
thread. osirx_AssertMutex is removed as it is now redundant.
MUTEX_ASSERT will always work in kernel code.

For userspace, we provide opr_mutex_assert, which is implemented using
POSIX error checking mutexes. As error checking mutexes have a runtime
overhead, this is only available when configured with
--enable-debug-locks, the rest of the time calls to opr_mutex_assert are
no-ops.

Change-Id: I285ee2b558389fa3d63b786e4bc4420fa2126c80
Reviewed-on: http://gerrit.openafs.org/8282
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-30 04:59:07 -07:00
Marc Dionne
fa3116567e Linux 3.7: putname is no longer exported
putname is unexported in kernel 3.7.  Add a compatibility inline
afs_putname function and open code it if necessary.

Change-Id: I5416067566f6332d77e5d91ce2b9cf7bc0c96dce
Reviewed-on: http://gerrit.openafs.org/8237
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-18 00:53:15 -07:00
Derrick Brashear
a28b5e645a configure: make use of native build assist tools possible
provide a way to run native rxgen, config and compile_et

Change-Id: I9d1a2b4a1d4100fdc4a042005586e8fc40f39f7b
Reviewed-on: http://gerrit.openafs.org/8199
Tested-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-10-03 07:38:06 -07:00
Ben Kaduk
c4c51444eb FreeBSD major version numbers are multi-character
Do not assume that there is only a single character before the dot.

Change-Id: I45169a6faa5dbeafc4f9c57deaaad96bef8de613
Reviewed-on: http://gerrit.openafs.org/8106
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
2012-09-14 04:53:33 -07:00
Andrew Deason
e5ba359f64 LINUX: Detect non-vectorized aio functions
In kernels before 027445c3, the functions generic_file_aio_read and
generic_file_aio_write, as well as the fs operations aio_read and
aio_write, do not deal with iovecs but rather just use a single
buffer. Detect this, so our aio_read and aio_write implementations
have the correct signatures.

This removes several warnings on such kernels.

Change-Id: I70aa0d43bac5545d83710806b58f36d13d7f6cc8
Reviewed-on: http://gerrit.openafs.org/8020
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-30 09:03:09 -07:00
Andrew Deason
74c1881dff LINUX: Use struct vfs_path on RHEL5
Some revisions of the kernel from RHEL5 (2.6.18-308.* and possibly
others) renamed 'struct path' to 'struct vfs_path'. So, use
'struct vfs_path' when it exists.

This introduces the afs_linux_path_t typedef, which is defined as
either a struct path, or struct vfs_path.

Change-Id: I88c31125dbc1ab2998a521e3c57ed532bf2d5bb7
Reviewed-on: http://gerrit.openafs.org/8019
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-30 09:01:37 -07:00
Marc Dionne
ec48dca871 Linux 3.6: lookup inode operation API change
The nameidata argument is replaced with an unsigned int flags
argument.

Change-Id: Ife07bb50ae7d747bd6256ea8238c4e19dbb5ee3f
Reviewed-on: http://gerrit.openafs.org/7987
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-17 11:15:41 -07:00
Marc Dionne
7413cd09a5 Linux 3.6: revalidate dentry op API change
The nameidata argument is dropped, replaced by an unsigned flags
value.  The configure test is very specific; kernels with the
older API with a signed int flags value should fall through.

Change-Id: I5939b089b023fe81e3824ac3f920c4b6a261d39a
Reviewed-on: http://gerrit.openafs.org/7986
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-17 11:15:21 -07:00
Marc Dionne
020e32779c Linux 3.6: create inode operation API change
The nameidata argument is dropped and a flag is added.

Change-Id: I33692fc506e7eb9b8935a27ff3d10b713dfa6e5e
Reviewed-on: http://gerrit.openafs.org/7985
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-17 11:14:54 -07:00
Marc Dionne
6bea047fb4 Linux 3.6: d_alias and i_dentry are now hlists
The d_alias pointer is now the head of an hlist.  This means the
iterator is a different macro and has no "reverse" version since
hlists have no direct pointer to the list tail.

inode->i_dentry gets the same treatment.  Adjust where we use it.

Change-Id: Ibcdd8ab6f8a571a8f94c646949ebe0503f075574
Reviewed-on: http://gerrit.openafs.org/7983
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-17 11:14:02 -07:00
Marc Dionne
8766a65e97 Linux 3.6: dentry_open API change
dentry_open now takes a path argument that combines the dentry and
the vfsmount pointers.
Add a configure test and a new compat inline function to keep things
cleaner in the main source file.

Change-Id: Ia29422d60d438cf4c795840566d4610649aa1f10
Reviewed-on: http://gerrit.openafs.org/7982
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-16 22:29:37 -07:00
Marc Dionne
049c485b4a Linux 3.6: kmap_atomic API change
kmap_atomic no longer requires a KM_TYPE argument.  Test for this
and adjust the affected code.

Change-Id: I3a9e0018124d40be51cc509ac00d9250a5e8e76d
Reviewed-on: http://gerrit.openafs.org/7981
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-16 22:28:52 -07:00
Simon Wilkinson
6f6bfb31ac opr: Add UUID handling functions
Add a set of functions to the opr library to handle creating and
manipulating UUIDs.

The opr_uuid_t type is held as a 16 octet character string, which
comprises the UUID encoded into network byte order. This is the
primary form for manipulating UUIDs with this library, as it avoids
any nbo/hbo problems.

For applications which require raw access to the UUID components,
the opr_uuid_unpacked structure is provided, and
opr_uuid_pack/opr_uuid_unpack can be used to convert to and from
this format.

Finally, functions to print the UUID as a string, and parse a UUID
from a string, are provided. When printing, we use the standard UUID
format of 000000-0000-0000-0000-00000000. However, the afsUUID library
used to print UUIDs as 000000-0000-0000-00-00-00000000, so we also
accept this format.

Change-Id: I78ef79b7ab8ae15fb955c6495118722875c94f8d
Reviewed-on: http://gerrit.openafs.org/7977
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-14 12:53:08 -07:00
Tom Keiser
b440d8ffcb libafs: use kthread_run when available
Use the kthread_run interface on linux to create kernel
threads.  This interface allows all the cpus to schedule
afsd threads, instead of just inheriting the cpu affinity of
the main afsd thread.

Written by Tom Keiser.

Change-Id: I69eb852d168bd85e9aa7ec075013c0346207dbcf
Reviewed-on: http://gerrit.openafs.org/7915
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-08-14 06:21:00 -07:00
Andrew Deason
403f72ec76 rx: Create AFS_ADAPT_PMTU and AFS_RXERRQ_ENV
Currently we have the ADAPT_PMTU define, which turns on functionality
in Linux to detect PMTU-related ICMP errors for Rx. However, this is
really turning on two separate pieces of functionality: the PMTU
processing, and the processing for ICMP errors in general.

So split this out into two defines: AFS_ADAPT_PMTU, and
AFS_RXERRQ_ENV. The former is for processing PMTU discovery, and the
latter is for processing ICMP errors. Both of these are left disabled
due to issues in the error processing. Although PMTU discovery is the
only functionality which makes use of ICMP errors, this will change in
the future.

Change-Id: Ia334c68ce5eb3fa01c01a8a1c52a0e0a2e41b2c0
Reviewed-on: http://gerrit.openafs.org/7925
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-08-09 08:03:53 -07:00
Andrew Deason
de381aa0d3 Linux: Make dir dentry aliases act like symlinks
Currently, we try to invalidate other dentries that exist for a
particular dir inode when we look up a dentry. This is so we try to
avoid duplicate dentries for a directory, which Linux does not like
(you cannot have hardlinks to a dir).

If we cannot invalidate the other aliases (because they are being
used), right now we just return the alias. This can make it very easy
to panic the client, due to the sanity checks Linux performs when dong
things like 'rmdir'. If we do something like this:

mkdir dir1
fs mkm dir1/mtpt vol
mkdir dir1/mtpt/dir2
fs mkm dir1/mtpt/dir2/mtpt2 vol
cd dir1/mtpt
rmdir dir2/mtpt2

For the 'rmdir', we will lookup 'mtpt2'. Since 'mtpt' and 'mtpt2'
are mountpoints for the same volume, their dentries point to the same
directory inode. So when we lookup 'mtpt2', we will try to invalidate
the other dentry, but we cannot do that since it is the cwd. So we
return the alias dentry (for 'mtpt'). The Linux VFS layer then does a
sanity check for the rmdir operation, checking that the child dentry's
parent inode is the same as the inode we're performing the rmdir for.
Since the dentry we returned was for 'mtpt', whose parent is 'dir1',
and the actual dir we're performing the rmdir for is 'dir2', this
sanity check fails and we BUG.

To avoid this, make the dentry alias act like a symlink when we
encounter an uninvalidateable dentry alias. That is, we allow multiple
dentry aliases for a directory, however, when the dentry aliases are
actually used, we redirect to a common dentry (via d_automount where
possible, and follow_link elsewhere).

This means that such mountpoints will behave similarly to symlinks, in
that we 'point' to a specific mountpoint dentry. This means that if we
have multiple different ways to get to the same volume, and all are
accessed at the same time, all but one of those mountpoints will
behave like symlinks, pointing to the same mountpoint. So, the '..'
entries for each path will all point to the parent dir of one
mountpoint, meaning that the '..' entry will be "wrong", but for most
cases it will still be correct.

In order to try to make the 'target', pointed-to directory consistent,
we add a new field to struct vcache: target_link. This points to the
dentry we should redirect to, whenever that vcache is referenced. To
avoid (possibly not-feasibly-solvable) problems with refcounting, this
pointer is not actually a reference to the target dentry, but just
serves as a pointer to compare to.

FIXES 130273

Change-Id: I990131ce95cefe8336e83c7ebfb48aed1d685109
Reviewed-on: http://gerrit.openafs.org/7741
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-07-31 09:29:04 -07:00
Derrick Brashear
73ff095130 macos: next version support
support things beyond 10.7

Change-Id: I7a50f569fd43e0e1ed3c74f0480a8e2521df1bc5
Reviewed-on: http://gerrit.openafs.org/7763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-07-16 09:29:49 -07:00
Derrick Brashear
a08604b78f uss: allow disabling by configure switch
provide an option to disable building uss. current heimdal
when built static can leak symbol names for its flex/bison parser
causing symbol conflicts. this is but a workaround, but
sites not needing uss can at least use it.

Change-Id: Ibab1dd189e7fbc41ca01e7ef7479421c056999f5
Reviewed-on: http://gerrit.openafs.org/7553
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-06-13 15:19:44 -07:00
Derrick Brashear
5d53c12b95 gtx: add configure switch to force not building
allow gtx and associated software to be turned off.

Change-Id: If02427311c79e0784fcc5fb1816a449f7dcdd879
Reviewed-on: http://gerrit.openafs.org/7552
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-06-13 15:19:28 -07:00
Marc Dionne
5227148ae1 Linux 3.5: encode_fh API change
The encode_fh export operation now expects two inode arguments
instead of a dentry and a "connectable" flag.  Use the inode of
the dentry we're interested in, and NULL as the parent inode which
is the same as passing a 0 flag in the previous API.

Change-Id: I05cf146fb2a4bacdca20a9f108d04ccb11530804
Reviewed-on: http://gerrit.openafs.org/7523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-06-07 05:13:50 -07:00
Marc Dionne
2b33384a4a Linux 3.4: replace end_writeback with clear_inode
end_writeback() is renamed to clear_inode().  Add a configure test
and cope.

Change-Id: Icaf5b6b54d0ee377fabcf0b295d690eaa6b4be5e
Reviewed-on: http://gerrit.openafs.org/7503
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-05-28 20:06:39 -07:00
Michael Meffie
fbc9599484 configure: solariscc check update
Add checks for recent versions of sunstudio for solaris.  The
installation paths are documented in the release notes of versions
12.1, 12.2, and 12.3.

Change-Id: Ic28f40a061f288a1c39acb6a5d11e81876631d7f
Reviewed-on: http://gerrit.openafs.org/7253
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-04-22 06:19:24 -07:00
Simon Wilkinson
db733e325e roken: Add setprogname
Add setprogname to the list of functions that we test for, and replace
with a libroken alternative if it is missing.

Remove setprogname and getprogname from the AC_CHECK_FUNCS list, as
AC_REPLACE_FUNCS is a superset of this test.

Change-Id: If81dc8ba6d9245329f3abae6a6f062e3827dcfab
Reviewed-on: http://gerrit.openafs.org/7250
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-04-19 05:06:59 -07:00
Michael Meffie
f8b759b63f auth: local realms configuration
Add krb.conf and krb.excl support to the auth cell configuration
library.  Provide a function to determine if the user is local to the
cell.  Provide a function to set the local realms during application
initialization.  These changes are intended to replace the functions
afs_krb_get_lrealm and afs_is_foreign_ticket_name.

Change-Id: Iba57e9ffc2c958f3a4565a9352ce172189276ce9
Reviewed-on: http://gerrit.openafs.org/5744
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-04-16 10:31:04 -07:00
Michael Meffie
c11d1c0319 Build: error if solariscc is not found
Fail configure if the solariscc is not found and give the builder
a message to cope with non-standard installation paths for
sunstudio.

Change-Id: I64c1e752833f2aa824f4a15cc144e54bb03a1ec8
Reviewed-on: http://gerrit.openafs.org/7204
Reviewed-by: Simon Wilkinson <simonxwilkinson@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-04-13 17:46:30 -07:00
Chas Williams (CONTRACTOR)
29cb3b9f83 Finish removing sunos 4.x references and build cruft
Also, fix afsxbsa.h to always include <time.h> since this should get
struct tm on any fairly modern operating system.

Change-Id: Idfb39f12d28a2a0aa470c8549e4149d0b2ccde9e
Change-Id: Ia1c563e5954c533f18bd56155f2ae1825813efe3
Reviewed-on: http://gerrit.openafs.org/6923
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-03-25 18:41:24 -07:00
Marc Dionne
f246aa5f84 Linux 3.4: Switch to d_make_root
If d_make_root is available, use it instead of d_alloc_root.
The helper was introduced in 3.3, and d_alloc_root gets removed
in 3.4.

Change-Id: I39aaa6fd14d04c05ad9cb5b610e7f12f70fe0c94
Reviewed-on: http://gerrit.openafs.org/6931
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-03-22 07:05:06 -07:00
Andrew Deason
80592c53cb Disable kernel opt by default on Solaris 10 and 11
With newer Solaris Studio (sometime in the 12.* series), cc started
adding SSE instructions to optimized x86 code, which is invalid for
kernel code and can generate panics. There appears to be no way to
turn this off currently (-xvector=%none is non-functional), so default
to not optimizing kernel code.

Change-Id: I5fdedb11219df68e0146b8e0cee9010c2eb4067e
Reviewed-on: http://gerrit.openafs.org/6671
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-02-07 06:42:07 -08:00
Christof Hanke
20e82cecd9 linux: fix probing for noop_fsync
Commit 267934d0e6 introduced
probing code to deal with the renameing of simple_fsync
inside the linux-kernel.
This test does not take different parameter-lists
for noop_fsync or simple_fsync resp. into account.
Fix this.

Change-Id: Ib490f0bb7e8098acc83fce001a43c08f478ad582
Reviewed-on: http://gerrit.openafs.org/6628
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2012-02-01 04:18:19 -08:00
Marc Dionne
beafc7f742 Linux 3.3: use umode_t for mkdir and create inode ops
The mkdir and create inode operations have switched to using
umode_t instead of int for the file mode.

Change-Id: Ib8bbf6eaa6e87d6a9692c45b1a3fe93fcc3eff7a
Reviewed-on: http://gerrit.openafs.org/6567
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-01-18 10:12:40 -08:00
Marc Dionne
64bd0b728c Linux: use standard macro for set_nlink configure test
A generic macro exists to test for functions in the kernel, use
it for set_nlink.

Change-Id: Iaec2b29e48f500bcf7a1ef80a3f2a1305e5dbb8f
Reviewed-on: http://gerrit.openafs.org/6566
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2012-01-18 09:28:23 -08:00
Geoffrey Thomas
267934d0e6 linux: fsync on a directory should return 0, not EINVAL
Directory writes are synchronous, so this is fine. There's a
mostly-convenient function in fs/libfs.c that returns 0 that we can use
to do what we want ("mostly" because it was renamed in 2.6.35).

FIXES 130425

Change-Id: I9a2af60ed3152be036f0145c94152d8cff2e1242
Reviewed-on: http://gerrit.openafs.org/6491
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2012-01-03 07:26:06 -08:00
Anders Kaseorg
f1dd2d696f Linux: 3.2: Use set_nlink to update i_nlink
As of v3.2-rc1~84^2~1, struct inode.i_nlink is now const to prevent
direct modification.

Change-Id: If0a38ffb7f9964e23f5e64c900ae92f56fb77def
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-on: http://gerrit.openafs.org/6096
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-20 18:02:11 -08:00
Andrew Deason
70e8451acd Add setenv/unsetenv to roken
Add the replacement setenv and unsetenv functions to roken, for use on
(at least) HP-UX and older Solaris.

Change-Id: Id05137b6e6c88eb6648bd6a6e649f9ef311e32a4
Reviewed-on: http://gerrit.openafs.org/5801
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-11-08 19:37:46 -08:00
Andrew Deason
353aa7ef2c Do OPENAFS_OSCONF before compiler autoconf tests
OPENAFS_OSCONF can set the C compiler we use, as well as changing
various compiler flags. These changes can alter autoconf tests, so
allow OPENAFS_OSCONF to change these before various autoconf tests are
performed which require the C compiler.

Change-Id: I8da7d10b227f230d1467c77845c0dbd4b48fa966
Reviewed-on: http://gerrit.openafs.org/5785
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-11-03 13:14:55 -07:00
Derrick Brashear
955bab670d ukernel: output dataversion in stat struct if possible
we already have this data; if we can output it, do so.

Change-Id: Ibc445a152e4e1e61be50003dd8683d2a4b32d190
Reviewed-on: http://gerrit.openafs.org/5510
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-28 11:53:26 -07:00
chas williams - CONTRACTOR
440943e96b autoconf: use $XCFLAGS from OPENAFS_OSCONF when making tests
Certain platforms (like ppc64_linux26) compiler options might
affect some autoconf tests.  In particular, the ones related to
the size of certain primitive types.

Change-Id: I20c3f737ee4623451bc6cab3f97e86d152cb397f
Reviewed-on: http://gerrit.openafs.org/5366
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-09 12:11:42 -07:00
Marc Dionne
def00ae8ba Linux: d_delete now takes a const argument
The d_delete dentry operation now takes a const argument.  Test for
this and define our function accordingly to avoid warnings.

Change-Id: I621f54d8e8182b29ccfdf82798773800f5870064
Reviewed-on: http://gerrit.openafs.org/5335
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-09-05 07:04:27 -07:00
Marc Dionne
cbaefa266d Linux: 3.1: adapt to fsync changes
The fsync file operation gets new arguments to specify a range.
Add a configure test to check for the API change.

The inode lock is also pushed down into the operation, so we need
to take it ourselves to keep the original behaviour.

Change-Id: Icf4e152ce52f2b32c99920f83a5cc3136c05d2cd
Reviewed-on: http://gerrit.openafs.org/5332
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
2011-09-05 06:04:00 -07:00
Russ Allbery
0754537c11 Don't fail to build documentation if kindlegen doesn't exist
Check for kindlegen in configure and do nothing in the MOBI build
rule if the binary didn't exist.

This is still a bit of a hack since the rule will run with every
invocation of make.  The target needs to be made conditional.  But
at least this way make all in the documentation directory doesn't
fail.

Change-Id: I57f158929b3907678b9848a60edb9765136f7dbb
Reviewed-on: http://gerrit.openafs.org/5090
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
2011-08-23 09:36:41 -07:00
Russ Allbery
bec9c12859 Prefer dblatex to docbook2pdf
docbook2pdf, at least in version 0.6.14-1.1 in Debian, dies while
attempting to build the Admin Guide with an error about TeX capacity
exceeded.  dblatex seems to work reliably.  If both are installed,
prefer dblatex to docbook2pdf.

Change-Id: I7cf594c677cde84410bfefacf07cbbf398026ff3
Reviewed-on: http://gerrit.openafs.org/5091
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Russ Allbery <rra@stanford.edu>
2011-08-15 23:55:26 -07:00
Garrett Wollman
3d6f6e0043 configure: provide some necessary prerequisites in header checks
<netinet/in.h> is a prerequisite for <resolv.h> and <netinet/if_ether.h>.
<sys/socket.h> is a prerequisite for <net/if.h>.

Change-Id: I2c974ad863c6ff7eedb3702159399118af8de074
Reviewed-on: http://gerrit.openafs.org/5107
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:15:08 -07:00
Garrett Wollman
74e8bec7be configure: spell the "=" operator to test(1) correctly
Equality in the test(1) utility is represented by "=", not "==".
Some, but not all, versions of test accept the latter as an extension.

Change-Id: I25380f77e1c621965e0610318c9793874154cf15
Reviewed-on: http://gerrit.openafs.org/5106
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2011-07-29 14:14:48 -07:00
Garrett Wollman
8adf4cd0b0 util: introduce a common interface for setting thread names
A previous change added support for setting thread names/titles to
viced; this change moves the #ifdef spaghetti to src/util in
preparation for calling it from other places where it would be
useful.  Two functions are defined, one for setting an arbitrary
thread's name (as might be done by the spawning thread) and one
for setting the current thread's name; the latter is also defined as
a macro for non-pthreads compilations so that it can be called
unconditionally (the interface does not reference any
pthread-specific data types).  Note that some platforms, Mac OS X
in particular, do not allow setting the name of a different thread.

The two functions are defined as no-ops for Windows as our pthreads
emulation layer for Windows does not provide the needed mechanism.

Make viced use the new interface.

Change-Id: I58c65a28772d8d188c03d6ff3a6f052889362fb7
Reviewed-on: http://gerrit.openafs.org/4966
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2011-07-13 09:55:22 -07:00