Andrew Deason [Wed, 5 May 2010 18:51:23 +0000 (13:51 -0500)]
vlserver: prevent duplicate IPs via ChangeAddr
Add a safety check in VL_ChangeAddr/ChangeIPAddr to check if we are
adding a duplicate server IP in the database. Return VL_MULTIPADDR
when we try to do that.
Jeffrey Altman [Mon, 10 May 2010 00:46:11 +0000 (20:46 -0400)]
Windows: define HAVE_SSIZE_T
The windows param.*.h files define the ssize_t type.
Therefore, we must define HAVE_SSIZE_T in order to avoid
a collision with the ssize_t typedef in afs/stds.h.
Simon Wilkinson [Sun, 9 May 2010 18:40:58 +0000 (19:40 +0100)]
Add a list of files to import from Heimdal
Add an initial list of files to import into OpenAFS from Heimdal.
Currently this is just the list that are required to support
our new configuration file parser.
Simon Wilkinson [Sun, 9 May 2010 18:37:52 +0000 (19:37 +0100)]
Add a tool to import external repositories
This commit adds a tool to aid with the importing of external git
repositories. import-external-git.pl allows a developer to easily
update the src/external portion of the tree to the latest release
of externally developed software. It's currently intended to support
our use of Heimdal functions, but could be extended to support any
project whose code we wish to use in the kernel, and which has a
git repo.
Russ Allbery [Thu, 6 May 2010 19:30:23 +0000 (12:30 -0700)]
Include common param file for Linux alpha builds
The sysname for Linux Alpha is alpha_linux_26 (or 24 or 22) with an
extra underscore before the version, unlike all the other Linux sysnames.
Allow for that case when deciding whether to include the common Linux
param header.
Simon Wilkinson [Thu, 6 May 2010 14:00:00 +0000 (15:00 +0100)]
Modernise use of AC_CHECK_TYPE
Prior to autoconf 2.13, AC_CHECK_TYPE took two arguments, the type
to check and the a default type to use if that type wasn't defined.
This usage has been deprecated since 2.13, and the AC_CHECK_TYPE
macro itself now behaves differently. Whilst there is a compatibility
mode, the autoconf documentation discourages its use.
We also have an occurence of a slightly more modern AC_CHECK_TYPE,
where we explicitly #define a default value if one isn't provided.
The autoconf manual also discourages this form, however, in favour
of using AC_CHECK_TYPES, and placing suitable typedefs in an
external header file.
Modify our code so we do things in the recommended way.
Simon Wilkinson [Thu, 6 May 2010 13:58:52 +0000 (14:58 +0100)]
Always include afsconfig.h in autogenerated files
Modify rxgen and compile_et so that the files they output always
contain afsconfig.h before afs/param.h. This avoids problems where
afs/param.h, or headers included from it, rely on having the results
of configure tests available.
OpenBSD: Use osi_obsd_Free() for all releases of OBSD
Use osi_obsd_Free() in afs_osi_Free() for all releases of OpenBSD,
not just releases from 4.4 onward. Otherwise, afs_osi_Free() will
use AFS_KFREE, which does not exist, since OBSD/osi_machdep.h is
not included, resulting in unresolved symbols when trying to load
the kernel module.
In OpenBSD releases prior to 4.2, use the system (kernel-specific)
FREE macro to release space in the kernel module, not KFREE. The
latter does not exist and results in unresolved symbols when trying
to load the kernel module. (This was undoubtedly a typo.)
Simon Wilkinson [Thu, 6 May 2010 13:55:59 +0000 (14:55 +0100)]
Always include afsconfig.h
Our coding standards say that OpenAFS source files should always have
#include <afsconfig.h>
#include <afs/param.h>
at the start of the file. Including just param.h, or having these
includes in a different order can produce unexpected effects, because
param.h includes sysnames.h, which in turn includes stds.h, which may
rely upon having the results of configure tests available.
Fix the obvious places in the Unix build which get this wrong.
Windows: Secure C String usage in src\WINNT\afsd\fs.c
The use of strlen, strcat, strcpy, strncpy and sprintf in
src\WINNT\afsd\fs.c does not effectively protect against buffer
overruns and string truncation errors. This patchset replaces
their use with StringCbLen, StringCbCat, StringCbCopy,
StringCbCopyN, StringCbCopyEx and StringCbPrintf respectively from
strsafe.h.
The functions sscanf, fscanf and scanf do not check for the size of
the parameters so it is prone to buffer overruns. These functions
can be replaced by sscanf_s, fscanf_s, scanf_s when the Visual Studio
compiler version is 1400 or greater. Also memcpy will be replaced
by memcpy_s which will check for the size of the destination buffer.
In all cases, failure conditions are handled.
Patchset development was mentored by Asanka Herath and Jeffrey Altman.
Change-Id: I01e9dfc616641c220b57d2871e3e140406df3653
Reviewed-on: http://gerrit.openafs.org/1736 Tested-by: Jeffrey Altman <jaltman@openafs.org> Reviewed-by: Tharidu Fernando <tharidufernando@gmail.com> Tested-by: Tharidu Fernando <tharidufernando@gmail.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Andrew Deason [Mon, 3 May 2010 19:57:28 +0000 (14:57 -0500)]
Solaris: shutdown in freevfs, not unmount
Call the afs shutdown sequence (afs_shutdown()) in the VFS_FREEVFS
handler, instead of in the VFS_UNMOUNT handler. This way we shutdown
when the last reference to our vfs goes away, instead of when we are
unmounted. That doesn't make much of a difference right now, but doing
so will be required for supporting forced unmounts.
Andrew Deason [Thu, 29 Apr 2010 22:47:15 +0000 (17:47 -0500)]
Solaris: prevent AFS umount while busy
Return EBUSY from unmount if someone still references stuff in AFS.
This prevents kernel panics that can occur on shutdown if we umount
while there is a file in AFS open. Normally a process can hold a file
in AFS open, AFS is unmounted, and the file is closed, triggering our
code which explodes if called after we're unmounted.
This adds VFS_HOLD/VFS_RELE calls whenever we 'create' a vcache, or
retire an old one, to keep track if anyone has an open reference to
us.
Simon Wilkinson [Sat, 7 Nov 2009 00:16:28 +0000 (00:16 +0000)]
Refactor afs_NewVCache
afs_NewVCache was a twisty turny maze of #ifdefs and duplicated code.
This makes a number of sweeping changes to simplify this code, and to
move platform specific elements out into their own directories.
*) ShakeLooseVCaches is refactored so that the same code can be used
both for platforms that support dynamic vcaches, and those which
don't.
*) afs_NewVCache, ShakeLooseVCaches, and afs_AllocVCache are all
modified to remove platform specific code, and to call platform
specific functions.
*) A new platform file 'osi_vcache.c' is created to hold a number of
platform specific vcache operations:
*) osi_TryEvictVCache handles the decision of whether a vcache can
be evicted or not, and does so if required
*) osi_NewVnode allocates a new vnode
*) osi_PrePopulateVCache does the necessary population of the
vcache, before it's threaded onto the VLRUQ and associated hash
tables.
*) osi_AttachVnode handles attaching an OS vnode to our vcache,
where that is necessary
*) osi_PostPopulateVCache handles the vcache population that must
occur after we're on the VLRUQ and have a vnode attached.
OpenBSD: Fix bug in setpag() when group list is empty
In OpenBSD, the PAG uses the 2nd and 3rd group slots in the task's
group list. If an application sets en empty group list (such as Samba
does), any existing PAG is lost and any new one is NOT set because
the existing code will set the new group count to 2 instead of 3, and
it leaves the first group entry as garbage (whatever random value the
memory contained), thereby totally messing up the task's group list.
This patch fixes it so that it behaves as expected.
Fix pattern to detect i386-based OpenBSD system type
When the pattern to detect OpenBSD system types (via MKAFS_OSTYPE) was split
into two separate ones for amd64 and i386 architectures, the pattern for
i386-based systems was not set quite right. As a result, i386-based OpenBSD
systems are no longer detected properly at this stage, resulting in an error
of "cannot find input file: src/libafs/MakefileProto..in" during configure.
This patch corrects the pattern.
Windows: Show configuration pages for all types of MSI installations
The OpenAFS MSI installer wizard used to not show any configuration
pages for "Typical" and "Complete" installations. Setting the
workstation cell and logon options during installation required
selecting the "Custom" option. Many users choose the "Typical" option
during installation, and thus would never see the configuration pages.
Therefore, for these users, the workstation cell was being set to the
default.
This patch makes the workstation cell and logon option configuration
pages visible to all types of installations (except silent
installations which show no UI).
Jeffrey Altman [Sun, 2 May 2010 19:30:27 +0000 (15:30 -0400)]
Windows: Restructure cm_LookupInternal addition of Freelance entries
cm_LookupInternal creates Freelance mount points and symlinks
when queries cannot be found in the Freelance root.afs directory.
If the search name is a full cell name for which vldb information
can be obtained, then a mount point is added. If the search name
is a left-most substring or the full cell name with a dot appended
to it, then a symlink was created. This approach created a very
poluted Freelance name space.
This patchset makes the following changes:
1. Do not create symlinks with a dot appended to the cellname
2. Do not create symlinks where the left-most substring is not
a full dot separated component of the cellname.
3. Permit lookups to succeed when we would have created a
symlink in the past without creating the symlink.
Jeffrey Altman [Sun, 2 May 2010 19:26:39 +0000 (15:26 -0400)]
Windows: Permit BPlus tree lookups within cm_ApplyDir
BPlus tree lookups are much faster than searching through
the native directory format on Windows because the case sensitive
hash tables cannot be used successfully. Permit BPlus trees
to be used except when called with cm_BPlusDirFoo as the action
function because cm_BPlusDirFoo is used to build the BPlus trees
from the native directory format.
Jeffrey Altman [Sun, 2 May 2010 18:48:00 +0000 (14:48 -0400)]
Windows: Force rebuilding Freelance directory in AddMount and AddSymlink
cm_FreelanceAddMount and cm_FreelanceAddSymlink is supposed to
return the allocated FID of the entry that was added. However,
cm_NameI is called to perform the lookup without forcing an update
of the Freelance fake directory. As a result the entry may not be
found.
Force an update prior to calling cm_NameI() by using
cm_clearLocalMountPointChange() and cm_reInitLocalMountPoints()
if required.
Jeffrey Altman [Sun, 2 May 2010 18:03:23 +0000 (14:03 -0400)]
Windows: use cm_noteLocalMountPointChange whenever fakeDirVersion is changed
cm_noteLocalMountPointChange() is meant to be used when fakeDirVersion
is changed. It previously wasn't used because cm_noteLocalMountPointChange()
would obtain the cm_Freelance_Lock. Now that cm_noteLocalMountPointChange()
can be called while holding the lock, use it everywhere.
Jeffrey Altman [Sun, 2 May 2010 17:56:24 +0000 (13:56 -0400)]
Windows: add locked parameter to cm_noteLocalMountPointChange
If cm_Freelance_Lock is held set the 'locked' parameter to TRUE.
This avoids a requirement to drop the lock only to have it be
obtained when cm_noteLocalMountPointChange.
The validation check for the response from the GetVolumeStatus
pioctl is incorrect. The response is not simply a VolumeStatus
structure but also several C strings appended to it.
Jeffrey Altman [Sun, 2 May 2010 13:16:29 +0000 (09:16 -0400)]
Windows: getAFSServer wrong variable used in uncompiled code
In the uncompiled implementation of getAFSServer, the unmodified
'cellname' is used in the send_DNS_AFSDB_Query call instead of
the properly constructed 'query' variable.
Windows: FlushFile ioctl should call cm_FSync, not buf_CleanVnode
When flushing a file, we need to commit the file length changes
as well as the dirty buffers. Call cm_FSync instead of buf_CleanVnode
which is called by cm_FSync.
Windows: add 'locked' flag to cm_FSync and call when dropping write locks
cm_FSync should be called when releasing file server write locks.
This ensures that all dirty buffers are stored before the lock
can be acquired by another client.
Since cm_Unlock holds the cm_scache_t->rw exclusively when calling
cm_FSync, add a 'locked' parameter to cm_FSync to avoid an unnecessary
release and reacquire of the rwlock.
Matt Benjmain [Wed, 28 Apr 2010 10:19:16 +0000 (06:19 -0400)]
netbsd: rebase cm at NetBSD 4.0
Rebases the NetBSD client port at OpenBSD, which was originally
based on an original NetBSD client port by John Kohl. The
platforms remain closely connected.
At latest milestone, the port builds as a NetBSD LKM, which was
loadable and can mount /afs (but much work remains past this
point).
Simon Wilkinson [Wed, 28 Apr 2010 00:13:30 +0000 (01:13 +0100)]
Linux: Register number sysctls only when desperate
The AFS sysctl interface was trying to register numeric system
calls whenever the kernel would let it. This is anti-social, as
we've never had sysctl numbers allocated to us. In kernels newer
than 2.6.24, this misbehaviour is detected and punished. In recent
kernels, the binary interface has gone away entirely.
Since 2.6.19, the kernel has supported allocated unnumbered system
calls. These are only available via /proc/sys (and not the using
the legacy, binary, API), but they're really the only interface
available to us.
Change the sysctl registration code to use unnumbered calls whenever
they are available. Unnumbered calls aren't available in 2.4.x, so
completely remove that code there.
Marc Dionne [Sun, 25 Apr 2010 02:12:27 +0000 (22:12 -0400)]
Linux: Remove unnecessary crhold on incomplete kernel credentials
When credentials debugging is active in the kernel, sanity checks
in various credentials functions such as get_cred or put_cred
require that they are called with full fledged kernel credentials.
This can be a problem with recent kernels in osi_Init where we
build our own credentials and try to "crhold" them.
Getting a reference doesn't make much sense anyway since we're
using a statically allocated structure that we never try to free
or modify.
As a minimal fix, just don't call crhold when we're using
the kernel credentials structure.
right now, flock with LOCK_EX, on unlock, triggers an async store.
make it sync, but also, make sure to ask to have any in-memory
data sent to us (e.g. VM_StoreAllSegments); unlike Solaris
VMSYNC_INVAL, we don't want to invalidate the pages, just get copies
written back.
LOCK_SH did not, does not and AFAICT should not trigger writes.
Simon Wilkinson [Tue, 27 Apr 2010 18:31:55 +0000 (19:31 +0100)]
Linux: Reorder the tests
As a final change to the Linux autoconf stuff, reorder the list of
tests so that it's more easy to see what's being checked for, and to
prevent multiple copies of the same thing being added.
Simon Wilkinson [Tue, 27 Apr 2010 17:57:30 +0000 (18:57 +0100)]
Linux: Don't preprocess osi_vfs.h
Before we did inodes properly, we needed to pre-process osi_vfs.h,
in order to merge our inode structure with the Linux one. Ever since
we moved to native inodes, that preprocessing has been disabled, and
we've just copied osi_vfs.hin to osf_vfs.h Skip this pointless step,
permanently rename osi_vfs.hin to osi_vfs.h, and remove the unused
support scripts.
Simon Wilkinson [Tue, 27 Apr 2010 16:41:22 +0000 (17:41 +0100)]
Linux: Add general autoconf macro for Linux kernel
Add AC_CHECK_LINUX_BUILD() to do a standardised Linux build, which
takes a "checking" message, the autoconf variable to use to cache
the results, headers and code to run, preprocessor variable to
define, and a description of that variable.
Reimplement all of our existing check macros in terms of this one,
resolving many typos along the way.
Simon Wilkinson [Tue, 27 Apr 2010 12:02:20 +0000 (13:02 +0100)]
Linux: Add autoconf macro for structure checks
Add a new autoconf macro for doing structure element checks, and
modify all simple structure checks to use it. This introduces a
standard name form - STRUCT_structure_HAS_element, so there are
some changes in the code to make use of this standard form.
Simon Wilkinson [Mon, 26 Apr 2010 22:54:05 +0000 (23:54 +0100)]
Linux: Macroise kernel function autoconf tests
We spend a lot of time in autoconf checking to see if kernel
functions are available. Rather than copying and pasting the same
code everytime we do so, create a macro to do function tests, and
use that macro. This results in standardised naming, so change all
of the places that use autoconf results to use the same standardised
names.
Simon Wilkinson [Mon, 26 Apr 2010 21:13:39 +0000 (22:13 +0100)]
Linux: Tidy up freezer code
Linux now provides try_to_freeze(), which can be used to replace
all of our refrigerator code. This has been in the tree for a long
time, and actually predates many of the changes we've been modifying
our code to work with. So, use try_to_freeze wherever we can, and keep
a simpler compatibility function for kernels which are too old to have
it.
Simon Wilkinson [Mon, 26 Apr 2010 20:34:17 +0000 (21:34 +0100)]
Linux: Simplify header file checks
Provide an autoconf macro to perform tests for the existence of
Linux kernel header files. Use this to standardise the naming of
header file presence #defines, and to simplify the linux tests.
Simon Wilkinson [Mon, 26 Apr 2010 22:36:38 +0000 (23:36 +0100)]
Overzealous .gitignore under rxkad
The .gitignore in rxkad ignores sboxes.h and fcrypt.h,
since they used to get copied there from the domestic subdir.
Now that they actually live under rxkad, they souldn't be
ignored.
Marc Dionne [Mon, 26 Apr 2010 22:15:16 +0000 (18:15 -0400)]
Overzealous clean target under rxkad
The clean target under rxkad removes sboxes.h and fcrypt.h,
since they used to get copied there from the domestic subdir.
Now that they actually live under rxkad, they souldn't be
removed.
note that IFDirtyPages is Solaris-only, so there's no confusion. may be
worth visiting to see if and how the code should be minimized or adapted
for elsewhere
Simon Wilkinson [Fri, 23 Apr 2010 16:07:40 +0000 (17:07 +0100)]
Linux: Don't hide memory management
Given that we now only switch from user space into kernel space in
one place, don't hide the mechanism we use to do so behind macros.
This makes it much easier to visually confirm the correctness of the
code.
Change-Id: Ie52e071c81a9178c792be1eaa7e36d8453ebb319
Reviewed-on: http://gerrit.openafs.org/1820 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Dan Hyde <drh@umich.edu> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Fri, 23 Apr 2010 16:10:15 +0000 (17:10 +0100)]
Linux: The kernel module always runs in the kernel
There's no situation where we'd be including osi_machdep.h and not
be building for the kernel, so just remove the case that disables all of
the locks if __KERNEL__ isn't defined.
Marc Dionne [Thu, 22 Apr 2010 21:22:37 +0000 (17:22 -0400)]
Initialize oldvtix
Initialize the variable to avoid compiler complaints that it
could be used uninitialized. Use a sentinel value and issue
a warning if we try to use the variable and we haven't set
it to a useful value.
Simon Wilkinson [Fri, 23 Apr 2010 17:03:49 +0000 (18:03 +0100)]
Linux: Use kernel network helper functions
Linux has various network helper functions available, which are
guaranteed to do the right thing in terms of setting address space
limits, not dereferencing NULL pointers, and the like. Use these, where
they're available, rather than rolling our own.
kernel_sendmsg and kernel_recvmsg appeared in 2.6.8.
Simon Wilkinson [Fri, 23 Apr 2010 17:38:02 +0000 (18:38 +0100)]
Linux: Remove old code from RX kernel implementation
The RX implementation was split into LINUX and LINUX24 along with
the kernel, but the old 2.4 and 2.2 only code was never removed from
the LINUX/ directory. Do so now.
Simon Wilkinson [Fri, 23 Apr 2010 15:54:39 +0000 (16:54 +0100)]
Linux: Don't pass f_pos down to the filesystem
In 2.6.8, Linux shifted from passing f_pos directly to the read
and write routines, and started passing a copy. This helps reduce,
but does not remove, the race issues with f_pos itself. Make this
change for us.
Take the opportunity to remove the uneccessary macros, and tidy up
some casting.
Simon Wilkinson [Fri, 23 Apr 2010 14:07:58 +0000 (15:07 +0100)]
Linux: Don't roll our own llseek
llseek is a little more complex than just setting the pos field of
the file structure.
Where vfs_llseek is available to us (it has been since 2.6.8) use that
directly. If vfs_llseek isn't available, then use either the
filesystem's llseek method, or default_llseek (available since 2.6.0),
to ensure we get the proper locking.
Simon Wilkinson [Sun, 25 Apr 2010 21:07:04 +0000 (22:07 +0100)]
Move rxkad/domestic/* into rxkad/ directory proper
Historically, the fcrypt code lived in its own directory, named
'domestic', so that ACLs could be used to prevent nasty foreigners
from getting access to it. Now that those days are gone, having the
domestic directory just complicates builds. Remove it, and reunite
fcrypt with the rest of the tree.
Simon Wilkinson [Sun, 25 Apr 2010 18:11:06 +0000 (19:11 +0100)]
Improve shared library building support
This change removes the need to maintain two forms of symbol export
lists, instead generating the simpler lists required by AIX and Mac OS X
from the more complex Linux and Solaris mapfile. It can only handle
simple mapfiles at present, any more complex files (for example, those
which contain versioning information) will require changes to the
translation script. The now unused .exp files are removed, and a
dependency on the .map file added to the library build line.
This change adds support for export lists to Darwin for the first time.
Doing so identified a number of symbols in libafsrpc that are required
by libafsauthent, which were not being exported. Export these symbols,
and bump the minor revision of the shared library.
Simon Wilkinson [Sun, 25 Apr 2010 10:31:36 +0000 (11:31 +0100)]
Linux: Remove prototype warning inhibition
The Linux kernel builds used to add -Wno-strict-prototypes to the
CFLAGS. Now that we've got prototypes for pretty much everything,
remove this line so we can see any real warnings that might occur.
Simon Wilkinson [Sun, 25 Apr 2010 09:55:23 +0000 (10:55 +0100)]
Fix make clean and make distclean
Fix these make targets so they actually clean the tree. Reorder the list
of file deletions in distclean so that it exactly mirrors the creation
order in configure.in, which should hopefully make it easier to keep
this all in sync in future. Add all of the missing files in packaging,
and the shared library build tools, to this list.
Make kauth and vol clean remove ka-forwarder and fssync-debug,
respectively.
Simon Wilkinson [Sat, 24 Apr 2010 16:34:02 +0000 (17:34 +0100)]
Fix objdir builds
Change f2db78a346112f5320efc6f0b6b9fe4ae0d893d3 included hard
references to compilation sources with no srcdir prefix, and so
broke objdir builds. Fix this so that we can build outside the
source tree again.
Simon Wilkinson [Thu, 22 Apr 2010 21:24:11 +0000 (22:24 +0100)]
Unix: Modify disk cache versioning
This change increments the disk cache version number, and adds a
structure size record to the disk cache header. All old disk caches
will be replaced when the client is started.
With the various changes made to unify our file handles, and to
support large file handles on Linux, the size of the 'fcache'
structure was modified earlier in the 1.5 series. However, fcache
is also the building block of the CacheItems file, so these changes
inadvertently broke users upgrading from 1.4. In addition, as the
disk cache inode is now a union of many different structures, the
structure size is now potentially volatile across both kernel, and
OpenAFS revisions.
Up the version number so old disk caches are invalidated and won't
crash users who are upgrading. Also take the opportunity to add an
item to the header which stores the size of struct fcache used
by the disk cache. If the size on disk doesn't match that expected
by the kernel module, truncate the cache and start again.
Change-Id: I2ee8863d0bfaaaba34272c9e139638e17669a53e
Reviewed-on: http://gerrit.openafs.org/1811 Reviewed-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Andrew Deason [Thu, 22 Apr 2010 16:54:06 +0000 (11:54 -0500)]
Update nextVnodeUnique before checking inUse
When attaching a volume, update the nextVnodeUnique field for the
volume, before we do any checks on the volume; for example, checking
inUse, which may result in a demand-salvage if we are running DAFS.
If we do not do this, we can schedule a demand-salvage without setting
nextVnodeUnique, and VUpdateVolume_r will update the volume header
uniquifier to nextVnodeUnique+200, when nextVnodeUnique is not set.
So, we will always set the uniquifier to 200. Fortunately, the salvage
should usually fix the uniquifer anyway.
So, set nextVnodeUnique before doing any of those checks, to avoid
screwing up the uniquifier when taking the volume offline.
Andrew Deason [Thu, 22 Apr 2010 18:21:52 +0000 (13:21 -0500)]
Prefer EndCall errors in StoreMini
Partially revert b1eb6a7a3f80500f0187cc6a1dd2013e1a5e154a, so we do
not mask the rx_EndCall error with a EndRXAFS_StoreData error (for
example, if EndRXAFS_StoreData returns RXGEN_CC_UNMARSHAL, and
rx_EndCall returns VBUSY). We need to agree on how to do this
throughout the tree, but for now, just fix StoreMini.
Change-Id: I4913946089fd0857506d9186f85c5c8115a5b95d
Reviewed-on: http://gerrit.openafs.org/1808 Tested-by: Andrew Deason <adeason@sinenomine.net> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Simon Wilkinson [Thu, 22 Apr 2010 16:56:25 +0000 (17:56 +0100)]
Linux: RedHat packaging updates for RHEL6
Update our bundled spec file and related tools so they can be used
to build OpenAFS on the RHEL6 beta.
- Make kmodtool recognise el6 as having "modern" kernel naming
conventions
- Replace %{PACKAGE_VERSION} (which seems to have disappeared)
with the standard %{version} macro
Thanks to billings and phalenor on IRC for their testing efforts.
Fix UCONTEXT detection on ppc_linux26 via include order
param.linux26.h defines USE_UCONTEXT for all Linux platforms for
glibc 2.4 and higher, but it does this by testing __GLIBC__ and
__GLIBC_MINOR__. These are defined by features.h, which is included
by any system header. At least one system header must be included
before those are defined. lwp/process.c was including <afsconfig.h>
and <afs/param.h> before any other headers, leading to those macros
being undefined. Most of the Linux architectures either have their
own implementation or were explicitly defining USE_UCONTEXT in the
per-architecture param file, but ppc_linux26 was relying on the
default.
Fix this by reordering the includes to include the various system
headers before <afs/param.h> and add a comment explaining why.
This previously worked in earlier versions because the old
param.ppc_linux26.h file included <afs/afs_sysnames.h>, which
included "stds.h", which included a system header prior to the check
for ucontext. The new generic param file reverses that order.
Andrew Deason [Wed, 21 Apr 2010 17:41:21 +0000 (12:41 -0500)]
Recover from afs_GetVolSlot errors
afs_GetVolSlot can panic in a few different ways, such as failing to
read from or write to VolumeInfo. Instead of panic'ing, return an
error to the application. Adjust callers to deal with getting a NULL
volume returned.