Mark Vitale [Thu, 7 Mar 2024 17:48:22 +0000]
Make OpenAFS 1.8.11
Update version strings for the 1.8.11 release.
Add final updates to NEWS.
Change-Id: Id66da29a5001f18e8816bcb214f70544474bfaef
Reviewed-on: https://gerrit.openafs.org/15671
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Andrew Deason [Tue, 13 Nov 2018 17:09:52 +0000]
roken: Use srcdir for roken-post.h
roken-post.h is a source file, not a generated file in the objdir.
Specify $(srcdir) so we can work with objdir builds.
Reviewed-on: https://gerrit.openafs.org/13387
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
345a739b7bb6c9c142a2b0fe584fed6c44d6c655)
Change-Id: Ie02f0aaf373bebe74b0eaf8969b712c146a462f8
Reviewed-on: https://gerrit.openafs.org/15638
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Stephan Wiesand [Thu, 3 Aug 2023 15:35:02 +0000]
Make OpenAFS 1.8.11pre1
Update version strings for the first 1.8.11 prerelease.
Change-Id: I161717ae5670a3261ebbc1fe8fe9c13c18868e74
Reviewed-on: https://gerrit.openafs.org/15527
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Michael Meffie [Mon, 21 Aug 2023 17:23:10 +0000]
Update NEWS for 1.8.11 pre-release
Add NEWS items for the upcoming 1.8.11 release.
Change-Id: I0b690b0aa273c05f33e68e1ba086863703266b3b
Reviewed-on: https://gerrit.openafs.org/15551
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Indira Sawant [Thu, 21 Dec 2023 02:20:53 +0000]
util: Clear owner when unlocking recursive mutex
A race condition where the pthread_recursive_mutex_t::owner that is maintained
by AFS doesn’t match with the thread that is trying to unlock.
This leads to AFS file server and ptserver crash due to assertion failure
where it was trying to unlock the grmutex.
We saw the race more often when our customer migrated their machines from
Power8 to Power9 systems and increased the SMT value from 2 to 4.
fileserver Assertion failed! file keys.c, line 911.
ptserver Assertion failed! file userok.c, line 78.
File: keys.c
889 int
890 afsconf_GetKeyByTypes(struct afsconf_dir *dir, afsconf_keyType type,
891 int kvno, int subType,struct afsconf_typedKey **key)
892 {
893 int code = 0;
894 struct subTypeList *subTypeEntry;
895
896 LOCK_GLOBAL_MUTEX;
897
…
910 out:
911 UNLOCK_GLOBAL_MUTEX; <<<<
912 return code;
913 }
Consider a following situation,
cpu0 , cpu1 and T0, T1 and T2 are the cpus and timestamps respectively,
T0: thread1 locks grmutex performs some operations and unlocks the same,
thus has itself set as pthread_recursive_mutex_t::owner. Since presently we do
not reset it, thus, pthread_recursive_mutex_t::owner = thread0.
T1: thread0 starts on cpu0.
T2: thread1 starts on cpu1.
T3: thread0 tries to lock AFS grmutex and acquires corresponding pthread_mutex,
now before thread0 updates pthread_recursive_mutex_t::owner, a context switch
happens.
T3: thread1 on cpu1 tries to acquire grmutex and sees itself as the
pthread_recursive_mutex_t::owner, possibly as it was not reset and updated yet.
So thread1 thinks itself as the owner and proceeds.
T4: thread0 updates the pthread_recursive_mutex_t::owner this time it is also
synced across the cpu caches.
T5: thread1 tries to unlock the grmutex and crashes because now it’s not the
owner of the mutex.
Debugging:
We implemented a circular log to store certain values related to grmutex which
helped in debugging us this further.
({ \
time_t t; \
time(&t); \
LOG_EVENT("%s: Unlocking TID %u: %s:%d owner %lu " \
"locked %d pthread_self %u times_inside %d\n", \
ctime(&t), (unsigned)grmutex.mut.__data.__owner,\
__func__ , __LINE__, \
grmutex.owner, grmutex.locked, (unsigned)pthread_self(), \
grmutex.times_inside); \
opr_Verify(pthread_recursive_mutex_unlock(&grmutex)==0); \
})
$614 = "Mon Sep 11 19:35:34 2023\n: Locking TID 136896:
afsconf_GetKeyByTypes:896 owner
140735030161776 locked 1
pthread_self
2305880432 times_inside 1\n\000 2\n",
$615 = "Mon Sep 11 19:35:34 2023\n: Unlocking TID 136896:
afsconf_IsLocalRealmMatch:602 owner
140735030161776 locked 1
pthread_self
1836773744 times_inside 2\n",
$617 = "Mon Sep 11 19:35:34 2023\n: Unlocking TID 136896:
afsconf_GetKeyByTypes:911 owner
140735030161776 locked 1
pthread_self
2305880432 times_inside 1\n\000\061\n",
Solution:
This problem was resolved after resetting thread_recursive_mutex_t::owner in
global mutex unlock function.
Thanks to Todd DeSantis for helping with debugging, review and verification of
this problem.
Signed-off-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-on: https://gerrit.openafs.org/15604
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
e4fda3481dc9ec651377493afbc95bd40f4f1fb2)
Change-Id: I400892121d1b1f63adcd6848e774ede1c4ec5da9
Reviewed-on: https://gerrit.openafs.org/15609
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Thu, 9 Nov 2023 17:38:29 +0000]
Linux 6.7: convert to inode a/mtime accessor funcs
The Linux 6.7 commit "fs: new accessor methods for atime and mtime"
(
077c212f03) is a follow up to the Linux 6.6 commit "fs: add ctime
accessors infrastructure" (
9b6304c1d5)
With the above 6.7 commit, the inode's i_atime and i_mtime are renamed
to __i_atime and __i_mtime and accessing these members should use the
new accessor functions.
This commit is similar to the OpenAFS commit "Linux 6.6: convert to
ctime accessor functions" (
072c7934cd1)
Add autoconf tests to detect when we need to use the new accessors and
introduce new wrapper functions to get and set an inode's atime and
mtime.
Note, unlike the (
072c7934cd1) commit, we need to add support for
reading an inode's atime and mtime, so this commit has the getters for
the atime and mtime members.
Reviewed-on: https://gerrit.openafs.org/15597
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
8962767a7e27f8db9dc9001999edf573be706d66)
Change-Id: If5f58df74f37749b7dfdc52172a8e9573d849ecd
Reviewed-on: https://gerrit.openafs.org/15600
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Mark Vitale [Fri, 15 Sep 2023 19:01:56 +0000]
dir: Introduce struct DirEntryFlex
The directory package as implemented in AFS-2 allocates space for each
directory entry as a DirEntry struct followed by 0-8 contiguous
DirXEntry structs, as needed. This is implemented by:
- afs_dir_NameBlobs calculates the number of blocks needed
- FindBlobs allocates and returns index of entry
- afs_dir_GetBlob returns pointer to 1st DirEntry struct
After this, we populate DirEntry (and any contiguous DirXEntry blocks)
with open code. Most existing code writes the entry's name via a string
copy operation to DirEntry->name, which is only 16 bytes long.
Therefore, for dir entry names that are 16 bytes or longer, OpenAFS
routinely does string copies that look like buffer overruns. This has
not previously caused problems because the OpenAFS code has arranged for
a sufficiently large amount of contiguous memory to be available.
However, this remains undefined behavior in the C abstract virtual
machine; thus compilers are not required to produce safe operation.
Recent changes in the OpenAFS build chain have made this approach no
longer viable:
1) Linux 6.5 commit
df8fc4e934c12b 'kbuild: Enable
-fstrict-flex-arrays=3' modified the hardening of several kernel
string operations when running with CONFIG_FORTIFY_SOURCE=y.
2) gcc 13 commit
79a89108dd352cd9288f5de35481b1280c7588a5
'__builtin_dynamic_object_size: Recognize builtin' provides some
enhancements to _builtin_object_size. The Linux commit above will now
use these when the kernel is built with gcc 13.
When OpenAFS is built under Linux 6.5 or higher and gcc 13 or higher,
the hardened strlcpy will BUG for directory entry names longer than 16
characters.
Since there are multiple places where OpenAFS writes directory names,
there are several symptoms that may manifest. However, the first one is
usually a kernel BUG at cache manager initialization if running with
afsd -dynroot _and_ there are any cell names 15 characters or longer in
the client CellServDB. (A 15-character cellname reaches the 16
character limit when -dyrnoot adds the RW mountpoint ".<cellname>".)
Address this by using flexible arrays (standardized with C99). A
flexible array is a variable-length array that is declared with no size
at all, e.g., name[].
Create an autoconf test to determine whether the compiler supports
flexible arrays.
Create a new struct DirEntryFlex. If the compiler supports
flexible arrays, define name[]; otherwise retain the name[16]
definition.
Whenever we write a directory name, use DirEntryFlex so that any
hardening will be satisfied that there is sufficient space for the name.
However, the actual guarantee that this is true is still provided by the
OpenAFS directory routines mentioned above - all of these remain
unchanged.
The DirEntry struct remains unchanged for continued use in OpenAFS, as
well as for any out-of-tree users of the directory package.
Reviewed-on: https://gerrit.openafs.org/15573
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit
e2ec16cf941b0aadfbd54fc2f52edd58b62e232d)
Change-Id: Ibf6d3549ba1e941c957e98ef4875152d865c9358
Reviewed-on: https://gerrit.openafs.org/15599
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Mark Vitale [Mon, 18 Sep 2023 22:41:23 +0000]
dir: Allow 256-byte directory entry names in salvager
Since the original IBM code import, the DirOK test for directory entry
names has been off-by-1; it says that directory names of length MAXENAME
256 are "too-long".
Modify DirOK to properly validate directory entry names during salvage.
While here, remove MAXENAME in favor of AFSNAMEMAX.
Reviewed-on: https://gerrit.openafs.org/15574
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit
319c1ca87af66425048e498e300e7d8e714fc98a)
Change-Id: Ie4355f9867372f99e4cb283a209953fcda949397
Reviewed-on: https://gerrit.openafs.org/15598
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Cheyenne Wills [Thu, 2 Nov 2023 15:46:34 +0000]
Linux: Fix to use time_t instead of time64_t
In commit 'Linux 6.6: convert to ctime accessor functions' (
072c7934cd)
the functiom afs_inode_set_ctime was defined to use time64_t when it
should have used a time_t as the data type for the sec parameter.
See the commit 'LINUX 5.6: define time_t and use timespec/timespec64'
(
78049987aa).
The time64_t data type was introduced in Linux 3.17. A build failure
will occur when building on kernels prior to Linux 3.17.
Reviewed-on: https://gerrit.openafs.org/15595
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
a2f77c53073b3999887eb689f396a414b191aba7)
Change-Id: Ie14d9ebbcce6a5d2db0fc38eb4d97aa30f574da9
Reviewed-on: https://gerrit.openafs.org/15596
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Ganesh Chaudhari [Fri, 20 Oct 2023 10:46:16 +0000]
macos: Add support for MacOS 14.X (Sonoma)
This commit introduces the new set of changes/ files required
to successfully build and package the OpenAFS source code on
MacOS 14.X "Sonoma".
Signed-off-by: GANESH CHAUDHARI <gangovind@in.ibm.com>
Reviewed-on: https://gerrit.openafs.org/15591
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Tested-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
f379e1b255ebb5094c5acc11a9234d5a321818c2)
Change-Id: I913bf9ae5eda0ae571c727e95f9f3ac113df9f64
Reviewed-on: https://gerrit.openafs.org/15602
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ganesh G. Chaudhari <gangovind@in.ibm.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Thu, 26 Jan 2023 18:30:04 +0000]
CellServDB update 31 October 2023
Update all three copies in the tree, and the rpm specfile.
Reviewed-on: https://gerrit.openafs.org/15601
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
26fdb47dba4852f3525db00c6eb72863d92d74fa)
Change-Id: I4468ff651da06236543e0c7ac7aee247ed03cfa3
Reviewed-on: https://gerrit.openafs.org/15603
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Ralf Brunckhorst <rbrunckhorst@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Mon, 18 Sep 2023 18:23:01 +0000]
Linux 6.6: Pass request_mask to generic_fillattr
The Linux 6.6 commit: "fs: pass the request_mask to generic_fillattr"
(
0d72b92883) added an additional parameter to Linux's
generic_fillattr() function.
For openafs, generic_fillattr() is called from the inode_operations
method "getattr", which is implemented in afs_linux_getattr(). The value
for the request_mask parameter is an existing parameter that is passed
to the inode_operations "getattr" method.
Add an autoconf test for 4 parameters to the generic_fillattr function
and update afs_linux_getattr() to pass the request_mask to
generic_fillattr().
Reviewed-on: https://gerrit.openafs.org/15561
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
4fed232b80fb1ad6c0e1dfb42ed8d8e1e6821dd7)
Change-Id: I5cddc56c5e605a6c5e4f7f3691eafec8ca589d2c
Reviewed-on: https://gerrit.openafs.org/15590
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Thu, 5 Oct 2023 20:44:49 +0000]
Linux 6.6: convert to ctime accessor functions
The Linux 6.6 commit "fs: add ctime accessors infrastructure"
(
9b6304c1d5) added accessor functions for an inode's ctime member.
A follow on commit "fs: rename i_ctime field to __i_ctime" (
13bc244578)
changed the name of the inode member ctime to __i_ctime to indicate it's
a private member.
Add an autoconf test for the ctime accessor function
'inode_set_ctime()'.
Add an afs_inode_set_ctime to LINUX/osi_machdep.h that is either defined
as a macro to Linux's inode_set_ctime, or implements a static inline
function to set a inode's ctime.
Convert the setting of an inode's ctime to use afs_inode_set_ctime().
For more information behind the Linux change, see the commit message
for:
"Merge tag 'v6.6-vfs.ctime'
of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs" (
615e95831)
Reviewed-on: https://gerrit.openafs.org/15560
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
072c7934cd1b99052882f02294f7036d422b6cf1)
Conflicts:
src/cf/linux-kernel-func.m4 (context)
Change-Id: I729408d12a7946f5778b036ca7e2c14299f3ce8e
Reviewed-on: https://gerrit.openafs.org/15589
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Tue, 29 Aug 2023 20:58:10 +0000]
linux: Replace fop iterate with fop iterate_shared
The Linux 6.5 commit:
'vfs: get rid of old '->iterate' directory operation' (
3e32715496)
removed the filesystem_operations iterate method. The replacement
method, iterate_shared, was introduced with the Linux 4.6 commit:
'introduce a parallel variant of ->iterate()' (
6192269444)
The above commits indicate that the iterate_shared is an "almost"
drop-in replacement for iterate. The vfs documentation for
iterate_shared has caveats on the implementation (serializing in-core
per-inode or per-dentry modifications and using d_alloc_parallel if
doing dcache pre-seeding). A wrapper is provided to assist filesystems
with the migration from iterate to iterate_shared. Until it can be
verified that afs_linux_readdir meets the above requirements, we will
use the wrapper (ref
3e32715496 commit)
Add configure tests for the iterate_shared file_operations member and
for the wrap_directory_iterator function.
Update osi_vnodeops.c to use iterate_shared and the wrapper if they are
both available.
Reviewed-on: https://gerrit.openafs.org/15528
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
7437f4d37719ea53711e06ac9675dad1abd6769e)
Change-Id: Id00cfab2c0b51c2167fe19cd9cf7f136450ff174
Reviewed-on: https://gerrit.openafs.org/15558
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>
Cheyenne Wills [Wed, 6 Sep 2023 17:41:55 +0000]
LINUX: Pass an array of structs to register_sysctl
The Linux 6.6 commit "sysctl: Add size to register_sysctl" (
9edbfe92a0)
renamed the Linux function register_sysctl() to register_sysctl_sz() and
added a size parameter. For backward compatibility, a macro,
register_sysctl, is provided. The macro calculates the size of the
ctl_table being registered and passes the size to register_sysctl_sz.
However, in order to perform the size calculation, an array of ctl_table
structures must be passed as the 2nd parameter.
This change only affects the autoconf test used to determine if Linux
provides register_sysctl.
Update the autoconf test for register_sysctl to use an actual ctl_table
structure for the 2nd parameter instead of a NULL.
Reviewed-on: https://gerrit.openafs.org/15559
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
76879b28798840fa0df441c328ada9667f06b154)
Change-Id: I9209d9fbc4514ab658f373510decfc2e81a5dc5f
Reviewed-on: https://gerrit.openafs.org/15575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Wed, 2 Aug 2023 21:02:57 +0000]
rx: Check for callNumber before NULL server call
In rxi_ReceiveServerCall(), we compare the callNumber in the given
packet to the callNumber on the conn's channel. If the packet's
callNumber is smaller, it indicates the packet is for an earlier call
that has since ended, and we ignore it.
However, we perform this check after checking whether we need to
allocate a new call (conn->call[channel] is NULL), or use an existing
call. If we allocate a new call, we don't check the conn's callNumber
at all, and unconditionally set it to the callNumber in the packet.
This means that if a server call ends and is successfully
rxi_FreeCall()'d, the server will accept any callNumber on the same
channel. If the server sees an old DATA packet from an earlier call
after this happens, it means the server can effectively re-run an RPC
that has already completed successfully, or that the client has
already seen fail.
A server can see a DATA packet for an old call under a variety of
situations, which is, after all, why we check it (dup'd/delayed
packets, the client could still be trying to run an old call, etc).
Seeing one for a freed call is less likely since that usually requires
more time to have passed, but is still possible.
Checking the callNumber was effectively moved in commit
99b43273c0
(rx: prevent connection channel assignment race) in the 1.7.x series.
This commit makes the check similar to how it was in 1.6.x and
earlier.
Reviewed-on: https://gerrit.openafs.org/15524
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
448e82b45268e8b339bdaa6ab0cd5858a04250a9)
Change-Id: I4a0c8a578cef32da8411bd33610aed9c67dc47c6
Reviewed-on: https://gerrit.openafs.org/15562
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Wed, 21 Jun 2023 19:56:29 +0000]
cf: Use static allocated structs for cf tests
The Linux kernel module build will issue a warning when a stack frame
exceeds a specific size via the -Wframe-larger-than= compiler flag (with
a default size of 2048 bytes on most architectures).
At least one distribution, Oracle's Linux with the Unbreakable
Enterprise Kernel (UEK), hardens this check by changing the warning to
an error (-Werror=frame-larger-than=).
Several of the openafs autoconf tests use objects that are allocated on
the stack when testing for structures, or members of a structure.
When the warning is changed to an error, configure fails in several
locations when testing against Linux's task_struct structure, which
exceeds 2048 bytes in size.
openafs/conftest.dir/conftest.c:72:1: error: the frame size of 9984
bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
Update the autoconf Linux tests that allocate structures to use a
statically allocated structure instead of one allocated on the stack.
Reviewed-on: https://gerrit.openafs.org/15477
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit
a939eb7ffd2517a127aeb02ebd962e00e9acb960)
Change-Id: Ib1d5b8218981890751187fbcf724dd6643356e98
Reviewed-on: https://gerrit.openafs.org/15549
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Thu, 25 May 2023 21:51:10 +0000]
clang: Don't redefine printf in salvage.c
The Gentoo distribution changed the default fortify_source setting for
clang (to match the default being used for gcc). This change causes the
following build error:
src/dir/salvage.c:26:9: error: 'printf' macro redefined
[-Werror,-Wmacro-redefined]
^
/usr/include/bits/stdio2.h:89:11: note: previous definition is here
^
1 error generated.
If the fortify_source level is greater than 1, glibc can define printf
as a macro. The clang compiler has a default check for macro
redefinitions (-Wmacro-redefined), while gcc does not provide this
option.
Remove the:
#define printf Log
in src/dir/salvage.c and update callers to use Log() instead of
printf().
Clean up lines that split the call to Log and its first parameter. Fix
the indentation for Log's parameters.
There are no functional changes with this commit.
Reviewed-on: https://gerrit.openafs.org/15462
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
df7f841f3852b5417a1d4ebc981780f2d7651b60)
Change-Id: I9a7d9e70184eb1dbd04f2b1a0e9a668138baaabe
Reviewed-on: https://gerrit.openafs.org/15548
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Tue, 24 Sep 2019 21:59:47 +0000]
Retire the AFS_PTR_FMT macro
Originally '%x' was commonly used as the printf specifier for formatting
pointer values.
Commit
37fc3b01445cd6446f09c476ea2db47fea544b7d introduced the
AFS_PTR_FMT macro to support platform-dependent printf format specifiers
for pointer representation. This macro defined the format specifier as
'%p' for Windows, and '%x' for non-Windows platforms.
Commit
2cf12c43c6a5822212f1d4e42dca7c059a1a9000 changed the printf
pointer format specifier from '%x' to '%p' on non-Windows platforms as
well, so at this point '%p' is the printf pointer format specifier for
all supported platforms.
Since the AFS_PRT_FMT macro is no longer platform-dependent, and all C89
compilers support the '%p' specifier, retire the macro to simplify the
printf format strings.
Reviewed-on: https://gerrit.openafs.org/13830
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
(cherry picked from commit
a133f1b1e7eb605c36ac16a6ed115bef03e8a004)
[cwills@sinenomine.net] As part of the 1.8.x pullup, remove AFS_PTR_FMT
from the files in src/xstat
Change-Id: I1fbb6a9b1c957adf45ca528d744a373809d1b780
Reviewed-on: https://gerrit.openafs.org/15547
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Mark Vitale [Mon, 4 Mar 2019 01:51:45 +0000]
dir: check afs_dir_MakeDir return code in DirSalvage
Since the original IBM import, DirSalvage() has ignored the return code
from afs_dir_MakeDir() (f.k.a. MakeDir). This has been safe because, as
the comment states, afs_dir_MakeDir returns no (non-zero) error code.
In preparation for a future commit, add a check for the return from
afs_dir_MakeDir and remove the comment.
Reviewed-on: https://gerrit.openafs.org/13799
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
0639ca8d221231309d59882a63e5a95a10cfdac3)
Change-Id: I13def0fdda5911b16704ba426c4fe2df389311a2
Reviewed-on: https://gerrit.openafs.org/15546
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Mark Vitale [Thu, 30 Jan 2020 19:04:05 +0000]
dir: distinguish logical and physical errors on reads
The directory package (src/dir) salvage routines DirOK and DirSalvage
check a global variable 'DErrno' to distinguish logical errors (e.g.
short read) from physical errors (e.g. EIO). However, since the
original IBM import, this logic has not worked correctly because there
is no longer any code that sets the value of DErrno - its value is
always zero.
Instead, modify all implementations of ReallyRead to optionally return
the errno for low-level IO errors.
Also, create a new userspace-only variant - DReadWithErrno() - of the
src/dir/buffer.c version of DRead (the version called by DirOK and
DirSalvage, and the only caller of ReallyRead) to return the ReallyRead
errno upon request.
Also create an analogous variant of afs_dir_GetBlobs,
afs_dir_GetBlobsWithErrno().
Finally, convert DirOK and DirSalvage to use the new variants and
replace DErrno with equivalent logic. Remove all other references to
DErrno.
Reviewed-on: https://gerrit.openafs.org/13798
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
735fa5fb090ee0efc2161597a3974f6fa45126f6)
Change-Id: Ic7b87d1de71feb7ae741b43d534a3d94cd277125
Reviewed-on: https://gerrit.openafs.org/15545
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Mark Vitale [Mon, 4 Mar 2019 06:37:53 +0000]
afs: refactor directory checking in DRead
Commit
d566c1cf874d15ca02020894ff0af62c4e39e7bb
'dread-do-validation-
20041012' modified directory checking (in the
afs_buffer.c implementation of DRead()) to use size information passed
to DRead, rather than obtained from the cache via afs_CFileOpen.
Because this directory checking does not require any information from
the cache buffers or the cache partition, we can make the check right
away, before searching the cache buffers or calling afs_newslot.
To clarify and simplify, move the directory sanity checking logic to the
beginning of DRead. Remove the afs_newslot cleanup logic which is no
longer needed.
While here, add Doxygen comments for DRead.
Reviewed-on: https://gerrit.openafs.org/13803
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
1aa7d3c199e77e3ebdffe9cea4dee8ee82e81fcd)
Change-Id: I53f4d330c5a4c44ae8619619ba9584006375bf29
Reviewed-on: https://gerrit.openafs.org/15544
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Wed, 8 Feb 2023 04:48:23 +0000]
vol: Re-evaluate conditons for cond vars
Most users of cond vars follow this general pattern when waiting for a
condition:
while (!condition) {
CV_WAIT(cv, mutex);
}
But a few places in src/vol do this:
if (!condition) {
CV_WAIT(cv, mutex);
}
It is important to always re-check for the relevant condition after
waiting for a CV, even if it seems like we only need to wait exactly
once, because pthread_cond_wait() is allowed to wake up its caller
spuriously even the CV hasn't been signalled. On Solaris, this can
actually happen if the calling thread is interrupted by a signal.
In VInitPreAttachVolumes() for DAFS, currently this can cause a
segfault if CV_WAIT returns while 'vq' is empty. We will try to
queue_Remove() the head of the queue itself, resulting in vq.head.next
being set to NULL, which will segfault when we try to pull the next
item off of the queue.
We generally cannot be interrupted by a signal when using opr's
softsig, because signals are only delivered to the softsig thread and
blocked in all other threads. It is technically possible to trigger
this situation on Solaris by sending the (unblockable) SIGCANCEL
signal, though this would be very unusual.
To make sure issues like this cannot happen and to avoid weird corner
cases, adjust all of our CV waiters to wait for a CV using a while()
loop or similar pattern. Spurious wakeups may be impossible with LWP,
but just try to make all code use a similar structure to be safe.
Thanks for mvitale@sinenomine.net for finding and investigating the
relevant issue.
Reviewed-on: https://gerrit.openafs.org/15327
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
9bc06a059121207b354fdf97f65029d8c2b3df30)
Change-Id: Ib1fdf06570e441b4a322a1e9b90ff084e07ad1fb
Reviewed-on: https://gerrit.openafs.org/15543
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Mon, 18 Jul 2022 23:17:26 +0000]
build: package ltmain.sh in the libafs_tree
Commit
0a58d2188[1] "cf: Run AFS_LT_INIT after setting CC" moved the
location of LT_INIT (libtool initialization) to a common macro, so it is
now expanded in configure-libafs. This breaks the linux DKMS packaging,
which uses configure-libafs to build the kernel module, since the
ltmain.sh aux file is not included in the dkms package.
For now, just include the ltmain.sh aux file in the libafs_tree files to
fix DKMS build. Later, we should restructure the autoconf macros so the
LT_INIT macro is not expanded in the configure-libafs configure script,
since we do not need libtool to build the kernel module.
Thanks to Alex T Prengel for reporting this issue on the openafs-info
mail list.
1)
0a58d21881d7e91deccb416e8d2c272e14b412dd cf: Run AFS_LT_INIT after setting CC
Reviewed-on: https://gerrit.openafs.org/15076
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
76f26c63c7fe9661dfcf267cf75638747c81b7ef)
Change-Id: I595811dec056b8ec4a7cf36f6f96532a1e452e4e
Reviewed-on: https://gerrit.openafs.org/15542
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Fri, 18 Feb 2022 01:32:41 +0000]
afs: Use literal NULL for NULL function pointer
The clang compiler complains that this function pointer cast is not a
prototype.
.../osi_file.c:141:27: error: this function declaration is not a
prototype [-Werror,-Wstrict-prototypes]
afile->proc = (int (*)())0;
^
void
Just use NULL instead of trying to create a cast to 0.
Reviewed-on: https://gerrit.openafs.org/14902
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
689fb56fca57274e73c8394e8588650449565cd8)
Change-Id: I61cf49178a80d011b0169a729c3a08e9829cddad
Reviewed-on: https://gerrit.openafs.org/15541
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Fri, 18 Feb 2022 01:27:02 +0000]
cf: Avoid nested C functions built by autoconf
Currently, two of the Linux-related autoconf macros try to compile code
containing nested C functions (AC_CHECK_LINUX_OPERATION and
LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID). For example, the
AC_CHECK_LINUX_OPERATION check for 'follow_link' generates this code
where 'op' is a nested function inside 'conftest':
#include <linux/module.h>
#include <linux/fs.h>
void conftest(void)
{
struct inode_operations ops;
const char *op(struct dentry *dentry, void **link_date) {
return (const char *)0;
};
ops.follow_link = op;
}
Nested functions are a gcc-specific feature, and are not supported by
other compilers (e.g. clang), causing these checks to always fail when
using clang, leading to incorrect configure results.
To fix this, change AC_CHECK_LINUX_OPERATION and
LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID macros to just define the
relevant function as a proper top-level function.
(these were discovered by forcing a clang build of both the Linux kernel
and the openafs kernel module)
Reviewed-on: https://gerrit.openafs.org/14901
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
a4878a5e26b9997e40a3b197cea5f8c3b24f2539)
Change-Id: Ie186658167a3f9e162fe85722aa0792cbe4fcfda
Reviewed-on: https://gerrit.openafs.org/15540
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Wed, 25 May 2022 18:54:50 +0000]
ukernel: Fix AFS_GUNLOCK panic in rx_ServerProc
At the beginning of UKERNEL's rx_ServerProc a call to AFS_GUNLOCK
panics with 'afs global lock not held'.
The commit 'afs: Drop GLOCK for various Rx calls' (
d5e1428a3b) altered
afs_RXCallBackServer so the global lock is released prior to calling
rx_ServerProc, and to reacquire the lock after rx_ServerProc returns.
Remove the AFS_GUNLOCK at the start and the AFS_GLOCK at the end of
UKERNEL's rx_ServerProc.
Reviewed-on: https://gerrit.openafs.org/14963
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
07076d63edfb9fe7a2311958e9410d5eadb227d9)
Change-Id: If7b0b755e693cb5d892d3300c47fbbdaf76f2f59
Reviewed-on: https://gerrit.openafs.org/15539
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Thu, 19 Aug 2021 16:52:30 +0000]
vlserver: Use bounded string copy in FindByName()
Although the volname string passed to FindByName() is currently always
limited 65 characters (including the terminating nul), to be on the safe
side, use the bounded strlcpy() function when coping the volname to the
temporary tname local variable to avoid the possibility of overwriting
the stack with an unbounded strcpy().
Reviewed-on: https://gerrit.openafs.org/14763
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
494ec08cd04da6f96be02c7dc22d9bb0c409d63b)
Change-Id: I87b225de7d4ce81a4017f47f2d5088ebffd7c66a
Reviewed-on: https://gerrit.openafs.org/15538
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Thu, 19 Aug 2021 15:47:04 +0000]
bozo: Log a warning if the bosserver is not started in restricted mode
Log a warning to the BosLog when the bosserver is not started in
restricted mode to encourage admins to enable restricted mode.
Also, log a notice when restricted mode is enabled to reassure admins
restricted mode is enabled on start up.
Reviewed-on: https://gerrit.openafs.org/14762
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
d91b92e308dc2ac2e489581839c1fc1bf9147e16)
Change-Id: Id35b089855797541bbc2f59982b3da7b4fab824e
Reviewed-on: https://gerrit.openafs.org/15537
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 26 Jul 2019 20:28:44 +0000]
afs: Let afs_ShakeLooseVCaches run longer
Currently, when afs_ShakeLooseVCaches runs osi_TryEvictVCache, we
check if osi_TryEvictVCache slept (i.e. dropped afs_xvcache/GLOCK). If
we sleep over 100 times, then we stop trying to evict vcaches and
return.
If we have recently accessed a lot of AFS files, this limitation can
severely reduce our ability to keep our number of vcaches limited to a
reasonable size. For example:
Say a Linux client runs a process that quickly accesses 1 million
files (a simple 'find' command) and then does nothing else. A few
minutes later, afs_ShakeLooseVCaches is run, but since all of the
newly accessed vcaches have dentries attached to them, we will sleep
on each one in order to try to prune the attached dentries. This means
that afs_ShakeLooseVCaches will evict 100 vcaches, and then return,
leaving us with still almost 1 million vcaches. This will happen
repeatedly until afs_ShakeLooseVCaches finally works its way through
all of the vcaches (which takes quite a while, if we only clear 100 at
once), or the dentries get pruned by other means (such as, if Linux
evicts them due to memory pressure).
The limit of 100 sleeps was originally added in commit
29277d96
(newvcache-dont-spin-
20060128), but the current effect of it was
largely introduced in commit
9be76c0d (Refactor afs_NewVCache). It
exists to ensure that afs_ShakeLooseVCaches doesn't take forever to
run, but the limit of 100 sleeps may seem quite low, especially if
those 100 sleeps run very quickly.
To avoid the situation described above, instead of limiting
afs_ShakeLooseVCaches based on a fixed number of sleeps, limit it
based on how long we've been running, and set an arbitrary limit of
roughly 3 seconds. Only check how long we've been running after 100
sleeps like before, so we're not constantly checking the time while
running.
Log a new warning if we exit afs_ShakeLooseVCaches prematurely if
we've been running for too long, to help indicate what is going on.
Reviewed-on: https://gerrit.openafs.org/14254
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
cd65475e95e25c8e7071e099a682bdcc03d2cce1)
Change-Id: I6c8e440a3c4dec5e6d769f40d9638a3edc6ad333
Reviewed-on: https://gerrit.openafs.org/15536
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Thu, 2 Jan 2020 18:18:16 +0000]
afs: Fix EIO error when reading a 4G or larger file
When reading a file with a file length of >= 4G, the cache manager is
failing the read with an EIO error.
In afs_GetDCache, the call to IsDCacheSizeOK is passed a parameter that
contains only the lower 32bits of the file length (which requires a 64
bit value). This results in the EIO error if the length is over 2^32 -1.
The AFSFetchStatus.Length member needs to be combined with the
AFSFetchStatus.Length_hi to obtain the full 64bit file length.
Fix the calls to IsDCacheSizeOK to use the full 64bit file length.
Commit "afs: Check dcache size when checking DVs
7c60a0fba11dd24494a5f383df8bea5fdbabbdd7" - gerrit 13436 - added the
IsDCacheSizeOK function and the associated calls.
As a note, the AFSFetchStatus.DataVersion is the lower 32 bits of the
full 64bit version number, AFSFetchStatus.dataVersionHigh contains
the high order 32bits. The function IsDCacheSizeOK is passed just the
32bit component, the only use of the parameter is in an error message.
Reviewed-on: https://gerrit.openafs.org/14002
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
bebae936b4ef3bf47624c0ff0baae5521bad804e)
Change-Id: I68f3ee04af25c7e99e0795804226ba5075af0ea8
Reviewed-on: https://gerrit.openafs.org/15535
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Mon, 29 Jul 2019 23:17:21 +0000]
afs: Skip IsDCacheSizeOK for CDirty/VDIR
IsDCacheSizeOK currently can incorrectly flag a dcache as corrupted,
since the size of a dcache may not match the size of the underlying
file in a couple of RW conditions:
- If someone is writing to a file beyond EOF, the intermediate
'sparse' area may be populated by 0-length dcaches until the data is
written to the fileserver.
- Directories may be modified locally instead of being fetched from
the fileserver, which can sometimes result in a directory blob of
differing sizes.
To avoid false positives detecting dcache corruption, just skip the
IsDCacheSizeOK check for directories, and any file with pending writes
(CDirty).
Also add some extra information to the logging messages when this
"corruption" is detected, so false positives may be more easily
detected in the future.
Reviewed-on: https://gerrit.openafs.org/13747
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
e6b97b337bc97fdb1c8e4f1a0572c62dfc82d979)
Change-Id: I177020c37ba92d8730fe4c68ca610f1b39c3d69b
Reviewed-on: https://gerrit.openafs.org/15533
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Thu, 17 Jan 2019 22:21:25 +0000]
afs: Check dcache size when checking DVs
Currently, if the dcache for a file has nonsensical length (due to
cache corruption or other bugs), we never notice, and we serve
obviously bad data to applications. For example, the vcache metadata
for a file may say the file is 2k bytes long, but the dcache for that
file only has 1k bytes in it (or more commonly, 0 bytes).
This situation is easily detectable, since the dcache and vcache refer
to the same version of the same file (when the DVs match), and so we
can check if the two lengths make sense together. So to avoid giving
bad data to userspace applications, perform a sanity check on the
lengths at the same time we check for DV matches (to see if the dcache
looks "fresh" and not stale). If the lengths do not make sense
together, we just pretend that the dcache is old, and so we'll ignore
it and fetch a new copy from the fileserver.
Also check the size of the data fetched from the fileserver for a
newly-fetched dcache in afs_GetDCache, to avoid returning a bad dcache
if the dcache isn't already present in the cache.
Reviewed-on: https://gerrit.openafs.org/13436
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
7c60a0fba11dd24494a5f383df8bea5fdbabbdd7)
Change-Id: I197d197f3f2eaf0473c76c60c9df842a3bed934a
Reviewed-on: https://gerrit.openafs.org/15532
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Marcio Barbosa [Sat, 11 Aug 2018 18:00:18 +0000]
volser: warn if older version of volume is restored
Volume restores work by overwriting vnodes with the data in the given
volume dump. If we restore a partial incremental dump from an older
version of the volume, this generally results in a partly-corrupted
volume, since directory vnodes may contain references that don't exist
in the current version of the volume (or are supposed to be in a
different directory).
Currently, the volserver does not prevent restoring older volume data
to a volume, and this doesn't necessarily always result in corrupted
data (for instance, if we are restoring a full volume dump over an
existing volume). But restoring old volume data seems more likely to
be a mistake, since reverting a volume back to an old version, even
without corrupting data, is a strange thing to do and may cause
problems with our methods of cache consistency.
So, log a warning when this happens, so if this is a mistake, it
doesn't happen silently. But we still do not prevent this action, since
it's possible something could be doing this intentionally. We detect
this just by checking if the updateDate in the given header is older
than the current updateDate for the volume on disk.
Note: Restoring a full dump file (-overwrite f) will not result in
corrupted data. In this scenario, the restore operation removes the
volume on disk first (if present). After that, the dump file is
restored. In this case, we do not log anything (the volume is not
corrupted).
Reviewed-on: https://gerrit.openafs.org/13251
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
8375a7f7dd0e3bcbf928a23f874d1a15a952cdef)
Change-Id: Ic119b0a7b1eac5e01fabbadc0aa679d5f2617d53
Reviewed-on: https://gerrit.openafs.org/15531
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Indira Sawant <indira.sawant@ibm.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Mon, 10 Jul 2023 00:45:15 +0000]
hcrypto: rename abort to _afscrypto_abort
The Linux 6.5 commit:
panic: make function declarations visible (
d9cdb43189)
added a declaration for abort into panic.h.
When building the Linux kernel module, the build fails with the
following:
src/crypto/hcrypto/kernel/config.h:95:20: error: static declaration of
‘abort’ follows non-static declaration
95 | static_inline void abort(void) {osi_Panic("hckernel aborting\n"
);}
| ^~~~~
...
from ./include/linux/wait.h:9,
from /openafs/src/afs/sysincludes.h:118,
from /openafs/src/crypto/hcrypto/kernel/config.h:30:
./include/linux/panic.h:36:6: note: previous declaration of ‘abort’
with type ‘void(void)’
36 | void abort(void);
| ^~~~~
Update the declaration in hcrypto/kernel/config.h to change the function
name from abort to _afscrypto_abort and use a preprocessor define to
map abort to _afscrypto_abort.
Reviewed-on: https://gerrit.openafs.org/15501
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
c4c16890d9d2829f6bef1ef58feafb30b1d59da3)
Change-Id: I54cc9156b98320d04fe6f7bb595a150d5ba87b49
Reviewed-on: https://gerrit.openafs.org/15523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Thu, 13 Jul 2023 16:54:22 +0000]
Linux 6.5: Use register_sysctl()
The linux 6.5 commit:
"sysctl: Remove register_sysctl_table" (
b8cbc0855a)
removed the Linux function register_sysctl_table(). The replacement
function is register_sysctl(), which offers a simpler interface.
Add an autoconf test for the Linux function register_sysctl and add a
call to register_sysctl when available.
Notes:
The Linux function register_sysctl was added in Linux 3.3 with the
commit:
'sysctl: Add register_sysctl for normal sysctl users' (
fea478d410)
with a note that it is a simpler interface.
The function register_sysctl_table was marked as deprecated with the
Linux 6.3 commit:
'proc_sysctl: enhance documentation' (
1dc8689e4c)
Reviewed-on: https://gerrit.openafs.org/15500
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
fb31d299e6caa015f6288ba9186da6277d3d6a8d)
Change-Id: I60f68f1dd95c32bada7179e98250fd44d7c2ddf3
Reviewed-on: https://gerrit.openafs.org/15522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 19 Jul 2019 03:56:48 +0000]
LINUX: Make sysctl definitions more concise
Our sysctl definitions are quite verbose, and adding new ones involves
copying a bunch of lines. Make these a little easier to specify, by
defining some new preprocessor macros.
Reviewed-on: https://gerrit.openafs.org/13700
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
1b0bb8a7fcbd69d513ed30bb76fd0693d1bd3319)
Change-Id: Ib656634ed956b845c89656069aa297253acce785
Reviewed-on: https://gerrit.openafs.org/15521
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Mon, 10 Jul 2023 00:52:23 +0000]
Linux 6.5: Replace generic_file_splice_read
The Linux 6.5 commit:
'splice: Remove generic_file_splice_read()' (
c6585011bc)
replaces the function generic_file_splice_read() with the function
filemap_splice_read().
The Linux function 'filemap_splice_read()' was introduced with the
Linux 6.3 commits:
'splice: Add a func to do a splice from a buffered file without
ITER_PIPE' (
07073eb01c)
'splice: Export filemap/direct_splice_read()' (
7c8e01ebf2)
With updates in Linux 6.5:
'splice: Fix filemap_splice_read() to use the correct inode'
(
c37222082f) -- which fixes a problem in the code.
'splice: Make filemap_splice_read() check s_maxbytes' (
83aeff881e)
Due to the fact that there could be problems with splice support prior
to Linux 6.5 (where filemap_splice_read()'s use was expanded to
additional filesystems other than just cifs), we only want to use
'filemap_splice_read()' in Linux 6.5 and later.
The LINUX/osi_vnodeops.c file is updated to use 'filemap_splice_read()',
for Linux 6.5 and later, for the splice_read member of the
file_operations structure.
Reviewed-on: https://gerrit.openafs.org/15486
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
0e06eb78f293bb295b0fe12da24abd8dc1160149)
Change-Id: I3b5436234d275253a37987dc40a522ae8f3cae1e
Reviewed-on: https://gerrit.openafs.org/15520
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Wed, 26 Aug 2020 20:41:00 +0000]
UKERNEL: Build linktest with COMMON_CFLAGS
Currently, 'linktest' in libuafs is built with a weird custom rule
that specifies several various CFLAGS and LDFLAGS, etc. One
side-effect of this is that linktest is built without specifying -O,
even if optimization is otherwise enabled.
Normally nobody would care about the optimization of linktest, since
it's never supposed to be run, but this can cause an error when
building with -D_FORTIFY_SOURCE=1 on some systems (such as RHEL7):
In file included from /usr/include/sys/types.h:25:0,
from /.../src/config/afsconfig.h:1485,
from /.../src/libuafs/linktest.c:15:
/usr/include/features.h:330:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
^
cc1: all warnings being treated as errors
make[3]: *** [linktest] Error 1
For now, to fix this just include $(COMMON_CFLAGS) in the flags we
give for linktest, so $(OPTMZ) also gets pulled in, and building
linktest gets a little closer to a normal compilation step.
Reviewed-on: https://gerrit.openafs.org/14324
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
c4f853aa00f1650b678cbd22ad1e2a9cf01c1303)
Change-Id: I842fc630979fa98950f09326a556da1f7d1cd23b
Reviewed-on: https://gerrit.openafs.org/15519
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Thu, 6 Jul 2023 20:11:23 +0000]
cf: Undef _FORTIFY_SOURCE for use-after-free check
Commit
f2003ed68c (gcc: Avoid false positive use-after-free in crypto)
added a configure check to detect whether the compiler we're using
exhibits the use-after-free warning bug. We add -O0 to CFLAGS for the
test to make sure the bug triggers for gcc 12, but if the user has
specified, for example, CFLAGS=-D_FORTIFY_SOURCE=1, this causes
the compile check to always fail:
/usr/include/features.h:330:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
# warning _FORTIFY_SOURCE requires compiling with optimization (-O)
This causes _OPENAFS_UAF_COMPILE_IFELSE to always fail, and so we
throw an AC_MSG_ERROR during configure.
To allow the build to continue with _FORTIFY_SOURCE, make sure
_FORTIFY_SOURCE is undefined for this specific test. The compile test
can then succeed with -O0 (unless we trigger the use-after-free bug,
of course).
Reviewed-on: https://gerrit.openafs.org/15499
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
2e6b80e4bcdb476e95c8cff46ebaae69f092abec)
Change-Id: Ibafe136c2d0364741f0ea2e3d823e181d7983f20
Reviewed-on: https://gerrit.openafs.org/15518
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Mark Vitale [Sat, 13 May 2023 03:51:48 +0000]
vol: Don't leak volume bitmaps
Since the original IBM code import, attach2 has set the volume's index
bitmaps to NULL in preparation for allocating and initalizing new
bitmaps. However, the volume may already have bitmaps from previous
operations, and this is much more likely with DAFS. In this case, the
old bitmaps are leaked.
Instead, free any existing bitmap before allocating a new one.
Discovered via Solaris libumem.so.1.
Reviewed-on: https://gerrit.openafs.org/15428
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
4b42b07fde2cb87ecb0f3135612a4c086227fa09)
Change-Id: I8d67a4ef75218acc6e5852b77b90e7898e78585e
Reviewed-on: https://gerrit.openafs.org/15517
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Mark Vitale [Sat, 13 May 2023 01:25:36 +0000]
rxkad: Free memory used to check rxkad response
Since its introduction with commit
7e4e06b87a09 "Derive DES/fcrypt
session key from other key types", rxkad_derive_des_key has failed to
free the memory associated with its HMAC context struct.
This results in a leak of at least 352 bytes for each rxkad challenge
response processed by an OpenAFS server when using rxkad-kdf.
Free the memory by calling HMAC_CTX_cleanup after each round of the
loop.
Discovered via Solaris libumem.so.1.
Reviewed-on: https://gerrit.openafs.org/15427
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
915c9ec007810f99a5ea8be73426fc8882f615fd)
Change-Id: I4710c1180cdca19cc963d7409ef15e74efd51498
Reviewed-on: https://gerrit.openafs.org/15516
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 7 Apr 2023 21:09:30 +0000]
LINUX: Make 'fs flush*' invalidate dentry
Our 'fs flush' and related commands (flushall, flushvolume) clear the
relevant entries in the OpenAFS stat cache and data cache, which can
fix problems if the cache ever becomes incorrect for any reason. (This
can happen after bugs, repairing corrupted volumes, disaster recovery
scenarios, and similar edge cases.)
However, on Linux, these commands don't affect the VFS dentry cache.
If someone needs to use an 'fs flush' command to fix a problem, this
will fix the OpenAFS cache, but the Linux dcache can still be wrong.
The only way to manually flush dcache entries is to use the global
'drop_caches' mechanism, which is a very heavweight operation, only
accessible to root.
For example:
$ ls -l
ls: cannot access foo.1: No such file or directory
total 2
drwxrwxr-x. 2 bin adeason 2048 Apr 6 14:20 dir
-?????????? ? ? ? ? ? foo.1
$ fs flush .
$ ls -l
ls: cannot access foo.1: No such file or directory
total 2
drwxrwxr-x. 2 bin adeason 2048 Apr 6 14:20 dir
-?????????? ? ? ? ? ? foo.1
$ sudo sysctl -q -w vm.drop_caches=3
$ ls -l
total 3
drwxrwxr-x. 2 bin adeason 2048 Apr 6 14:20 dir
-rw-rw-r--. 1 bin adeason 29 Sep 22 2022 foo.1
To make the 'fs flush' commands be effective in more situations,
change afs_ResetVCache() to also invalidate the dcache entries
associated with each vcache we reset. To make things simpler and
reduce locking complexity, do this by setting d_time to 0, and don't
directly run dcache-managing functions like d_invalidate or d_drop,
etc.
The above example now becomes:
$ ls -l
ls: cannot access foo.1: No such file or directory
total 2
drwxrwxr-x. 2 bin adeason 2048 Apr 6 14:20 dir
-?????????? ? ? ? ? ? foo.1
$ fs flush .
$ ls -l
total 3
drwxrwxr-x. 2 bin adeason 2048 Apr 6 14:20 dir
-rw-rw-r--. 1 bin adeason 29 Sep 22 2022 foo.1
Reviewed-on: https://gerrit.openafs.org/15391
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
d460b616ebad763f7e480e194b2bffc28df99721)
Change-Id: I184046469c396b0421752d91c47477ebe8eaed13
Reviewed-on: https://gerrit.openafs.org/15515
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Mon, 24 Aug 2020 17:12:13 +0000]
build: Add rpm target
Add a top-level makefile target to build RPMs for Red Hat distributions
from the currently checked out commit. The resulting rpms are placed in
the packages/rpmbuild/RPMS/<arch> directory.
The rpm target is intended to be a convenience for testing changes to
the rpm packaging or generating packages for local testing.
Reviewed-on: https://gerrit.openafs.org/14114
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
8b68f1a4e1e3ae06de0d6c5a8af60ef99cacb83a)
Change-Id: I31fcd579d9610303cb44b4813ecaf8dd00e09e7e
Reviewed-on: https://gerrit.openafs.org/15514
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Fri, 1 May 2020 18:05:24 +0000]
makesrpm: Support custom version strings
The makesrpm.pl script generates a source RPM by creating a temporary
rpmbuild workspace, populating the SOURCES and SPECS directories in that
workspace, running rpmbuild to build the source RPM, and finally copying
the resulting source RPM out of the temporary workspace.
The name of the source RPM file created by rpmbuild depends on the
package version and release strings. Unfortunately, the format of the
source RPM file name changed around OpenAFS 1.6.0, so makesrpm.pl has
special logic to find the version string and extra code depending on the
detected OpenAFS version.
Instead of trying to predict the name of the resulting source RPM file
from the OpenAFS version string, and having different logic for old
versions of OpenAFS, use a filename glob to find resulting source RPM
file name in the temporary rpmbuild workspace.
Remove the major, minor, and patch level variables, which were only used
to guess the name of the resulting source RPM file name.
Convert '-' characters to '_' in the package version and package
release, since the '-' character is reserved by rpm as a field
separator.
While here, add the --dir option to specify the path of the generated
source RPM, and change the 'srpm' makefile target to use the new --dir
option, instead of changing the current directory before running
makesrpm.pl. Also, add a dependency on the 'dist' makefile target,
since the the source and document tarballs are required to build the
source RPM.
Add pod documentation and add the --help (-h) option to print a brief
help message, and add the --man option to print the full man page.
With this change, we can build a source RPM even when the .version file
in the src.tar.bz file has a custom format or was created from a
checkout of the master branch or other non-release reference.
Reviewed-on: https://gerrit.openafs.org/14116
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
7cc6b97ad26089ecb88019468f3ef7c0222cebe1)
Change-Id: I6f533aa4dff42c8e256fd7cf07831e0f6c0b0c63
Reviewed-on: https://gerrit.openafs.org/15513
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Wed, 29 Mar 2017 19:58:24 +0000]
bozo: Do not create client directory and symlinks
Each time the bosserver starts, it checks for the presence of the client
configuration directory and the CellServDB and ThisCell files within it.
When not found, the bosserver creates the client cell configuration
directory. When the CellServDB and ThisCell files are not present in the
client configuration directory, the bosserver creates symlinks to the
server's CellServDB and ThisCell files. This feature of the bosserver
was a convenience when older versions of vos and pts required a client
configuration directory.
However, modern deployments tend to use packaging, with separate client
and server packages. The client configuration directory and files in it
are typically managed by the client packaging. Currently, packagers
must work around these symlinks created by the bosserver. Additionally,
the CellServDB and ThisCell symlinks are hazardous since writing to the
client-side configuration will overwrite the server configuration.
This commit removes the creation the client configuration directory and
the CellServDB and ThisCell symlinks during bosserver startup. This
change is intended to decouple the server from the client, help to avoid
overwriting the server configuration, and avoid requiring client artifacts
on a server.
Reviewed-on: https://gerrit.openafs.org/12586
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
c8aae4da4fcfd22c19fc9c8835960005554ac9d6)
Change-Id: I76d24eadaecd19d21f12b8bd85eca2a4888d3e4c
Reviewed-on: https://gerrit.openafs.org/15512
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Wed, 31 Aug 2022 17:41:30 +0000]
Add command fallback to server config
Add an initialization retry in the bos, vos, and pts commands to
fallback to the server configuration directory when initialization fails
with the client configuration directory. This allows admins to run
unauthenticated bos, vos, and pts commands on servers without a client
configuration (including symlinks created by the bosserver) without
any extra command line options.
Perform the initialization retry only when the -localauth or -config
options are not given. The bos, vos, and pts commands already use the
server configuration path when the -localauth option is given, so there
is no point in retrying the same path. The vos and pts -config option
specifies the path to be used, so we do not fallback to a different
directory when the user specifies the configuration path to be used.
While here, change the scope of the confdir variable in vos.c from a
global to a local variable, since it is only used within the
MyBeforeProc() function.
This change does not add a vsu_ClientInit() retry in the bos salvage
command. That command always requires authorization, so when run without
-localauth requires a token (and therefore a cache manager and client
cell configuration).
Update the bos, vos, and pts man pages to describe this new fallback
method to lookup the configuration directory. (The AFSCONF environment
variable and .AFSCONF files are currently undocumented in the man pages.
They should be documented or removed from the code in a future change.)
Reviewed-on: https://gerrit.openafs.org/15351
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
77eb1728331e0825ecb6fbe29db334c61b5276d0)
Conflicts: (1.8.x does not have rxgk support)
src/ptserver/pts.c
src/volser/vos.c
Change-Id: I1e0ffb8a074098ed6d4750d8e02cbfb8c0dbaff5
Reviewed-on: https://gerrit.openafs.org/15511
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Sat, 26 Oct 2019 00:04:44 +0000]
pts: Use cmd_AddParmAtOffset for common parms
Update pts to use cmd_AddParmAtOffset and symbolic constants for our
common parameters, instead of using bare literals like '16'.
Reviewed-on: https://gerrit.openafs.org/13946
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
d0941e81b2f1f499cebb57d8a81d82802913d9be)
Conflicts: (1.8.x does not have rxgk support)
src/ptserver/pts.c
Change-Id: I0bc2c6038c0d7983c6364ec186aef18105b02d3a
Reviewed-on: https://gerrit.openafs.org/15510
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 8 Jul 2022 22:14:26 +0000]
viced: Verify primary host address
Currently, h_stateVerifyHost verifies that all of the valid entries on
h->z.interface are on the host address hashtable. If we don't have a
h->z.interface, we check the primary address h->z.host/h->z.port
instead.
But if we do have a h->z.interface, we don't check h->z.host/h->z.port
at all. Normally, the primary address should always be included in the
h->z.interface list (in a 'valid==1' entry), and so checking the
primary address is redundant. However, currently it is possible in
some edge cases for the primary address to be missing from the
hashtable and to not be listed as a valid address in h->z.interface.
In such cases, we don't flag an error or even log a warning, since we
don't check the primary address separately. (These cases are bugs, and
will be addressed in future commits.)
To detect this case, change h_stateVerifyHost to always check
h->z.host, just like we do for the entries in h->z.interface.
Reviewed-on: https://gerrit.openafs.org/15070
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
9d144491d94e7e19e2d710601a37045ef1ef1fdc)
Change-Id: Icdd65c081372e1057df67401643973e1ac6f016e
Reviewed-on: https://gerrit.openafs.org/15509
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Mon, 3 Jul 2023 19:14:52 +0000]
gcc: Avoid false positive use-after-free in crypto
Due to a bug in gcc-12 and gcc-13, several warnings are generated for a
use-after-free in crypto.c, which leads to a build failure with
--enable-checking:
src/external/heimdal/krb5/crypto.c:1157:9: error: pointer ‘p’ may be
used after ‘realloc’ [-Werror=use-after-free]
1157 | free(p);
| ^~~~~~~
src/external/heimdal/krb5/crypto.c:1155:20: note: call to ‘realloc’
here
1155 | result->data = realloc(p, sz);
| ^~~~~~~~~~~~~~
However, reviewing the code around these warnings shows that the
use-after-free warnings are incorrectly generated (false positive). The
documentation for realloc states that realloc will return a NULL and not
alter the storage passed if there was an error allocating and the size
passed is non-zero.
There is a possible work-around for the false positive. One can use a
variable that is not a member of a structure to hold and test the value
returned from realloc, then update the structure member from that
variable.
However, the code that is producing the message is in a heimdal external
file, so we cannot modify the source. So just use the compiler flag
-Wno-use-after-free to avoid the warning/error.
Update configure to add tests for the -Wno-use-after-free flag, update
the Makefile to add the flag for CFLAGS.crypto.lo, and update CODING
for the new exception.
Because this is an important check, only disable the warning if the
compiler exhibits this specific bug. We do this by adding specific
configure tests for the compiler bug and conditionally set a CFLAG
variable if the bug is present.
NOTE: The false positive and work-around can be demonstrated with the
following code using gcc-12 (with -O0) or gcc-13 (not sensitive to the
optimization level):
somestruct->somepointer = realloc(ptr, somesize);
if (somestruct->somepointer == NULL && somesize != 0) {
free(ptr); << gets flagged as use-after-free
handle enomem...
}
However the following doesn't get flagged:
char *tmpptr = realloc(ptr, somesize);
if (tmpptr == NULL && somesize != 0) {
free(ptr);
handle enomem...
}
somestruct->somepointer = tmpptr;
The GCC ticket https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110501
has been marked as confirmed.
Reviewed-on: https://gerrit.openafs.org/15471
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit
f2003ed68c2fecf679d0b04146427258d39369ea)
Change-Id: Ib7ae86c66f0ef1fc12d4ff4b796b712dc97e2e13
Reviewed-on: https://gerrit.openafs.org/15508
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Tue, 27 Jun 2023 18:31:30 +0000]
cf: Fix cast-function-type err w/disable-checking
If the Linux kernel has CONFIG_WERROR enabled, and openafs is configured
with --disable-checking, the libafs kernel module fails to build:
/src/libafs/MODLOAD-5.14.0-305.el9.x86_64-MP/evp.c:501:9:
error: cast between incompatible function types from
‘void (*)(void *)’ to ‘int (*)(EVP_MD_CTX *)’ {aka
‘int (*)(struct hc_EVP_MD_CTX *)’} [-Werror=cast-function-type]
501 | (hc_evp_md_init)null_Init,
| ^
The openafs commit:
Linux-5.17: Kernel build uses -Wcast-function-type (
6bdfa97673)
fixed above error when the Linux kernel has CONFIG_WERROR enabled and
openafs is configured with --enable-checking. But we will still fail
when CONFIG_WERROR is enabled and openafs is configured with
--disable-checking (which is the default).
Update osconf.m4 to always set CFLAGS_NOCAST_FUNCTION_TYPE, so that it
can be used to avoid the above compiler check even when checking is
disabled.
NOTE: The only use of CFLAGS_NOCAST_FUNCTION_TYPE is to correct the
warnings flagged in external/heimdal/hcrypto/evp.c and evp-algs.c.
NOTE: --enable-checking=all can be used to bypass setting the define.
Reviewed-on: https://gerrit.openafs.org/15417
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit
2357ac6ae59ad1908b14b5e76e5931c7071ee9a2)
Change-Id: I96ccf89a7316449a0492d08dbfc0e625e143d933
Reviewed-on: https://gerrit.openafs.org/15507
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Kailas Zadbuke [Sun, 23 Apr 2023 14:36:00 +0000]
afs: Check UHasTokens in afs_GCUserData
It looks that EndTimestamp holds the user’s token expiration time even after
function afs_MarkUserExpired() gets called from afs_pag_destroy(). So it
seems that the PAGs/tokens are not being reclaimed. This will lead to pag
buildup on the system.
The PAG/'struct unixuser' is not being freed because afs_GCUserData() checks
afs_HasUsableTokens(), which checks EndTimestamp, which says the tokens still
haven't expired. So the PAG doesn't get freed.
This behavior has existed since commit
ba1d050c6e (Make unixuser's vid
advisory).
To fix this, change afs_GCuserData() to check for the UHasTokens flag, and
ignore any tokens if UHasTokens isn't set. This causes the PAG to be freed,
since we don't look at the EndTimestamp of the tokens at all.
Thanks Todd DeSantis for your support.
Signed-off-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-on: https://gerrit.openafs.org/15404
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
630d423897e5fffed1873aa9d12c4e74a8481041)
Change-Id: I74b1ea1173df904928ad027e48b231058c1e0f1d
Reviewed-on: https://gerrit.openafs.org/15506
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Stephan Wiesand [Thu, 29 Jun 2023 21:20:28 +0000]
Make OpenAFS 1.8.10
Update version strings for the 1.8.10 release, and add the
finishing touch to NEWS.
Change-Id: I5ade3bf8eb05474c5e4344e7c727545e807a0053
Reviewed-on: https://gerrit.openafs.org/15490
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Stephan Wiesand [Thu, 12 Jan 2023 17:06:30 +0000]
Make OpenAFS 1.8.10pre1
Update version strings for the first 1.8.10 prerelease.
Change-Id: I116eb9852e7799540fea4cd439f513d571231f45
Reviewed-on: https://gerrit.openafs.org/15282
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Stephan Wiesand [Thu, 18 May 2023 14:55:11 +0000]
Update NEWS for 1.8.10pre1
Release notes for the first 1.8.10 prerelease.
Change-Id: Ie7ed1b65444239528edcb4861ad3e99af54c4bbb
Reviewed-on: https://gerrit.openafs.org/15440
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 5 May 2023 21:47:45 +0000]
LINUX: Set .getattr for symlinks
On Linux, we can define a .getattr callback for files and directories,
which is called when a caller requests metadata for the file, such as
during lstat(). For regular files and directories, we set this to
afs_linux_getattr(), which updates the metadata for the file in
question if it's out of date (CStatd not set).
For symlinks, however, we don't set .getattr at all. This would seem
to allow symlink metadata to become stale if another client changes
it, but the metadata often happens to stay up to date via other means.
For example, we can see the following happen:
- Another client changes, for example, the owner of a symlink we have
cached.
- The fileserver sends us a callback break, and so we clear CStatd for
the vcache for the symlink.
- lstat() is called for the symlink, which causes
afs_linux_dentry_revalidate() to be called for the cached dentry.
Since CStatd is not set for the vcache, we verify the entry by
calling afs_lookup(), and then update the symlink's metadata via
afs_getattr() and vattr2inode().
However, if CStatd _is_ set for the symlink when lstat() is called,
afs_linux_dentry_revalidate() will not update anything, and will just
return success. So, if we manage to set CStatd for the symlink without
updating it's Linux VFS metadata, the Linux metadata won't be updated,
and we'll report the old metadata to the caller of lstat().
We can set CStatd without updating the Linux VFS info in a few
different ways. A few pioctls such as PRemoveMount or PFlushMount can
do this if they encounter an error, but the only code paths that call
these pioctls in OpenAFS (via the 'fs' utility) also lstat() the
relevant path, so this doesn't happen in practice.
A more common way that this can occur is via afs_DoBulkStat(). If
userspace triggers a bulkstat that includes the symlink in question,
the symlink would gain the CStatd flag without any interaction with
the Linux VFS.
For example, say a symlink was chown'd from 'adeason' to 'root'. On
another client with the symlink cached, running 'ls -l' on the symlink
itself would show the updated owner, because
afs_linux_dentry_revalidate() updates the metadata:
$ ls -l dir.slink
lrwxr-xr-x. 1 root root 3 May 5 14:48 dir.slink -> dir
But if we 'ls -l' the entire directory, which contains other entries,
we will bulkstat many of the entries, possibly including the symlink.
And so we may see the old metadata:
$ ls -l
total 9
[...]
lrwxr-xr-x. 1 adeason root 3 May 5 14:48 dir.slink -> dir
Triggering this behavior requires a bulkstat to be triggered before we
access the symlink itself, and so triggering this behavior depends on
the order of the entries in the directory as well as whether the other
items in the dir are cached. As such, triggering this behavior during
normal operation tends to be inconsistent and confusing.
The only lstat() info for symlinks that can change like this is the
owner, group, and modtime; mode bits cannot change, and neither can
the length/size (or the contents in general). So, stale metadata tends
to not be very noticeable.
To fix all of this, set .getattr to afs_linux_getattr() for symlinks,
just like we do for regular files and directories. This ensures that
we will update the Linux VFS metadata for the symlink when it is
requested, so we won't return stale metadata to callers.
This behavior appears to have existed for symlinks on Linux for quite
a while, possibly since our Linux 2.6 support was added. The behavoir
may have been introduced around commit
b860b359d58
(initial-linux24-support-
20001105) or commit
00543744955
(linux22-fix-
20040405). Before those commits, we defined a .revalidate
callback for symlinks, which was called on older Linux versions before
fetching file metadata, and so probably ensured that an lstat() on a
symlink returned properly updated info.
Reviewed-on: https://gerrit.openafs.org/15423
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
2b32b130f534068251ce9fd1b621de6e480d56d7)
Change-Id: I194308e2a4783cc3205c6cfd54880421635f6b38
Reviewed-on: https://gerrit.openafs.org/15443
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Wed, 26 Aug 2020 18:54:00 +0000]
Retire AFS_MOUNT_AFS
Currently, the AFS_MOUNT_AFS #define is used to mean two completely
different things:
- The string "afs", corresponding to the first argument to mount(2) on
many platforms and some related calls inside libafs (e.g.
getnewvnode() on FBSD).
- An integer identifying the AFS filesystem (e.g. gfsadd() on AIX).
Depending on the platform and the build context (UKERNEL vs KERNEL),
AFS_MOUNT_AFS gets defined to one of those two things. This is very
confusing, and has led to mistakes in the past, such as those fixed in
commit
446457a1 (afs: Set AFS_VFSFSID to a numerical value).
To avoid such confusion, get rid of AFS_MOUNT_AFS completely, and
replace it with two new symbols:
- AFS_MOUNT_STR, the string "afs".
- AFS_FSNO, the integer given to gfsadd() et al.
When AFS_MOUNT_AFS is split this way, AFS_MOUNT_STR then is always
defined to the same value, so remove it from the param.h files for our
platforms. Instead, define it in afs.h for libafs use, and in
afsd_kernel.c (the only place outside of src/afs that uses it).
Also remove the logic for conditionally defining MOUNT_AFS from the
param.h files, moving the logic to the same locations as
AFS_MOUNT_STR.
Note that this commit removes the numeric definition for AFS_MOUNT_AFS
in param.sgi_65.h (aka AFS_FSNO). We never actually used this value,
since AFS_FSNO is not used on IRIX; instead, we tend to use the
'afs_fstype' global instead of a constant number.
Reviewed-on: https://gerrit.openafs.org/14323
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
6b96a49eb6268adf9fc7e077fe849af7802a1575)
Change-Id: Iebb35b323ceb50f9603387c46168b80ec800735d
Reviewed-on: https://gerrit.openafs.org/15422
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Tested-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Benjamin Kaduk [Tue, 16 Aug 2022 14:48:02 +0000]
rxevent: fix mismatched #endif
We should only assign to 'ev' once, rather than assigning a second
time to an uninitialized value.
Reported by Ben Huntsman and diagnosed by Jeffrey Altman.
Reviewed-on: https://gerrit.openafs.org/15106
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
e51ed7be3849025e9b47d1a644a4fcd99b774b30)
Change-Id: I06ac2155170d8f005afd9551c69d5ef3e60afff3
Reviewed-on: https://gerrit.openafs.org/15442
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Tested-by: Ben Huntsman <ben@huntsmans.net>
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>
Andrew Deason [Mon, 19 Jul 2021 04:05:38 +0000]
opr: Avoid sigwait on SIGWAITING
On AIX, calling sigwait() on a sigset containing SIGWAITING (or
SIGKILL or SIGSTOP), causes sigwait to return with an EINVAL error.
Currently, signalHandler() calls sigwait() with SIGWAITING, because
SIGWAITING is in the sigset returned by softsigSignalSet(). And so,
sigwait() returns EINVAL, and our opr_Verify in signalHandler() fails,
causing a crash.
To avoid this, remove SIGWAITING from the sigset in
softsigSignalSet(). This is AIX-specific, since the SIGWAITING signal
is AIX-specific.
Reviewed-on: https://gerrit.openafs.org/14705
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
c2db41258370159c1257ee79df10afa4a2a2d9e8)
Change-Id: I433e4842b684c5f0f453e20d2f5d455b10a792eb
Reviewed-on: https://gerrit.openafs.org/15441
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Thu, 4 May 2023 23:52:38 +0000]
AIX: Free pinned_heap during shutdown to prevent kernel panic
During shutdown, the function shutdown_osisleep is called in
src/afs/afs_osi.c. The body of this function is platform-
specific, and on AIX there is a call to xmfree:
xmfree(tmp);
However, on AIX, xmfree actually takes two arguments:
int xmfree ( ptr, heap)
caddr_t ptr;
caddr_t heap;
This is called elsewhere in the OpenAFS code correctly for
kernel_heap. In src/afs/AIX/osi_sleep.c we start using the
pinned_heap, but never xmfree it. Therefore, we need to do so here
during the shutdown. Here we include a header file which defines
pinned_heap, and then supply it as an argument to xmfree. This
prevents a kernel panic during OS shutdown.
The panic might go unnoticed in many environments, as during a
reboot, the system will normally dump and restart anyway. However,
if kdb is loaded (bosboot -a -D), the system will break into the
debugger before the full shutdown procedure completes. The stack
trace shows the following:
KDB(0)> stack
pvthread+01D200 STACK:
[
00023900]abend_trap+000000 ()
[
000EFF24]xmfree_frontend+0000A4 (??, ??, ??)
[
F1000000C064CF1C]shutdown_osisleep@AF72_5+0000BC (??)
[
F1000000C064CB7C]shutdown_osi+00001C ()
[
F1000000C064A51C]afs_shutdown+0003BC (
0000000100000001)
[
F1000000C05A8DD4]afs_unmount+000094 (
F1000A01501D4C10,
0000000000000000)
[
F1000000C059FCE0]vfs_unmount+0000A0 (
F1000A01501D4C10,
0000000000000000,
F1000A015047B07C)
[
00014D70].hkey_legacy_gate+00004C ()
[
006A6AAC]vfs_unmount+00008C (??, ??, ??)
[
006B4228]kunmount+000228 (??, ??, ??, ??)
[
006B4944]uvmount+000204 (??, ??)
[
00003954]syscall+00024C ()
[
100084FC]helper_UMfunc+00027C (??, ??)
[
10003D48]dounmount+0000C8 (??, ??, ??, ??)
[
100044DC]umountmain+0001BC (??, ??)
[
10000AD4]main+0000B4 (??, ??)
[
10000168]__start+000068 ()
Reviewed-on: https://gerrit.openafs.org/15419
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
4810cca10bc32df7ba7809fc2bf095d20e2febd8)
Change-Id: I687caa6daae83fc7986e76d370b55f90f5ca53cc
Reviewed-on: https://gerrit.openafs.org/15425
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Tested-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Thu, 4 May 2023 17:00:43 +0000]
AIX: AFS_SMALLOCSIZ too small on newer OS releases
Addresses a situation where a write in AFS space can cause a kernel
panic. In src/afs/afs_osi_uio.c in the function afsio_partialcopy:
size_t space_len = sizeof(struct uio) +
sizeof(struct iovec) * AFS_MAXIOVCNT;
/* Allocate a block that can contain both the UIO and the iovec */
space = osi_AllocSmallSpace(space_len);
On newer AIX systems (since at least 6.1), space_len is larger than
AFS_SMALLOCSIZ. When osi_AllocSmallSpace is called, the following
test in src/afs/afs_osi_alloc.c causes a kernel panic:
if (size > AFS_SMALLOCSIZ)
osi_Panic("osi_AllocSmallS: size=%d\n", (int)size);
This is due to the following definition in src/config/afs_args.h:
/*
* Note that the AFS_*ALLOCSIZ values should be multiples of sizeof(void*) to
* accomodate pointer alignment.
*/
/* Used in rx.c as well as afs directory. */
/* XXX Because of rxkad_cprivate... XXX */
All the supported AIX platforms define AFS_AIX32_ENV in
src/config/param.rs_aixXX.h, where XX is the AIX version. Therefore,
all the AIX platforms end up with AFS_SMALLOCSIZ = 152 bytes instead
of 256. To resolve this, we will modify the preprocessor test to use
the second case for AIX versions greater than 6.1. This issue may be
present on earlier releases of AIX as well, but AIX 5.3 and older
test systems were not available at this time.
Also, a spelling error in the comment was fixed.
Reviewed-on: https://gerrit.openafs.org/15418
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
8a2d4faa73d0f2e03a4016d7f84c5d5437040cec)
Change-Id: I5a2fc4ad1a829f1ee30387da20ce477c84fa020f
Reviewed-on: https://gerrit.openafs.org/15424
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Tested-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Thu, 27 Apr 2023 15:49:03 +0000]
Linux: Clear msghdr structure before use
The msghdr structure is used as a parameter to the Linux kernel
functions kernel_sendmsg() and kernel_recvmsg(). Some required fields
need to be set prior to calling these functions, but there are also
additional structure members that may not be used by the calling code.
Some of these fields may be initialized by the Linux kernel functions
being used, but there may be some that are left uninitialized.
To ensure that all fields in the msghdr structure are cleared, use
memset to zero the entire structure. This will eliminate the need to set
individual fields to 0 or NULL.
Reviewed-on: https://gerrit.openafs.org/15409
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
795ef90d4041f1a5a1139435cc70f96457e0f64b)
Change-Id: Id037e2e548c27b23e2746f804ddcaf7b79d905c4
Reviewed-on: https://gerrit.openafs.org/15411
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Tue, 25 Apr 2023 16:37:01 +0000]
Linux: Do not initialize msghdr's msg_iter/msg_iov
Since the initial Linux commit (2.6.12-rc2) the Linux function
kernel_recvmsg() handles the initialization of the msghdr members
related to the iov (msghdr.msg_iter and for earlier kernels
msghdr.msg_iov and msghdr.msg_iovlen).
The code in osi_NetReceive for Linux unnecessarily initializes these
structure members prior to calling kernel_recvmsg().
Remove the unnecessary code from osi_NetReceive along with the
surrounding preprocessor check for STRUCT_MSGHDR_HAS_MSG_ITER. Since
this is the only location that uses this define, also remove the
associated autoconf test.
NOTE: This was discovered while investigating changes needed for
Linux 6.4, due to: "iov_iter: add iter_iovec() helper" (
de4f5fed3f)
which renamed the Linux structure iter_iovec's member iov to __iov.
Since the openafs code that was affected by the Linux 6.4 change is
being removed as unnecessary, this commit is not Linux 6.4 specific,
but effects all versions of Linux.
Reviewed-on: https://gerrit.openafs.org/15408
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
5a7630acfd8bfd462b633475a6e195d9dbdfb451)
Change-Id: I3a803f76ab84f1e055e91cf4f2be96440f141746
Reviewed-on: https://gerrit.openafs.org/15410
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 16 Jul 2021 00:59:47 +0000]
AIX: Fix undefined symbols
Various pieces of our code try to use symbols in our internal
libraries that are not exported in the respective .sym file. On AIX,
this causes the following build failures:
ld: 0711-317 ERROR: Undefined symbol: .ubik_CallRock
ld: 0711-317 ERROR: Undefined symbol: DISK_function_names
ld: 0711-317 ERROR: Undefined symbol: VOTE_function_names
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:45: afscp] Error 8
make[4]: Leaving directory '/.../src/libadmin/test'
ld: 0711-317 ERROR: Undefined symbol: PR_function_names
ld: 0711-317 ERROR: Undefined symbol: KAA_function_names
ld: 0711-317 ERROR: Undefined symbol: KAT_function_names
ld: 0711-317 ERROR: Undefined symbol: KAM_function_names
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:117: rxstat_get_peer] Error 8
make[4]: Leaving directory '/.../src/libadmin/samples'
ld: 0711-317 ERROR: Undefined symbol: .osi_audit_cmd_Options
ld: 0711-317 ERROR: Undefined symbol: .osi_audit_open
ld: 0711-317 ERROR: Undefined symbol: .afsconf_SuperIdentity
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:71: butc] Error 8
make[3]: Leaving directory '/.../src/tbutc'
ld: 0711-317 ERROR: Undefined symbol: .pr_Initialize2
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:111: pts] Error 8
make[3]: Leaving directory '/.../src/tptserver'
ld: 0711-317 ERROR: Undefined symbol: .AFSVolListPartitions
ld: 0711-317 ERROR: Undefined symbol: .AFSVolXListPartitions
ld: 0711-317 ERROR: Undefined symbol: .RXAFS_GetStatistics64
ld: 0711-317 ERROR: Undefined symbol: .AFSVolPartitionInfo64
ld: 0711-317 ERROR: Undefined symbol: .AFSVolPartitionInfo
ld: 0711-317 ERROR: Undefined symbol: .RXAFS_GetStatistics
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:65: fsprobe_test] Error 8
make[3]: Leaving directory '/.../src/fsprobe'
ld: 0711-317 ERROR: Undefined symbol: fsprobe_Results
ld: 0711-317 ERROR: Undefined symbol: gtxframe_exitValue
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:45: scout] Error 8
make[3]: Leaving directory '/.../src/scout'
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_toString
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_freeString
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:50: check_sysid] Error 8
make[3]: Leaving directory '/.../src/viced'
ld: 0711-317 ERROR: Undefined symbol: .GetLogLevel
make[3]: *** [Makefile:130: fileserver] Error 8
make[3]: Leaving directory '/.../src/viced'
ld: 0711-317 ERROR: Undefined symbol: .GetLogDest
ld: 0711-317 ERROR: Undefined symbol: .GetLogFilename
ld: 0711-317 ERROR: Undefined symbol: .CloseLog
make[3]: *** [Makefile:166: salvageserver] Error 8
make[3]: Leaving directory '/.../src/tsalvaged'
ld: 0711-317 ERROR: Undefined symbol: .rxkad_StringToLevel
ld: 0711-317 ERROR: Undefined symbol: .FilepathNormalize
ld: 0711-317 ERROR: Undefined symbol: .ConstructLocalPath
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:32: upserver] Error 8
make[3]: Leaving directory '/.../src/update'
ld: 0711-317 ERROR: Undefined symbol: xstat_fs_Results
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:77: xstat_fs_test] Error 8
make[3]: Leaving directory '/.../src/xstat'
ld: 0711-317 ERROR: Undefined symbol: .afsconf_DeleteKeyBySubType
ld: 0711-317 ERROR: Undefined symbol: .afsconf_DeleteKeyByType
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[3]: *** [Makefile:35: asetkey] Error 8
make[3]: Leaving directory '/.../src/aklog'
ld: 0711-317 ERROR: Undefined symbol: .afsconf_FindService
ld: 0711-317 ERROR: Undefined symbol: .afsconf_AddKey
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetLatestKeyByTypes
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:19: authcon-t] Error 8
make[4]: Leaving directory '/.../tests/auth'
ld: 0711-317 ERROR: Undefined symbol: .afsconf_AddUser
ld: 0711-317 ERROR: Undefined symbol: .afsconf_IsSuperIdentity
ld: 0711-317 ERROR: Undefined symbol: .afsconf_AddIdentity
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetNthUser
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetNthIdentity
ld: 0711-317 ERROR: Undefined symbol: .afsconf_DeleteUser
ld: 0711-317 ERROR: Undefined symbol: .afsconf_DeleteIdentity
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:25: superuser-t] Error 8
make[4]: Leaving directory '/.../tests/auth'
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetKeys
ld: 0711-317 ERROR: Undefined symbol: .rx_opaque_new
ld: 0711-317 ERROR: Undefined symbol: .rx_opaque_free
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetKeyByTypes
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetKeysByType
ld: 0711-317 ERROR: Undefined symbol: .afsconf_PutTypedKeyList
ld: 0711-317 ERROR: Undefined symbol: .afsconf_GetLatestKeysByType
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[4]: *** [Makefile:31: keys-t] Error 8
make[4]: Leaving directory '/.../tests/auth'
ld: 0711-317 ERROR: Undefined symbol: ._afsconf_Touch
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[1]: *** [Makefile:34: realms-t] Error 8
make[1]: Leaving directory '/.../tests/auth'
ld: 0711-317 ERROR: Undefined symbol: .opr_cache_get
ld: 0711-317 ERROR: Undefined symbol: .opr_cache_put
ld: 0711-317 ERROR: Undefined symbol: .opr_cache_init
ld: 0711-317 ERROR: Undefined symbol: .opr_cache_free
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[1]: *** [Makefile:16: cache-t] Error 8
make[1]: Leaving directory '/.../tests/opr'
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_isNil
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_equal
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_hash
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_fromString
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_create
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_unpack
ld: 0711-317 ERROR: Undefined symbol: .opr_uuid_pack
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[1]: *** [Makefile:37: uuid-t] Error 8
make[1]: Leaving directory '/.../tests/opr'
ld: 0711-317 ERROR: Undefined symbol: .rxevent_Init
ld: 0711-317 ERROR: Undefined symbol: .rxevent_Post
ld: 0711-317 ERROR: Undefined symbol: .rxevent_Cancel
ld: 0711-317 ERROR: Undefined symbol: .rxevent_RaiseEvents
ld: 0711-317 ERROR: Undefined symbol: .rxevent_Put
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make[1]: *** [Makefile:18: event-t] Error 8
make[1]: Leaving directory '/.../tests/rx'
To fix these, export the relevant symbols from the library's .sym
file.
Reviewed-on: https://gerrit.openafs.org/14707
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
9656a6b92b86849aa964529947bacb5aea4d83eb)
Backport notes:
The following symbols are not present in the 1.8.x branch at this time,
so removed from this backported patch:
* afsconf_GetLatestRXGKKey
* opr_cache_free
* opr_cache_get
* opr_cache_init
* opr_cache_put
* osi_audit_close
* osi_audit_cmd_Options
* osi_audit_open
* pr_Initialize2
* ubik_CallRock
The following symbol files are not present in the 1.8.x branch at this
time, so were removed from this backported patch:
* src/fsprobe/liboafs_fsprobe.la.sym
* src/gtx/liboafs_gtx.la.sym
* src/xstat/liboafs_xstat_fs.la.sym
Change-Id: Idd7059fe9e372d9131fa575412b391f03cb24bb3
Reviewed-on: https://gerrit.openafs.org/15403
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 7 Apr 2023 19:10:58 +0000]
LINUX: Introduce afs_d_alias_foreach
We have a couple of places in the code that iterate over the dentry
aliases of an inode, and each of these involves a small #ifdef ladder
to handle slightly different ways of traversing the relevant list.
Split this logic into its own compatibility macro,
afs_d_alias_foreach[_reverse], to contain this ugliness in
osi_compat.h and make the callers more readable.
This commit should incur no functional change; it is just code
reorganization.
Reviewed-on: https://gerrit.openafs.org/15390
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
5aaed53f07fae0856e6da9defc408960e72364a7)
Change-Id: I107c01917512da6c1043880cb93754be37919c47
Reviewed-on: https://gerrit.openafs.org/15401
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Mon, 15 Jul 2019 21:24:10 +0000]
afs: Fix a few ARCH/osi_vcache.c style errors
Most of the ARCH/osi_vcache.c implementations were defining functions
like:
void
osi_foo(args) {
/* impl */
}
But our prevailing style is:
void
osi_foo(args)
{
/* impl */
}
Fix them to follow our prevailing style, and fix a couple of the more
obvious errors with identation and goto label.
Reviewed-on: https://gerrit.openafs.org/13699
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
ee7019a7630d01f29fecebd89ca69ad8a37e24e2)
Change-Id: I2a34a0d8fd7b6c3721ede0c40c212c3993402235
Reviewed-on: https://gerrit.openafs.org/15400
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Wed, 29 Mar 2023 18:11:38 +0000]
Linux 6.3: Use mnt_idmap for inode op functions
Through a series of Linux 6.3 commits starting with:
'f2fs: project ids aren't idmapped' (
64b4cdf22f) and ending with
'fs: move mnt_idmap' (
3707d84c13)
the inode operations functions were changed to take a mnt_idmap
structure instead of a user_namespace structure. These were pulled in
via the the merge commit:
'Pull vfs idmapping updates from Christian Brauner' (
05e6295f7b)
The commit message for the merge contains background and overall
information for this conversion.
The above change simply changes the functions to use a different
structure (mnt_idmap instead of user_namespace). For afs, it is a
simple change to swap the structures. But for some of the Linux calls
(generic_fillattr(), setattr_prepare(), and inode_op->setattr()) we
would like to use the Linux symbol nop_mnt_idmap, but that symbol is
exported as GPL only. Instead, we will obtain its address from the
current task structure at libafs initialization (much the same way as
obtaining current user namespace for afs_ns).
Add autoconf tests to determine if inode_operations.create() uses the
mnt_idmap structure. If so set a generic configure define for
"IOP_TAKES_MNT_IDMAP".
Update afs's inode operations functions to take and use a mnt_idmap
instead of a user_namespace.
At libafs initialization, obtain the mnt_idmap from the current task
and save it as an afs global variable, afs_mnt_idmap, to be used where
needed.
Reviewed-on: https://gerrit.openafs.org/15347
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
858ee34545e57acab1e4e5813cd1b9a011538b9e)
Change-Id: If89c6f401db04826ef45de83b91240f106cca616
Reviewed-on: https://gerrit.openafs.org/15389
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Wed, 22 Mar 2023 22:56:09 +0000]
Linux 6.3: Include linux/filelock.h if available
Linux 6.3 commit
'filelock: move file locking definitions to separate header file'
(
5970e15dbc)
relocated file lock related declarations from 'linux/fs.h' into its own
header file, 'linux/filelock.h'.
Add autoconf tests to check for the header file 'linux/filelock.h' and
update function checks for locks_lock_file_wait() and posix_lock_file().
Update osi_compat.h to include linux/filelock.h if it is available.
Reviewed-on: https://gerrit.openafs.org/15346
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
(cherry picked from commit
6873dc925c5acc0ce7d65cf778ffee09c82a9898)
Change-Id: If131bee5b466a119f54b05388a065e6af23698cf
Reviewed-on: https://gerrit.openafs.org/15388
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Kailas Zadbuke <kailashsz@in.ibm.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Tue, 31 Jan 2023 17:28:49 +0000]
AIX: Avoid including net/netisr.h on AIX 7.2 and above
On AIX 7.2 and higher, /usr/include/net/netisr.h includes a header
<sys/libsysp.h>. This is an internal kernel library header that IBM
does not ship. The include of sys/libsysp.h is new in AIX 7.2. The
only information we need from net/netisr.h are the definitions for
NETISR_MAX and NET_KPROC. Using the macro AFS_AIX72_ENV, defined in
src/config/param.rs_aix72.h and param.rs_aix73.h, we can just
provide these definitions directly and avoid the include of
net/netisr.h. As part of this update we also add the macro
AFS_AIX72_ENV to src/config/param.rs_aix72.h as it was missing there
but is required for the edit to src/rx/AIX/rx_knet.c to work. On
earlier versions of AIX, we will continue to include net/netisr.h. A
case has been opened with IBM and they acknowledge the problem and
are working on a solution. However, we still need to be able to deal
with the situation as shipped from IBM. A future AIX 7.4 will likely
be able to include net/netisr.h again.
Reviewed-on: https://gerrit.openafs.org/15312
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
ca67e8c84891200398e577d76c0125966d22b01e)
Change-Id: Icc3e241e09876a4e9ed3e779c1ba904e0762f92c
Reviewed-on: https://gerrit.openafs.org/15386
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Tue, 31 Jan 2023 01:11:32 +0000]
comerr: Update rule for compile_et
Update the build rule for compile_et under new platform rs_aix73.
Reviewed-on: https://gerrit.openafs.org/15311
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
b713b62b3358482a818436a54975596188cb002b)
Change-Id: I726cf21a2c70305c24c3f43f2504e70a98536aa7
Reviewed-on: https://gerrit.openafs.org/15385
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Tue, 31 Jan 2023 01:08:20 +0000]
configure: Add platform rs_aix73
Enable the configure script to detect and configure AIX 7.3.
Update INSTALL to reflect new platform.
Reviewed-on: https://gerrit.openafs.org/15310
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
d03723e87a16e19a34950ca84a6139095a0694f9)
Change-Id: I6727512ee343b3ee4cbb03c1e6242a69f407b987
Reviewed-on: https://gerrit.openafs.org/15384
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Thu, 25 Aug 2022 18:58:31 +0000]
INSTALL: Update INSTALL to reflect AIX platforms
Update the INSTALL file to reflect the current rs_aix platforms
that we can build for.
Reviewed-on: https://gerrit.openafs.org/15142
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
4580f213b3a25dd57e6fd721f7ecc0ecad84fb07)
Change-Id: I3e0d62258e57ff6a54fae2e49a427c764e03a9ae
Reviewed-on: https://gerrit.openafs.org/15383
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Thu, 25 Aug 2022 21:53:00 +0000]
AIX: Fix issue with make install on AIX 7.1 and higher
Added rules to src/export/Makefile.in for the install target
under AIX 7.1 and higher.
Reviewed-on: https://gerrit.openafs.org/15146
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
f4fc18b80e81f10b17729ef06cca6a9548d36130)
Change-Id: I0fcc1429111eaafa489adec330b5eb900022293e
Reviewed-on: https://gerrit.openafs.org/15382
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Thu, 25 Aug 2022 19:00:51 +0000]
configure: Add platform rs_aix71
Enable the configure script to detect and configure AIX 7.1.
Reviewed-on: https://gerrit.openafs.org/15143
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
1aeac365712f09ac90fe251c90b889548e25ac89)
Change-Id: I469d94701d3554e74cfdc78686a83e7333210ad4
Reviewed-on: https://gerrit.openafs.org/15381
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Thu, 25 Aug 2022 21:23:51 +0000]
libafs: Add support for AIX 7.1, 7.2
src/libafs/MakefileProto.AIX.in contains rules for various versions of
AIX, but did not have any case for AIX 7.1 or 7.2 This causes build
failures on those platforms. Added in the missing entries for rs_aix71
and rs_aix72.
Reviewed-on: https://gerrit.openafs.org/15145
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
0c43fe64dd885aed1ec1be4a2419e6396e583ec5)
Change-Id: I68315c09eb3d6b2e30ea759d4f9bf5726a98e5d7
Reviewed-on: https://gerrit.openafs.org/15380
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Thu, 25 Aug 2022 20:15:11 +0000]
AIX: Correctly create export64.exp on AIX 7.1+
Create the export64.exp file on AIX 7 and higher.
Reviewed-on: https://gerrit.openafs.org/15144
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
ba3e1410d5df4454dc4dc63e1404a261977b0f60)
Change-Id: I7ec71522f8e35ede3532e3b1d77623ef25510561
Reviewed-on: https://gerrit.openafs.org/15379
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Tue, 23 Aug 2022 20:15:46 +0000]
afs: Use strlcat instead of snprintf to enable AIX build
The original code used strcpy(), etc. Some compilers have begun
to raise warnings that the use of these functions is unsafe, and
in the case of newer Linux kernels in particular, have caused the
build to fail outright. To adapt to these compilers/kernels, the
code was changed to leverage strlcpy(), snprintf(), etc. as they
are safer. AIX does not provide these functions within the
kernel. For some of the functions such as strlcpy(), etc. we
can use replacement functions from libroken within the AIX kernel
extension. However, libroken does not offer a suitable
replacement for snprintf(), and instead the same purpose can be
accomplished by using strlcpy() and multiple calls to strlcat().
Reviewed-on: https://gerrit.openafs.org/15122
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
54dbd474a5bd43cf62a226802593b062069509ce)
Change-Id: Ie59450a91fcb374b1362f0bd88a93f258597a22d
Reviewed-on: https://gerrit.openafs.org/15378
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Fri, 19 Aug 2022 15:34:33 +0000]
BUILD: Ensure that make clean actually cleans all products
After a build, running make clean leaves the following objects:
src/dir/test/dtest.o
src/libuafs/libuafs.a
src/libuafs/*.o
src/roken/*.o
Add a few rules to the various Makefiles to ensure that we clean
up those files as well.
Reviewed-on: https://gerrit.openafs.org/15119
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
ad2b880c3791046883f8c0ef15f327c85e013b5b)
Change-Id: Iaef185ec0e045ded8453f6b276e6b6b9075b3388
Reviewed-on: https://gerrit.openafs.org/15377
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Sat, 13 Aug 2022 18:40:44 +0000]
afs: Fix missing def for pinned_heap on AIX
Include sys/malloc.h in AIX's osi_sleep.c. This resolves a build
failure in which pinned_heap is not defined.
The commit below introduced code to resolve an issue on AIX 5.3:
5e5bfa6b9401ebc1fa5446e208cf46c15943c411
Author: Tom Keiser <tkeiser@sinenomine.net>
Date: Mon Jun 25 21:22:49 2007 +0000
aix53-avoid-wait-crash-
20070625
newp = (afs_event_t *) xmalloc(sizeof(afs_event_t), 5, pinned_heap);
pinned_heap has always been defined in sys/malloc.h since at least
AIX 4.1. It is likely that the aix53-avoid-wait-crash-
20070625
commit did not compile, or that sys/malloc.h was included
elsewhere at the time.
Reviewed-on: https://gerrit.openafs.org/15108
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@auristor.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
615681710a38bd1a92f2c476df9fdab7ac1d9bdd)
Change-Id: I3fcfc1c7e3e26e927d0a8e2a233c4c12b0781308
Reviewed-on: https://gerrit.openafs.org/15376
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Mon, 15 Aug 2022 17:44:14 +0000]
AIX: Fix install of 64-bit kernel module
Remove make step in error. This was preventing the install of the
built kernel module on AIX when not using Transarc-style paths via
the make install step.
Reviewed-on: https://gerrit.openafs.org/15114
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
319d361499af933451425acaeabac9bc6548c96b)
Change-Id: I252de19363824ae23187b7b9da878137814ab09d
Reviewed-on: https://gerrit.openafs.org/15375
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Mon, 15 Aug 2022 17:00:07 +0000]
util: Add missing symbol for AIX build
Added symbol afs_exec_alt to liboafs_util.la.sym. This resolves a
build failure on AIX.
Reviewed-on: https://gerrit.openafs.org/15113
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
c0968b6c69c3f16468a7fe4a234d8421731e20e0)
Change-Id: I060b7b102c963a517d79bad41b5e4c827cbccad8
Reviewed-on: https://gerrit.openafs.org/15374
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Sun, 14 Aug 2022 06:25:10 +0000]
fsint: export symbol needed by fileserver
The symbol RXAFS_OpCodeIndex is consumed by the fileserver via the various
"opcode_<RPC Name>" macros produced by rxgen. The functionality is provided
by liboafs_fsint but RXAFS_OpCodeIndex was omitted from the export symbol list.
This went undetected because we use static linking for the fileserver, and
libtool does not enforce export symbol lists while static linking, on platforms
other than AIX. Recent efforts to revive the AIX build illuminated the error,
which we resolve by adding RXAFS_OpCodeIndex to the export list.
Reviewed-on: https://gerrit.openafs.org/15112
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
91532e3142751468aa8f7bbabe7de087b77259bf)
Change-Id: Ia665937002137dca1a8ec4573b4fe8932fc90dd0
Reviewed-on: https://gerrit.openafs.org/15373
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Sat, 13 Aug 2022 18:47:07 +0000]
export: Ignore additional build products generated on AIX
Update .gitignore to ignore additional build products generated on AIX.
Reviewed-on: https://gerrit.openafs.org/15110
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
448d2b1184e872f977a662c3f48af04029f9a112)
Change-Id: Iff910b63174c9b046e031285dd30672b0f592c1a
Reviewed-on: https://gerrit.openafs.org/15372
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Mon, 15 Aug 2022 21:45:12 +0000]
export: Install kernel utilities with execute permissions on AIX
Make sure that cfgexport and cfgafs are installed with execute
permissions. These executables load the AIX kernel modules into
the running kernel and are called by the rc.afs script.
Reviewed-on: https://gerrit.openafs.org/15116
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
1a4da8868fd32e928def64599bb6ec9d6b455423)
Change-Id: I575d89164ef386d1cdf562b2206b502b3c2e8582
Reviewed-on: https://gerrit.openafs.org/15371
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Ben Huntsman [Sat, 13 Aug 2022 18:40:18 +0000]
afs: Fix missing def for timestruc_t on AIX
Include sys/time.h in AIX's osi_machdep.h. This resolves a build
issue where the struct timestruc_t was not defined.
Reviewed-on: https://gerrit.openafs.org/15107
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
b5b34278b26ca22eea988fb18d738969dd608ede)
Change-Id: Icb91b47d819f1bcc0e277a482f2a22d87dc8bc6c
Reviewed-on: https://gerrit.openafs.org/15370
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Fri, 16 Jul 2021 19:02:07 +0000]
tsm41: Fix libs for AIX 7.2
AIX 7.2 doesn't seem to have libcsys, netinet.exp, sockets.exp, or
statcmd.exp available. To allow for our IMPORTS and LDFLAGS to change
depending on the AIX version, introduce the autoconf vars TSM_IMPORTS
and TSM_LIBS, which do not contain the missing libs on AIX 7.2, so we
can build on AIX 7.2.
Reviewed-on: https://gerrit.openafs.org/14703
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
a912db315b4f29673808a7f900eb038ebd7b89c2)
Change-Id: Ic106b893f212b33c85bded8443bcb782205f290c
Reviewed-on: https://gerrit.openafs.org/15369
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Thu, 15 Jul 2021 22:53:43 +0000]
AIX: Add buildsystem support for AIX 7.2
Reviewed-on: https://gerrit.openafs.org/14701
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
7acd66ae39db2049c8f80f4fceb4fcd15fe8e8b8)
Change-Id: I94e74b56379fe1103d966883835b8af8a0d98f7e
Reviewed-on: https://gerrit.openafs.org/15368
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Michael Meffie [Thu, 15 Mar 2018 22:53:59 +0000]
roken: do not clobber __attribute__
The roken-common.h header defines an empty macro called __attribute__
when HAVE___ATTRIBUTE__ is not defined. This macro conditionally removes
the `format' function attributes in the roken headers at compile time.
Unfortunately, the empty __attribute__ macro will also clobber other
attribute types encountered after the roken.h header inclusion.
This is not an issue when building under gcc or clang, since the empty
attribute macro will not be defined. However Solaris Studio supports a
subset of the function attribute types, with `format' not currently
supported. This means roken will define an empty __attribute__ macro,
which prevents the use of other attribute types.
This commit does not change the roken files directly because they are
external. Instead, the processing of the roken.h.in file has been
updated to undefine the __attribute__ macro at the end of the generated
roken.h header.
Reviewed-on: https://gerrit.openafs.org/12961
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
388eaec3452ed4b18a95ee34efcbe4cf64814701)
Change-Id: Id93ec414a59a2f5866e503601b7e42bbb4f8d66a
Reviewed-on: https://gerrit.openafs.org/15367
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Ben Huntsman <ben@huntsmans.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Fri, 24 Feb 2023 20:05:29 +0000]
rx: Revert RXS_DestroyConnection()'s return type
Commit 'rx: Do not ignore RXS_* op errors' (
635594d6c) changed the
rx_securityOps.op_DestoryConnection()'s signature to a void return.
This is a change to a public interface.
To maintain backward compatibility within openafs 1.8.x, restore
op_DestoryConnection's signature back to returning an 'int', and revert
the changes to rxkad_DestroyConnection() so it returns an int value.
Since returning an error value from this function doesn't make sense,
as noted by commit '
635594d6c', always return a 0 value.
This is a 1.8.x specific commit
Change-Id: I9685ac884a10298ae8faad012717499874f25316
Reviewed-on: https://gerrit.openafs.org/15334
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Mon, 12 Apr 2021 23:21:23 +0000]
afs: Assert avc->lock is held in afs_IAS_once
Commit
3be5880d (afs: Avoid panics in afs_InvalidateAllSegments) added
an assert to check that vcache->lock is write-locked before we call
afs_InvalidateAllSegments_once from a background operation.
However, afs_InvalidateAllSegments_once should always be called with
vcache->lock write-locked; there's nothing specific about the
backgrounded call that requires this. So to make sure we catch all
cases, move this assert to afs_InvalidateAllSegments_once itself.
Also remove the conditional check for WriteLocked(&avc->lock) in here,
since clearly avc->lock must be write-locked (and actually is, since
change Ic309e4006bf47bcb38fa2b53bf103e0c645a856d "afs: write-lock
vcache->lock in afs_InactiveVCache").
Add some comments to this function while we're here, to more clearly
indicate what locks are needed.
Reviewed-on: https://gerrit.openafs.org/14592
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
72223e0958c2d7cddd968970547dd73fc3cc1351)
Change-Id: I9acf5599a8ef1e724a00cf362695fe34ca87c0bf
Reviewed-on: https://gerrit.openafs.org/15331
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Mon, 10 Feb 2014 21:57:43 +0000]
Move key-related warnings to common server code
Each server process can log a couple of different warnings about the
server keys found on disk:
- If afsconf_GetLatestKey() returns success (indicating a single-DES
key is present), we call LogDesWarning().
- If afsconf_CountKeys() returns 0 (indicating there are no keys at
all on disk), we log a warning that all authenticated access will
fail.
Currently, the code to do these checks and log the relevant warning is
duplicated across the startup code for nearly every server process. To
avoid this duplication, and to make sure the checks aren't
accidentally skipped for anyone, move these checks to
afsconf_BuildServerSecurityObjects, which every server process calls.
We must add an additional parameter to
afsconf_BuildServerSecurityObjects to handle the different logging
mechanism these servers use, but afsconf_BuildServerSecurityObjects is
declared in a public header (cellconfig.h), and is exported in a
public library (libafsauthent). So to avoid changing a public symbol,
introduce a new variant of the function, called
afsconf_BuildServerSecurityObjects_int. Declare this in a new internal
header, authcon.h.
We don't have easily-usable logging functions for upserver and butc,
so just don't log the warnings for those. For ubik servers, don't
update ubik_SetServerSecurityProcs to use the new function; the
initial call to afsconf_BuildServerSecurityObjects_int in the server's
startup code will cover logging the warning on startup.
Reviewed-on: https://gerrit.openafs.org/10831
Tested-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
2630e70550defc664efa0952589cf82ed3c51796)
Change-Id: Ib37b92cfccbf161d72d2db73eeaea6fd8b312961
Reviewed-on: https://gerrit.openafs.org/15316
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Stephan Wiesand [Thu, 26 Jan 2023 18:30:04 +0000]
CellServDB update 09 May 2022
Update all three copies in the tree, and the rpm specfile.
Reviewed-on: https://gerrit.openafs.org/15305
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
1b92c766f1cf52b3bae3a00e08d40a2334bf9f24)
Change-Id: I26fb3ff045d41b840fc6565d1a17aca8e75fcd30
Reviewed-on: https://gerrit.openafs.org/15323
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Wed, 7 Jul 2021 17:08:10 +0000]
Remove kdump
Remove the obsolete kdump debugging tool from the tree. Remove and
clean up the preprocessor tests associated with KDUMP, KDUMP_RX_LOCK and
KDUMP_KERNEL. Clean up the autoconf and Makefiles to remove kdump and
the associated autoconf and Makefile vars XLIBELFA and XLIBKVM.
The kdump utility has not been well maintained; for some platforms it
fails to build (e.g. Solaris 11). For Linux, the makefile does not
even try to compile the kdump source but instead creates the kdump file
via touch.
The intended functionality of kdump has been replaced by various kernel
debugging tools, such as dtrace or systemtap.
Reviewed-on: https://gerrit.openafs.org/14623
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
489cfb587a87ab53817ad0b4eccd65d9f7b332e2)
Change-Id: Idf9582fd65482f32e7f13af0bf734c2b970da757
Reviewed-on: https://gerrit.openafs.org/15315
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Mon, 25 May 2020 21:48:34 +0000]
IRIX: Remove pre-65 code
Commit
d1923139 (irix kill efs and start pruning pre-65) removed all
files that defined AFS_SGI64_ENV and earlier, but didn't remove that
code that depended on those defines. In addition, there has been code
in the tree that checks for AFS_SGI53_ENV since OpenAFS 1.0, but
nothing has ever defined Irix 5.3 support in OpenAFS.
Remove all of this obsolete code. Change all references to
AFS_SGIXX_ENV to AFS_SGI_ENV, and assume AFS_SGI_ENV is defined in all
IRIX dirs. Consolidate some of the resulting ifdef logic
appropriately.
Reviewed-on: https://gerrit.openafs.org/14230
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
e0c288416df59a117cd818ada930fd1259955983)
Change-Id: Ie188b9f108bf55cfae7fcb358a1de21bad076f11
Reviewed-on: https://gerrit.openafs.org/15314
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Mark Vitale [Wed, 10 Mar 2021 04:12:50 +0000]
DARWIN: correct size of fstrace ICL_TYPE_LONG and ICL_TYPE_POINTER
Commit
248da50aa56f19bdc8b2b322f5e17b3d2a363dce 'icl 64 bit platform
rationalization' introduced support for 64-bit ICL_TYPE_POINTER and
ICL_TYPE_LONG for fstrace running on DARWIN kernels. However, it
neglected to make the matching change in the fstrace utility itself,
which reads and reports these trace entries. The result is that all
fstrace records which contain 64-bit pointers or longs are misreported
as 32-bit values. Furthermore, any subsequent values in the same
fstrace record are also misreported because the offsets are now
incorrect.
Move the definition of ICL_LONG from afs_icl.c to icl.h so fstrace.c may
share the ICL_LONG logic and value.
Modify fstrace to use logic similar to the recording logic in afs_icl.c
so that the correct size and offsets are maintained while decoding the
contents of each fstrace record.
We can use the build-time value of ICL_LONG (rather than the runtime
value of afs_sizeofLong) because the difference only matters for SGI62
32-bit kernels. It is unknown whether the existing code works correctly
for SGI62 32-bit mode, but this commit should not affect that support
either way.
Reviewed-on: https://gerrit.openafs.org/14558
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
adf08b464efa8c29256dc7b261b10b60cc31119d)
Change-Id: Ie3ef988d209a984839751051d7bd9a62369b5b11
Reviewed-on: https://gerrit.openafs.org/15313
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>
Ben Huntsman [Thu, 18 Aug 2022 00:19:55 +0000]
rx: Only use printf in the AIX kernel
An earlier version of the OpenAFS code used an unusual preprocessor
macro for the function osi_Msg and osi_VMsg. This causes problems
on newer Linux kernels. The macro was replaced with a function
leveraging vprintf, etc. These functions are not available in the
AIX kernel, where our only option is printf. However, AIX does
provide these functions in libc. This change ensures we only use
printf when building the AIX kernel module.
Reviewed-on: https://gerrit.openafs.org/15118
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
8b1beaffb40c93ddab50c75b37f3de5ae517a849)
Change-Id: Id06478cbc87b6965c021f26902e13bdfc2ef83d5
Reviewed-on: https://gerrit.openafs.org/15309
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>
Andrew Deason [Tue, 14 Jan 2020 16:51:42 +0000]
afs: Properly type afs_osi_suser cred arg
Currently, afs_osi_suser is declared with a void* argument, even
though its only argument is always effectively a afs_ucred_t*. This
allows us to call afs_osi_suser with any pointer type without the
compiler complaining. Currently, some callers call afs_osi_suser with
an incorrectly-typed afs_ucred_t** instead, like so:
func(afs_ucred_t **credpp)
{
afs_ucred_t **acred = *acredpp; /* incorrect assignment */
if (afs_osi_suser(acred)) {
/* ... */
}
}
The actual code in the tree hides this to some degree behind various
function calls and layers of indirection (e.g. afs_suser()), but this
is effectively what we do. This causes compiler warnings because we
are doing incorrect pointer assignments, but the end result works
because afs_osi_suser actually uses an afs_ucred_t*.
The type confusion makes it very easy to accidentally give the wrong
type to afs_osi_suser. This only really matters on SOLARIS, since that
is the only platform that actually uses its argument to
afs_osi_suser().
To fix all of this, just declare afs_osi_suser as taking an
afs_ucred_t*, and fix all of the relevant functions to handle the
right type.
Reviewed-on: https://gerrit.openafs.org/14085
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
4ce922d339777faf647f7129f5ae3f173a7870b1)
Change-Id: I1a6ce7788e86c32e554f87785f96f1d7b56d1496
Reviewed-on: https://gerrit.openafs.org/15308
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
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>
Mark Vitale [Mon, 4 May 2020 19:55:07 +0000]
Add static assert for size of osi_timeval32_t
OpenAFS code requires osi_timeval32_t to have 32-bit sizes for members
tv_sec and tv_usec - a total of 8 octets. One symptom of a
misdefinition may be incorrect operation of xstat_cm_test, which relies
on wire representations of time being 8 bytes on both the client and
server side.
In order to prevent incorrect sizes of osi_timeval32_t, add a static
assert.
Reviewed-on: https://gerrit.openafs.org/14195
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit
10c5ba12ace51440c7e98add83465a7018961e6f)
Change-Id: I9584a53154ffe673d19191a0bd9f6a92d6daf140
Reviewed-on: https://gerrit.openafs.org/15304
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Cheyenne Wills [Mon, 14 Jun 2021 22:13:57 +0000]
rx: Cleanup rx.h
Fix up indentation and white space within preprocessor statements.
Remove multiple blank lines
Fix #endif comments so they match the #if
Split long #define lines
RX_PACKET_TYPES
rx_MaxUserDatasize,
RXS_OP
RXS_SetConfiguration
Note, this commit does not refactor any preprocessor statements.
Reviewed-on: https://gerrit.openafs.org/14629
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
21df433134a059de8d3b3b46bb0892b34d910364)
Change-Id: I197897f4f7e81bd2f931e3decefe447caae0c5d9
Reviewed-on: https://gerrit.openafs.org/15301
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Andrew Deason [Wed, 13 Mar 2019 23:30:43 +0000]
rx: Do not ignore RXS_* op errors
Several places in rx call an RXS_* security layer operation, but
ignore the error code. Though errors for these operations are rare or
impossible currently, if they ever do return an error there could be
noticeable consequences, like a connection getting an uninitialized
challenge nonce, or sending a challenge packet with uninitialized
payload.
Change these call sites to record and handle the error. Errors from
the security class normally mean aborting the entire conn, but for
many operations we need to behave differently:
- For RXS_DestroyConnection, errors don't make sense, since we're just
freeing an object. Change the op to return void, and update our
implementations of DestroyConnection to match.
- For RXS_GetStats, just clear the relevant stats structure on error
instead. This change also results in us clearing the stats structure
when there is no security class associated with the connection;
previously we just reused the same struct data as the previous conn.
- For RXS_CreateChallenge, aborting the entire conn is difficult,
because some code paths have callers that potentially lock multiple
calls on the same conn (rxi_UpdatePeerReach -> TryAttach ->
rxi_ChallengeOn -> RXS_CreateChallenge), and aborting our conn
requires locking every call on the conn. So instead we just
propagate an error up to our callers, and we abort just the call we
have.
- For RXS_GetChallenge, we cannot abort the conn when
rxi_ChallengeEvent is called directly, because the caller will have
the call locked. But when rxi_ChallengeEvent is called as an event
(when we retry sending the challenge), we can.
- For RXS_SetConfiguration, propagate the error up to our caller.
Update all rx_SetSecurityConfiguration callers to record and handle
the error; all of these are during initialization of daemons, so
have them log an error and exit.
Reviewed-on: https://gerrit.openafs.org/13522
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
635594d6cceba6de4e09be5a9e9b908f7d16697d)
Change-Id: I800516335f6ab0d01d2b29dd0ceba9213dafde59
Reviewed-on: https://gerrit.openafs.org/15300
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>