From bce285df842d4231a254ad6748894a8d302872c081178ee1f8c3aba301955d07 Mon Sep 17 00:00:00 2001 From: Christof Hanke Date: Tue, 11 Jul 2023 05:38:45 +0000 Subject: [PATCH] Accepting request 1097970 from home:hauky:branches:filesystems - update to official openafs-1.8.10 - remove obsolete patches: * 7a3ad3bc.diff * b885159.diff * f6fbb85.diff * 4cf7a9a.diff OBS-URL: https://build.opensuse.org/request/show/1097970 OBS-URL: https://build.opensuse.org/package/show/filesystems/openafs?expand=0&rev=109 --- 4cf7a9a.diff | 38 - 7a3ad3bc.diff | 92 - ChangeLog | 6189 ++++++++++++++++------------- RELNOTES-1.8.10 | 65 + RELNOTES-1.8.9 | 69 - b885159.diff | 83 - f6fbb85.diff | 274 -- openafs-1.8.10-doc.tar.bz2 | 3 + openafs-1.8.10-doc.tar.bz2.md5 | 1 + openafs-1.8.10-doc.tar.bz2.sha256 | 1 + openafs-1.8.10-src.tar.bz2 | 3 + openafs-1.8.10-src.tar.bz2.md5 | 1 + openafs-1.8.10-src.tar.bz2.sha256 | 1 + openafs-1.8.9-doc.tar.bz2 | 3 - openafs-1.8.9-doc.tar.bz2.md5 | 1 - openafs-1.8.9-doc.tar.bz2.sha256 | 1 - openafs-1.8.9-src.tar.bz2 | 3 - openafs-1.8.9-src.tar.bz2.md5 | 1 - openafs-1.8.9-src.tar.bz2.sha256 | 1 - openafs.changes | 10 + openafs.spec | 17 +- 21 files changed, 3507 insertions(+), 3350 deletions(-) delete mode 100644 4cf7a9a.diff delete mode 100644 7a3ad3bc.diff create mode 100644 RELNOTES-1.8.10 delete mode 100644 RELNOTES-1.8.9 delete mode 100644 b885159.diff delete mode 100644 f6fbb85.diff create mode 100644 openafs-1.8.10-doc.tar.bz2 create mode 100644 openafs-1.8.10-doc.tar.bz2.md5 create mode 100644 openafs-1.8.10-doc.tar.bz2.sha256 create mode 100644 openafs-1.8.10-src.tar.bz2 create mode 100644 openafs-1.8.10-src.tar.bz2.md5 create mode 100644 openafs-1.8.10-src.tar.bz2.sha256 delete mode 100644 openafs-1.8.9-doc.tar.bz2 delete mode 100644 openafs-1.8.9-doc.tar.bz2.md5 delete mode 100644 openafs-1.8.9-doc.tar.bz2.sha256 delete mode 100644 openafs-1.8.9-src.tar.bz2 delete mode 100644 openafs-1.8.9-src.tar.bz2.md5 delete mode 100644 openafs-1.8.9-src.tar.bz2.sha256 diff --git a/4cf7a9a.diff b/4cf7a9a.diff deleted file mode 100644 index 5a21ec0..0000000 --- a/4cf7a9a.diff +++ /dev/null @@ -1,38 +0,0 @@ -From 4cf7a9adba18ed7752898c0d9421067c7bf17292 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Wed, 09 Feb 2022 14:00:13 -0700 -Subject: [PATCH] autoconf: Additional library test for ncurses - -Depending on how the ncurses libraries were built the external symbol -'LINES' may be replaced with the '_nc_LINES' external symbol. Because -the symbol 'LINES' may or may not be present, the autoconf test can fail -to detect the correct libraries needed for curses support. - -Add an additional AC_CHECK_LIBs for the symbol _nc_LINES (within the -ncurses or tinfo libraries) when setting the $LIB_curses. - -This commit was adapted from the openSuSE source packaging for openafs. - -Background: when ncurses is built with --enable-reentrant, LINES is -defined as a C preprocessor macro that expands to a call to _nc_LINES - -Change-Id: If5e93078ff8cd0af5a50a25a8be7b462261a4f6f ---- - -diff --git a/src/cf/curses.m4 b/src/cf/curses.m4 -index 24c6535..1691845 100644 ---- a/src/cf/curses.m4 -+++ b/src/cf/curses.m4 -@@ -19,7 +19,11 @@ - AC_CHECK_LIB([ncurses], [initscr], - [AC_CHECK_LIB([ncurses], [LINES], [openafs_cv_curses_lib=-lncurses], - [AC_CHECK_LIB([tinfo], [LINES], -- [openafs_cv_curses_lib="-lncurses -ltinfo"])])]) -+ [openafs_cv_curses_lib="-lncurses -ltinfo"], -+ [AC_CHECK_LIB([ncurses], [_nc_LINES], -+ [openafs_cv_curses_lib=-lncurses], -+ [AC_CHECK_LIB([tinfo], [_nc_LINES], -+ [openafs_cv_curses_lib="-lncurses -ltinfo"])])])])]) - AS_IF([test "x$openafs_cv_curses_lib" = x], - [AC_CHECK_LIB([Hcurses], [initscr], [openafs_cv_curses_lib=-lHcurses])]) - AS_IF([test "x$openafs_cv_curses_lib" = x], diff --git a/7a3ad3bc.diff b/7a3ad3bc.diff deleted file mode 100644 index b282ab1..0000000 --- a/7a3ad3bc.diff +++ /dev/null @@ -1,92 +0,0 @@ -From 7a3ad3bc1c87e525698f7dda1e4b0fbbd913da03 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Wed, 22 Mar 2023 16:56:09 -0600 -Subject: [PATCH] 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 -Reviewed-by: Benjamin Kaduk -Reviewed-by: Andrew Deason -(cherry picked from commit 6873dc925c5acc0ce7d65cf778ffee09c82a9898) - -Change-Id: If131bee5b466a119f54b05388a065e6af23698cf -Reviewed-on: https://gerrit.openafs.org/15388 -Tested-by: BuildBot -Reviewed-by: Andrew Deason -Reviewed-by: Michael Meffie -Reviewed-by: Kailas Zadbuke -Reviewed-by: Stephan Wiesand ---- - -diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h -index 9a080da..808c608 100644 ---- a/src/afs/LINUX/osi_compat.h -+++ b/src/afs/LINUX/osi_compat.h -@@ -13,6 +13,10 @@ - # include - #endif - -+#if defined(HAVE_LINUX_FILELOCK_H) -+# include -+#endif -+ - #if defined(LINUX_KEYRING_SUPPORT) - # include - # include -diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 -index a53c186..ee22158 100644 ---- a/src/cf/linux-kernel-func.m4 -+++ b/src/cf/linux-kernel-func.m4 -@@ -94,7 +94,11 @@ - [struct timespec64 *s; - ktime_get_real_ts64(s);]) - AC_CHECK_LINUX_FUNC([locks_lock_file_wait], -- [#include ], -+ [#ifdef HAVE_LINUX_FILELOCK_H -+ # include -+ #else -+ # include -+ #endif], - [locks_lock_file_wait(NULL, NULL);]) - AC_CHECK_LINUX_FUNC([override_creds], - [#include ], -diff --git a/src/cf/linux-kernel-header.m4 b/src/cf/linux-kernel-header.m4 -index 8507eaa..fc52830 100644 ---- a/src/cf/linux-kernel-header.m4 -+++ b/src/cf/linux-kernel-header.m4 -@@ -10,4 +10,6 @@ - AC_CHECK_LINUX_HEADER([sched/signal.h]) - AC_CHECK_LINUX_HEADER([uaccess.h]) - AC_CHECK_LINUX_HEADER([stdarg.h]) -+dnl Linux 6.3 relocated file locking related declarations into it's own header -+AC_CHECK_LINUX_HEADER([filelock.h]) - ]) -diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 -index f7699ce..0d6b645 100644 ---- a/src/cf/linux-test4.m4 -+++ b/src/cf/linux-test4.m4 -@@ -142,7 +142,11 @@ - AC_DEFUN([LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG], [ - AC_CHECK_LINUX_BUILD([for 3rd argument in posix_lock_file found in new kernels], - [ac_cv_linux_kernel_posix_lock_file_wait_arg], -- [#include ], -+ [#ifdef HAVE_LINUX_FILELOCK_H -+ # include -+ #else -+ # include -+ #endif], - [posix_lock_file(0,0,0);], - [POSIX_LOCK_FILE_WAIT_ARG], - [define if your kernel uses 3 arguments for posix_lock_file], diff --git a/ChangeLog b/ChangeLog index 5c92c73..57b63f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3134 +1,3785 @@ -commit 6cb9320825c3617abcb48e7fbd9d0d64f0c2f65b +commit a0b7f71122285f71c3ff0d006d1f9a77b1481732 Author: Stephan Wiesand -Date: Thu Dec 8 18:49:41 2022 +0100 +Date: Thu Jun 29 23:20:28 2023 +0200 - Make OpenAFS 1.8.9 + Make OpenAFS 1.8.10 - Update version strings for the 1.8.9 release, and add the + Update version strings for the 1.8.10 release, and add the finishing touch to NEWS. - Change-Id: I8185cc177c1150d29d802df522e3b161dac7d75e - Reviewed-on: https://gerrit.openafs.org/15215 - Reviewed-by: Michael Meffie - Reviewed-by: Cheyenne Wills + Change-Id: I5ade3bf8eb05474c5e4344e7c727545e807a0053 + Reviewed-on: https://gerrit.openafs.org/15490 Tested-by: BuildBot - Reviewed-by: Stephan Wiesand - -commit 0ad4c50f91c2d322688981b97aa05ba471b848c1 -Author: Benjamin Kaduk -Date: Fri Oct 8 20:11:19 2021 -0700 - - viced: cope with signed length/position in FetchData - - For legacy reasons, the "Pos" (initial position) and "Len" (length) - inputs to the RXAFS_FetchData and RXAFS_FetchData64 RPCs are represented - as signed integers (the corresponding StoreData RPCs use unsigned values). - - The use of signed values allows for the possibility of negative inputs, - and of signed integer overflow (undefined behavior in C), though the latter - is unlikely to arise naturally given that the implementation uses a - common backend with 64-bit values. - - In particular, if a negative "Pos" value is supplied, we end up in - FetchData_RXStyle() that performs either FDH_PREAD() or FDH_PREADV() - with the negative value as the position from which to read, which is - an error. The error handling for those calls treats any error as - indicative of a problem with the volume or its underlying storage, - and takes the volume offline for salvage. Furthermore, after the - maximum number of automatic salvages the volume is left offline for - administrator action. This presents a simple route for - (unauthenticated) denial of service, as root.cell.readonly must be - available to all users of the cell, and can be brought offline in this - way; rendering root.cell.readonly unavailable would bring essentially - all access to the cell to a halt. (Other volumes could be targeted as - well, subject to their corresponding ACLs.) - - Since there is no valid use for a negative position or length input, - reject them outright from the common_FetchData64() implementation. - Also check for whether the combination requests a read that would - overflow a signed integer and reject that as well. - - Thanks to Jeffrey Altman and Chaskiel Grundman for collaborating on - this change. - - FIXES 135263 - - Reviewed-on: https://gerrit.openafs.org/15223 - Reviewed-by: Stephan Wiesand - Reviewed-by: Mark Vitale + Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Reviewed-by: Cheyenne Wills - Tested-by: Mark Vitale - Reviewed-by: Jeffrey Altman - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 1fbbcbee0183aa7855c0e5d9d38aa89af75902db) - - Change-Id: I1d634918789dddd5500ab50a0b508c142d83dc84 - Reviewed-on: https://gerrit.openafs.org/15224 - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Tested-by: BuildBot Reviewed-by: Stephan Wiesand - Reviewed-by: Benjamin Kaduk -commit f812d1125f785df05bf1028f665d22c608006bae +commit a48dc74d793a95790c34e9701bbcbe02080308bc Author: Stephan Wiesand -Date: Thu Nov 3 15:59:04 2022 +0100 +Date: Thu Jan 12 18:06:30 2023 +0100 - Make OpenAFS 1.8.9pre2 + Make OpenAFS 1.8.10pre1 - Update version strings for the second 1.8.9 prerelease. + Update version strings for the first 1.8.10 prerelease. - Change-Id: Ic45d60180097f85263b2bd81b0beb039c36ad51f - Reviewed-on: https://gerrit.openafs.org/15192 + Change-Id: I116eb9852e7799540fea4cd439f513d571231f45 + Reviewed-on: https://gerrit.openafs.org/15282 Tested-by: BuildBot - Reviewed-by: Michael Meffie Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie Reviewed-by: Mark Vitale - Reviewed-by: Benjamin Kaduk + Reviewed-by: Ben Huntsman Reviewed-by: Stephan Wiesand -commit e8ead732246d7bd9c1e38fa806b19dfd9e38cf6a +commit 30e83126649e8aeeecf1c10436f6f9a315e459b6 Author: Stephan Wiesand -Date: Thu Nov 3 16:11:30 2022 +0100 +Date: Thu May 18 16:55:11 2023 +0200 - Update NEWS for 1.8.9pre2 + Update NEWS for 1.8.10pre1 - Release notes for the second 1.8.9 prerelease. + Release notes for the first 1.8.10 prerelease. - Change-Id: I564ee4f4348ca3574a52c75fea30c55dac5e33a4 - Reviewed-on: https://gerrit.openafs.org/15193 - Reviewed-by: Michael Meffie + Change-Id: Ie7ed1b65444239528edcb4861ad3e99af54c4bbb + Reviewed-on: https://gerrit.openafs.org/15440 + Tested-by: BuildBot Reviewed-by: Mark Vitale - Reviewed-by: Benjamin Kaduk - Reviewed-by: Cheyenne Wills - Reviewed-by: Stephan Wiesand - Tested-by: Stephan Wiesand - -commit fdf38483c7765270c24a01b65fc3d1173509136e -Author: Cheyenne Wills -Date: Thu Sep 22 13:04:59 2022 -0600 - - Linux-6.0: Replace add_to_page_cache - - Linux 6.0 removed the add_to_page_cache function in the Linux commit: - 'filemap: Remove add_to_page_cache() and add_to_page_cache_locked()' - (2bb876b58d593d7f2522ec0f41f20a74fde76822) - - The replacement function, filemap_add_folio function is exported as GPL, - but a non-GPL wrapper was provided in the Linux 5.15 commit: - 'mm/filemap: Add filemap_add_folio()' - (9dd3d069406cea073fc633e77bc59abbfde8c6c4) - which changed the GPL exported function add_to_page_cache_lru to a - non-GPL exported function. - - The function add_to_page_cache_lru functionally combines the - add_to_page_cache with lru_cache_add. Within afs, all the calls to - add_to_page_cache follow the pattern of calling the lru_cache_add - via the wrapper afs_lru_cache_add immediately after (except in one case - noted below). - - Add an autoconf check to see if add_to_page_cache_lru is available. - - Introduce a new wrapper function afs_add_to_page_cache_lru that handles - calling either add_to_page_cache/afs_lru_cache_add or - add_to_page_cache_lru. - - As noted above there is one function, afs_linux_bypass_readpages, that - calls add_to_page_cache but does not immediately call afs_lru_cache_add. - This function is only used in Linux kernels prior to 5.18, see the - commit: - 'Linux-5.18: replace readpages with readahead' (7a181415db) - Since this code path is only built for a Linux kernel level where - add_to_page_cache should also exists, we do not replace this call. - - NOTE: - The add_to_page_cache_lru was moved into mm/folio-compat.c which has a - comment indicating that callers of these functions should migrate to - folio calls. However the replacement folio call that is needed by afs, - filemap_add_folio, is exported as GPL. - - Reviewed-on: https://gerrit.openafs.org/15132 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 0ce315f0cee1cff7e19e6ebcc0e0e82e03719c20) - - Change-Id: Ic0496c2fba00e7be467dbbcf52d9854495e1ad9f - Reviewed-on: https://gerrit.openafs.org/15148 - Tested-by: BuildBot - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Reviewed-by: Cheyenne Wills - Reviewed-by: Mark Vitale - Reviewed-by: Harish Sharma - Reviewed-by: Stephan Wiesand - -commit 79a04c3448541bd8299598c5d87b404d8d2219a5 -Author: Michael Meffie -Date: Mon Sep 26 11:34:57 2022 -0400 - - afs: Avoid unbounded string copy in SRXAFSCB_GetLock() - - Use strlcpy() instead of strcpy() when filling in the lock name to avoid - string buffer overflows of the AFSDBLock name arrays. - - This is a 1.8.x specific commit, derived from 419f0cd7aa (afs: Replace - strcpy &co by safer alternatives) - - Change-Id: Ia59f6dccdeab1c0b6f267254bd264842568b7582 - Reviewed-on: https://gerrit.openafs.org/15151 - Tested-by: BuildBot Reviewed-by: Cheyenne Wills Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Benjamin Kaduk - Reviewed-by: Harish Sharma Reviewed-by: Stephan Wiesand -commit 119cea2f49af08f0f24711d1398a739beef1e359 -Author: Cheyenne Wills -Date: Wed Sep 7 19:03:50 2022 -0600 - - Remove gssapi in autoconf and configuration - - The 1.8.x specific commit in gerrit 12681, "Remove src/rxgk" (7c2ce4040) - removed rxgk from the build, however the probe for GSSAPI is still - place. - - If there is no gssapi library available, configure fails: - checking for gss_import_name in -lgssapi_krb5... no - checking for gss_import_name in -lgss... no - configure: error: cannot find usable GSS-API library - - There are no references to gssapi other than the probe in autoconf and - 2 defines in src/config/Makefile.config.in - - Remove the autoconf check for GSSAPI via the RAA_LIB_GSSAPI call. - Remove the 2 GSSAPI related defines from Makefile.config.in - Update the INSTALL document to remove references to gssapi. - - Change-Id: I873e46bfccfbf538740e8bf5e28a3ca8c3cd3744 - Reviewed-on: https://gerrit.openafs.org/15137 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Cheyenne Wills - Reviewed-by: Mark Vitale - Reviewed-by: Stephan Wiesand - -commit a2c1f9dc21b9e17aa8b075e4507f07def3275c2a -Author: Stephan Wiesand -Date: Thu Sep 23 20:20:44 2021 +0200 - - Make OpenAFS 1.8.9pre1 - - Update version strings for the first 1.8.9 prerelease. - - Change-Id: I6fc6dff8143445ee82188a2614588068f1feeb25 - Reviewed-on: https://gerrit.openafs.org/14810 - Tested-by: BuildBot - Reviewed-by: Michael Meffie - Reviewed-by: Cheyenne Wills - Reviewed-by: Mark Vitale - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 7a44c381f1d599f8a7ee8e6349f3c7ab190ea1f5 -Author: Stephan Wiesand -Date: Thu Aug 25 16:01:02 2022 +0200 - - Update NEWS for 1.8.9pre1 - - Release notes for the first 1.8.9 prerelease. - - Change-Id: I26e4334f9f1e34b36299b097525a61a89f422aaf - Reviewed-on: https://gerrit.openafs.org/15126 - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills - Reviewed-by: Benjamin Kaduk - Reviewed-by: Stephan Wiesand - -commit beb1a8a16c946c5ffba9868ae33f20a719fca95f -Author: Cheyenne Wills -Date: Fri Mar 6 10:00:25 2020 -0700 - - afs: Clean up compiler warning casting ptr to int - - In osi_probe.c, the macro 'check_result' casts a pointer to an int which - on older Linux kernels (e.g. 2.6.18) produces several lines with the C - warning: - - ... warning: cast from pointer to integer of different size - - Change the cast from int to long int. - - Linux 2.6.18 doesn't provide intptr_t or uintptr_t, and stdint.h is not - available to kernel modules. But the size of a pointer is the size of a - long (see uintptr_t in linux/types.h - Linux 2.6.24+), so - change the cast from int to long. - - Note that the this code by default only gets pulled in for older Linux - kernels (e.g. 2.6.18). For newer kernels, ENABLE_LINUX_SYSCALL_PROBING - is not defined, and so most of osi_probe.c is not built. - - Reviewed-on: https://gerrit.openafs.org/14092 - Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - Reviewed-by: Andrew Deason - (cherry picked from commit 38d78e2496c3d242e44bad401ecffe15e3883388) - - Change-Id: I474ad10c8cda8c414154e20f739a2aba5ba890cf - Reviewed-on: https://gerrit.openafs.org/15134 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Stephan Wiesand - -commit 7a8c044c09e965af05ac7978123695a3b234d8a1 +commit abeed74bb0d0bd7a3a5dbd13b9e953a994fb78e6 Author: Andrew Deason -Date: Tue Oct 13 12:17:37 2020 -0500 +Date: Fri May 5 16:47:45 2023 -0500 - dir: Set srcdir correctly in src/dir/test + LINUX: Set .getattr for symlinks - srcdir is a magic variable that needs to be set to @srcdir@, not some - relative path like ../../.. (which will usually be somewhere in the - objdir, not srcdir). Set it correctly in here. + 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). - Without this, objdir builds can fail with: + 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: - make[4]: Entering directory '...obj/src/dir/test' - make[4]: *** No rule to make target 'dtest.o', needed by 'dtest'. Stop. + - Another client changes, for example, the owner of a symlink we have + cached. - Which happens because the automatic rule for dtest.o can't be - constructed, since we cannot find dtest.c automatically because srcdir - isn't set properly. + - The fileserver sends us a callback break, and so we clear CStatd for + the vcache for the symlink. - This has been broken since commit 37b4195d (dtest-20021111), but was - not noticeable until commit 192a2ff4 (dir: make dtest buildable - again), since that caused dtest to actually get built. + - 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(). - Also set LIBS correctly in here, using the conventional ${TOP_LIBDIR}, - since ${srcdir} no longer points to "../../..". + 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(). - Reviewed-on: https://gerrit.openafs.org/14384 + 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 Tested-by: BuildBot - Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk - (cherry picked from commit bc6f50ca0ce6c17a5a9b1042fa90235613f80c95) + (cherry picked from commit 2b32b130f534068251ce9fd1b621de6e480d56d7) - Change-Id: I8aff31557b6b92bb10c68abb0ba5a61a68b8f750 - Reviewed-on: https://gerrit.openafs.org/15133 + Change-Id: I194308e2a4783cc3205c6cfd54880421635f6b38 + Reviewed-on: https://gerrit.openafs.org/15443 Tested-by: BuildBot + Reviewed-by: Andrew Deason + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit 4394a3ee84ffaba559bbe9102c8e6d801f8d6625 +Author: Andrew Deason +Date: Wed Aug 26 13:54:00 2020 -0500 + + 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 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 6b96a49eb6268adf9fc7e077fe849af7802a1575) + + Change-Id: Iebb35b323ceb50f9603387c46168b80ec800735d + Reviewed-on: https://gerrit.openafs.org/15422 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Tested-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Andrew Deason Reviewed-by: Cheyenne Wills Reviewed-by: Mark Vitale Reviewed-by: Stephan Wiesand -commit e3edd8c43e5808c19a37d8d74a311f4d9240665a -Author: Cheyenne Wills -Date: Mon Mar 7 18:35:03 2022 -0700 +commit ee6944d96d7692244438cb1aa7f84a102aebff76 +Author: Benjamin Kaduk +Date: Tue Aug 16 07:48:02 2022 -0700 - LINUX: Use bitwise & for f_flags test + rxevent: fix mismatched #endif - This code is clearly supposed to be masking f_flags with O_ACCMODE, and - so should be using a bitwise &, not the boolean &&. Clang complains - about this, causing a warning (which breaks the build with - --enable-checking): + We should only assign to 'ev' once, rather than assigning a second + time to an uninitialized value. - error: use of logical '&&' with constant operand [-Werror, - -Wconstant-logical-operand] - } else if ((file->f_flags && O_ACCMODE) != O_WRONLY) { - ^ ~~~~~~~~~ - .../osi_vnodeops.c:3192:28: note: use '&' for a - bitwise operation + Reported by Ben Huntsman and diagnosed by Jeffrey Altman. - For the current code without this commit the behavior of this - check is as follows: - - When f_flags is: The check is: - ==================== ============= - O_RDONLY True (as expected) - O_WRONLY False (as expected) - O_RDWR False (incorrect) - has some non-O_ACCMODE False (incorrect) - bit is set - - The incorrect check doesn't cause any problems for overall correctness, - but it does mean that in those cases afs_linux_fillpage will not be - called and that partially-written pages will be left out of date and any - reader will need to fill the page again. - - Fix this by using the bitwise &. - - There is also an out of date link to the Linux documentation. Update - the comment to point to the current documentation that is in the Linux - source tree. - - Reviewed-on: https://gerrit.openafs.org/14903 + Reviewed-on: https://gerrit.openafs.org/15106 + Reviewed-by: Michael Meffie Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit e51ed7be3849025e9b47d1a644a4fcd99b774b30) + + Change-Id: I06ac2155170d8f005afd9551c69d5ef3e60afff3 + Reviewed-on: https://gerrit.openafs.org/15442 + Reviewed-by: Ben Huntsman + Tested-by: Ben Huntsman + Tested-by: BuildBot + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit e4e9122365a3ec05c01add5333b532f2c19e1732 +Author: Andrew Deason +Date: Sun Jul 18 23:05:38 2021 -0500 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit c2db41258370159c1257ee79df10afa4a2a2d9e8) + + Change-Id: I433e4842b684c5f0f453e20d2f5d455b10a792eb + Reviewed-on: https://gerrit.openafs.org/15441 Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 8d9545008240d7f285b140503e432f53f41e0724) - - Change-Id: Iae459ffe87df9a21a90587c02a1ee2c20b360d33 - Reviewed-on: https://gerrit.openafs.org/15129 Tested-by: BuildBot - Reviewed-by: Cheyenne Wills + Reviewed-by: Ben Huntsman + Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand -commit c3f31cc9c3442aca0f6f66ba493ea92bfa46dcca -Author: Jan Iven -Date: Fri Aug 5 14:46:27 2022 +0200 +commit 332b5593d487c25d0091c5572519364c57cace90 +Author: Ben Huntsman +Date: Thu May 4 16:52:38 2023 -0700 - systemd: do not load the 'openafs' module on boot + AIX: Free pinned_heap during shutdown to prevent kernel panic - remove /etc/sysconfig/modules/openafs-client.modules, i.e no longer have - systemd run "modprobe openafs" at boot, on RPM-based systems. + 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: - This had been introduced with a reference to the Fedora packaging guide - at the time. However, this mechanism was meant just for persistent - driver modules (i.e expected to stay loaded over the runtime) - the - "openafs" module is loaded (and unloaded) by the actual systemd unit. + xmfree(tmp); - The systemd unit that processes the above file comes from "initscripts", - this is optional in later Fedoras/RHELs and so the file may not even be - processed (/usr/lib/modules-load.d/ would be an alternative mechanism to - load modules at boot.. if needed). + However, on AIX, xmfree actually takes two arguments: - This change is mostly cosmetic, although RT#135204 showed that having - the "openafs" module loaded without a client running can actually be - harmful. + int xmfree ( ptr, heap) + caddr_t ptr; + caddr_t heap; - Reviewed-on: https://gerrit.openafs.org/15092 - Tested-by: BuildBot - Reviewed-by: Michael Meffie - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 40b2c6036737a416f3b33624b5abeefa407c1b01) + 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. - Change-Id: Iea1475217b8ae56accfb4436248011f0b84e0c09 - Reviewed-on: https://gerrit.openafs.org/15128 + 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 Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 4810cca10bc32df7ba7809fc2bf095d20e2febd8) + + Change-Id: I687caa6daae83fc7986e76d370b55f90f5ca53cc + Reviewed-on: https://gerrit.openafs.org/15425 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Tested-by: Ben Huntsman + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand -commit 99f04b1398cc38fc18f7f98cca9d5785218feb0b +commit a2ab598bae94a9ce0c95034c1a54bcd8e12d5a87 +Author: Ben Huntsman +Date: Thu May 4 10:00:43 2023 -0700 + + 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 + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 8a2d4faa73d0f2e03a4016d7f84c5d5437040cec) + + Change-Id: I5a2fc4ad1a829f1ee30387da20ce477c84fa020f + Reviewed-on: https://gerrit.openafs.org/15424 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Tested-by: Ben Huntsman + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit af58c5cd15ad7b93a93892247fd1c4119e806767 Author: Cheyenne Wills -Date: Thu Jul 14 13:03:08 2022 -0600 +Date: Thu Apr 27 09:49:03 2023 -0600 - linux: Call put_page if errors in aops->readpages + Linux: Clear msghdr structure before use - Within the address_space_operations readpages function, when we remove a - page from the page->lru list, we must ensure that the page reference - count is decremented via put_page. + 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. - There are two cases within the flow of the afs_linux_readpages where - we remove a page from the page->lru list, but fail to put_page() it. + 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. - - If we go through afs_linux_bypass_readpages we fail to call - put_page() if the page index is larger than the index calculated from - i_size_read for the cache file. - - If get_dcache_readahead returns an error in afs_linux_readpages, we - fail to put_page(). This can happen if there was a problem opening - the cache file, or if the cache file has no a_ops->readpage. + Reviewed-on: https://gerrit.openafs.org/15409 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 795ef90d4041f1a5a1139435cc70f96457e0f64b) - Add a call to put_page in afs_linux_bypass_readpages when the page index - is greater than the index calculated from the i_size_read for the cache + Change-Id: Id037e2e548c27b23e2746f804ddcaf7b79d905c4 + Reviewed-on: https://gerrit.openafs.org/15411 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit 12ce31ce1dbd86dff47a036b36ce6ad506bd7b75 +Author: Cheyenne Wills +Date: Tue Apr 25 10:37:01 2023 -0600 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 5a7630acfd8bfd462b633475a6e195d9dbdfb451) + + Change-Id: I3a803f76ab84f1e055e91cf4f2be96440f141746 + Reviewed-on: https://gerrit.openafs.org/15410 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit 0967702c3f71c5d61e33f905c3272d029303743e +Author: Andrew Deason +Date: Thu Jul 15 19:59:47 2021 -0500 + + 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. - Add a call to put_page in afs_linux_readpages if get_dcache_readahead - returns an error. + Reviewed-on: https://gerrit.openafs.org/14707 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 9656a6b92b86849aa964529947bacb5aea4d83eb) - Note: The condition of not calling put_page if there was an error - opening the cache file was introduced by commit 'LINUX: Don't panic on - some file open errors' (af73b9a3b1f), which replaced an assert with - code that handled the error. The other conditions have existed since - the relevant code was introduced. + Backport notes: - In addition, the problems addressed by this commit are not present in - Linux kernels 5.8 and greater when the commit 'Linux-5.18: replace - readpages with readahead' (7a181415db1) is present, because we call - afs_linux_readahead instead of afs_linux_readpages. + The following symbols are not present in the 1.8.x branch at this time, + so removed from this backported patch: - Reviewed-on: https://gerrit.openafs.org/15068 + * 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 + Reviewed-by: Andrew Deason + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit 5e282943ff00fbd5c9ba3056c25959794f8a1144 +Author: Andrew Deason +Date: Fri Apr 7 14:10:58 2023 -0500 + + 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 + Reviewed-by: Cheyenne Wills + Tested-by: BuildBot + (cherry picked from commit 5aaed53f07fae0856e6da9defc408960e72364a7) + + Change-Id: I107c01917512da6c1043880cb93754be37919c47 + Reviewed-on: https://gerrit.openafs.org/15401 + Tested-by: BuildBot + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 7f9445bbeb72bcb8257ba0e0608746e31efae40e +Author: Andrew Deason +Date: Mon Jul 15 16:24:10 2019 -0500 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit ee7019a7630d01f29fecebd89ca69ad8a37e24e2) + + Change-Id: I2a34a0d8fd7b6c3721ede0c40c212c3993402235 + Reviewed-on: https://gerrit.openafs.org/15400 + Tested-by: BuildBot + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit f6fbb85c00411bf97e9855be73baf49bd6b061d7 +Author: Cheyenne Wills +Date: Wed Mar 29 12:11:38 2023 -0600 + + 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 Tested-by: BuildBot Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk - (cherry picked from commit 903dd5bf5e9328431e356abc42e20c248c5df6fd) + (cherry picked from commit 858ee34545e57acab1e4e5813cd1b9a011538b9e) - Change-Id: I3679969f985e83a7291a5fb735c80f7d57429c29 - Reviewed-on: https://gerrit.openafs.org/15096 - Tested-by: BuildBot - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit 0ca47d0a03bfc39c064d2a1ae88970c67dc3dbce -Author: Cheyenne Wills -Date: Tue Jul 5 10:33:19 2022 -0600 - - Linux-5.19: Remove flags from aops->write_begin - - The Linux 5.19 commits: - - fs: Remove aop flags parameter from grab_cache_page_write_begin() - (b7446e7c) - fs: Remove flags parameter from aops->write_begin (9d6b0cd7) - - removed the flags parameter from the address space operations - 'write_begin' as well as removing the flags parameter from the Linux - function 'grab_cache_page_write_begin'. - - Add an autoconf test to see if grab_cache_page_write_begin takes 2 or - 3 parameters. Use this as a test to determine if the address space - operations 'write_begin' takes a flags parameter. - - Create a version of afs_linux_write_begin that does not take a flags - parameter, which also calls grab_cache_page_write_begin without flags. - - Reviewed-on: https://gerrit.openafs.org/15041 + Change-Id: If89c6f401db04826ef45de83b91240f106cca616 + Reviewed-on: https://gerrit.openafs.org/15389 Tested-by: BuildBot Reviewed-by: Andrew Deason + Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie + Reviewed-by: Kailas Zadbuke + Reviewed-by: Stephan Wiesand + +commit 7a3ad3bc1c87e525698f7dda1e4b0fbbd913da03 +Author: Cheyenne Wills +Date: Wed Mar 22 16:56:09 2023 -0600 + + 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 Reviewed-by: Benjamin Kaduk - (cherry picked from commit 52d8df218ff27c139ede221ec4decf593610fc47) - - Change-Id: I20575c2e9d0979749078f4e3d6f862900c6b6561 - Reviewed-on: https://gerrit.openafs.org/15095 - Tested-by: BuildBot - Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason + (cherry picked from commit 6873dc925c5acc0ce7d65cf778ffee09c82a9898) + + Change-Id: If131bee5b466a119f54b05388a065e6af23698cf + Reviewed-on: https://gerrit.openafs.org/15388 + Tested-by: BuildBot + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Reviewed-by: Kailas Zadbuke Reviewed-by: Stephan Wiesand -commit e8f136dd687a7f7ac5296f52739f46dde8c8543e -Author: Cheyenne Wills -Date: Tue Jul 5 11:45:29 2022 -0600 +commit 30cf5d8f934afdaa5a2a28b2e5fac8adde70808b +Author: Ben Huntsman +Date: Tue Jan 31 11:28:49 2023 -0600 - Linux-5.19: Rename aops readpage to read_folio + AIX: Avoid including net/netisr.h on AIX 7.2 and above - With Linux commits: - mm,fs: Remove aops->readpage (7e0a126519) - fs: Introduce aops->read_folio (5efe7448a1) + On AIX 7.2 and higher, /usr/include/net/netisr.h includes a header + . 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. - the address space operations method 'readpage' was replaced with - read_folio. The operation behaves the same, except instead of taking a - struct page parameter, the new function takes a folio structure. + Reviewed-on: https://gerrit.openafs.org/15312 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit ca67e8c84891200398e577d76c0125966d22b01e) - Add an autoconf test for the address space operation entry read_folio + Change-Id: Icc3e241e09876a4e9ed3e779c1ba904e0762f92c + Reviewed-on: https://gerrit.openafs.org/15386 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit e83ce49c2dfff64b87a265a4250957a2e62c94d2 +Author: Ben Huntsman +Date: Mon Jan 30 19:11:32 2023 -0600 + + comerr: Update rule for compile_et - Replace the references to an address space operations' readpage with - read_folio. Note that the function Linux page_folio can be used to - obtain the required pointer to the folio for a given page. + Update the build rule for compile_et under new platform rs_aix73. - Introduce afs_linux_read_folio that accepts a folio and calls - afs_linux_readpage with the page associated with that folio. - - Reviewed-on: https://gerrit.openafs.org/15040 - Reviewed-by: Andrew Deason + Reviewed-on: https://gerrit.openafs.org/15311 + Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Tested-by: BuildBot - (cherry picked from commit bfb852197edcbe0c38c499faecd7c1be23308a20) + (cherry picked from commit b713b62b3358482a818436a54975596188cb002b) - Change-Id: Iab96bd10a143d88fe37ac8aa8980b33339c76852 - Reviewed-on: https://gerrit.openafs.org/15094 + Change-Id: I726cf21a2c70305c24c3f43f2504e70a98536aa7 + Reviewed-on: https://gerrit.openafs.org/15385 Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 9b94108664330ac4b95a026a8be6c1e260c507fc +Author: Ben Huntsman +Date: Mon Jan 30 19:08:20 2023 -0600 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit d03723e87a16e19a34950ca84a6139095a0694f9) + + Change-Id: I6727512ee343b3ee4cbb03c1e6242a69f407b987 + Reviewed-on: https://gerrit.openafs.org/15384 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit c962d1b91141daceb66c58b30f2acef9e22f36c0 +Author: Ben Huntsman +Date: Thu Aug 25 11:58:31 2022 -0700 + + 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 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 4580f213b3a25dd57e6fd721f7ecc0ecad84fb07) + + Change-Id: I3e0d62258e57ff6a54fae2e49a427c764e03a9ae + Reviewed-on: https://gerrit.openafs.org/15383 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit cff8ef661ba272027e44a0b21d77c3cc4e69b0ef +Author: Ben Huntsman +Date: Thu Aug 25 14:53:00 2022 -0700 + + 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 + Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + (cherry picked from commit f4fc18b80e81f10b17729ef06cca6a9548d36130) + + Change-Id: I0fcc1429111eaafa489adec330b5eb900022293e + Reviewed-on: https://gerrit.openafs.org/15382 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit c6a391f6212860e381373f3c915885ff92a755cf +Author: Ben Huntsman +Date: Thu Aug 25 12:00:51 2022 -0700 + + 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 + Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 1aeac365712f09ac90fe251c90b889548e25ac89) + + Change-Id: I469d94701d3554e74cfdc78686a83e7333210ad4 + Reviewed-on: https://gerrit.openafs.org/15381 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 3a88fb9a73b612473090c505a67d3bd4d707f4ba +Author: Ben Huntsman +Date: Thu Aug 25 14:23:51 2022 -0700 + + 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 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 0c43fe64dd885aed1ec1be4a2419e6396e583ec5) + + Change-Id: I68315c09eb3d6b2e30ea759d4f9bf5726a98e5d7 + Reviewed-on: https://gerrit.openafs.org/15380 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit b6696e67bc7a85d892531a5e7c3a0f03998ba64b +Author: Ben Huntsman +Date: Thu Aug 25 13:15:11 2022 -0700 + + 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 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit ba3e1410d5df4454dc4dc63e1404a261977b0f60) + + Change-Id: I7ec71522f8e35ede3532e3b1d77623ef25510561 + Reviewed-on: https://gerrit.openafs.org/15379 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 927f906f3d0cfdbe6f38608a56f9f92700806f1e +Author: Ben Huntsman +Date: Tue Aug 23 13:15:46 2022 -0700 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 54dbd474a5bd43cf62a226802593b062069509ce) + + Change-Id: Ie59450a91fcb374b1362f0bd88a93f258597a22d + Reviewed-on: https://gerrit.openafs.org/15378 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 2826b3271aea8608fec44174d8b7e1ea7e805d99 +Author: Ben Huntsman +Date: Fri Aug 19 08:34:33 2022 -0700 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit ad2b880c3791046883f8c0ef15f327c85e013b5b) + + Change-Id: Iaef185ec0e045ded8453f6b276e6b6b9075b3388 + Reviewed-on: https://gerrit.openafs.org/15377 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 9d2bfcab35eac3dc0040be10681269daba30f866 +Author: Ben Huntsman +Date: Sat Aug 13 11:40:44 2022 -0700 + + 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 + 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 + Reviewed-by: Jeffrey Altman + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 615681710a38bd1a92f2c476df9fdab7ac1d9bdd) + + Change-Id: I3fcfc1c7e3e26e927d0a8e2a233c4c12b0781308 + Reviewed-on: https://gerrit.openafs.org/15376 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit d00e6d6fb5ec4cf2520ae2c71f38091d950ec785 +Author: Ben Huntsman +Date: Mon Aug 15 10:44:14 2022 -0700 + + 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 + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 319d361499af933451425acaeabac9bc6548c96b) + + Change-Id: I252de19363824ae23187b7b9da878137814ab09d + Reviewed-on: https://gerrit.openafs.org/15375 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 99ea3deeb5b082bdcbd14c41b6a2c11a900bccb4 +Author: Ben Huntsman +Date: Mon Aug 15 10:00:07 2022 -0700 + + 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 + Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit c0968b6c69c3f16468a7fe4a234d8421731e20e0) + + Change-Id: I060b7b102c963a517d79bad41b5e4c827cbccad8 + Reviewed-on: https://gerrit.openafs.org/15374 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 0d845973f05ef70991f0ee8007fb1a2dfdea3ea1 +Author: Ben Huntsman +Date: Sat Aug 13 23:25:10 2022 -0700 + + fsint: export symbol needed by fileserver + + The symbol RXAFS_OpCodeIndex is consumed by the fileserver via the various + "opcode_" 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 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 91532e3142751468aa8f7bbabe7de087b77259bf) + + Change-Id: Ia665937002137dca1a8ec4573b4fe8932fc90dd0 + Reviewed-on: https://gerrit.openafs.org/15373 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit c0cfe72f072ad27c7958b110678134adad7cebbd +Author: Ben Huntsman +Date: Sat Aug 13 11:47:07 2022 -0700 + + 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 + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 448d2b1184e872f977a662c3f48af04029f9a112) + + Change-Id: Iff910b63174c9b046e031285dd30672b0f592c1a + Reviewed-on: https://gerrit.openafs.org/15372 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit b768ba5f1fa15763177cad3ed35e1da5316e7f14 +Author: Ben Huntsman +Date: Mon Aug 15 14:45:12 2022 -0700 + + 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 + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 1a4da8868fd32e928def64599bb6ec9d6b455423) + + Change-Id: I575d89164ef386d1cdf562b2206b502b3c2e8582 + Reviewed-on: https://gerrit.openafs.org/15371 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit f3cdd139d83fc74f89d16ab6f685ec25ea40edf4 +Author: Ben Huntsman +Date: Sat Aug 13 11:40:18 2022 -0700 + + 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 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit b5b34278b26ca22eea988fb18d738969dd608ede) + + Change-Id: Icb91b47d819f1bcc0e277a482f2a22d87dc8bc6c + Reviewed-on: https://gerrit.openafs.org/15370 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 75578909c5071d45eb2a5989917a3e4a9234aace +Author: Andrew Deason +Date: Fri Jul 16 14:02:07 2021 -0500 + + 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 + Tested-by: BuildBot + (cherry picked from commit a912db315b4f29673808a7f900eb038ebd7b89c2) + + Change-Id: Ic106b893f212b33c85bded8443bcb782205f290c + Reviewed-on: https://gerrit.openafs.org/15369 + Tested-by: BuildBot + Reviewed-by: Andrew Deason + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit 567c987992b2e027668186e75017423e5637308b +Author: Andrew Deason +Date: Thu Jul 15 17:53:43 2021 -0500 + + AIX: Add buildsystem support for AIX 7.2 + + Reviewed-on: https://gerrit.openafs.org/14701 + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 7acd66ae39db2049c8f80f4fceb4fcd15fe8e8b8) + + Change-Id: I94e74b56379fe1103d966883835b8af8a0d98f7e + Reviewed-on: https://gerrit.openafs.org/15368 + Tested-by: BuildBot + Reviewed-by: Andrew Deason + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit c8a92c4a7e1badfaf81517303440cd9ac7a55dd0 +Author: Michael Meffie +Date: Thu Mar 15 18:53:59 2018 -0400 + + 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 + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 388eaec3452ed4b18a95ee34efcbe4cf64814701) + + Change-Id: Id93ec414a59a2f5866e503601b7e42bbb4f8d66a + Reviewed-on: https://gerrit.openafs.org/15367 + Tested-by: BuildBot + Reviewed-by: Ben Huntsman + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit c08c7ba8fbf37018176ee87b980650dd34124678 +Author: Cheyenne Wills +Date: Fri Feb 24 13:05:29 2023 -0700 + + 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 + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit 1da00dfa9446c4c881e8659ec48a5e00262828ca +Author: Andrew Deason +Date: Mon Apr 12 18:21:23 2021 -0500 + + 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 + Reviewed-by: Mark Vitale + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 72223e0958c2d7cddd968970547dd73fc3cc1351) + + Change-Id: I9acf5599a8ef1e724a00cf362695fe34ca87c0bf + Reviewed-on: https://gerrit.openafs.org/15331 + Tested-by: BuildBot + Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand -commit 43c926bf4da3f66f3acc013159fb51072e39efdb -Author: Cheyenne Wills -Date: Tue Jul 5 10:28:10 2022 -0600 +commit 002c5a0c758aeb023c0fb2caa2247e8574fff1aa +Author: Andrew Deason +Date: Mon Feb 10 15:57:43 2014 -0600 - Linux: Introduce file mapping readpage helpers + Move key-related warnings to common server code - Create a helper function that determines if a file's - i_mapping->a_ops->readpage - is NULL. + Each server process can log a couple of different warnings about the + server keys found on disk: - Create a helper function that calls a file's - i_mapping->a_ops->readpage + - 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 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 2630e70550defc664efa0952589cf82ed3c51796) + + Change-Id: Ib37b92cfccbf161d72d2db73eeaea6fd8b312961 + Reviewed-on: https://gerrit.openafs.org/15316 + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Reviewed-by: Mark Vitale + Reviewed-by: Stephan Wiesand + +commit 363a3050610ec66483c71c8052ba40337fead942 +Author: Stephan Wiesand +Date: Thu Jan 26 19:30:04 2023 +0100 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 1b92c766f1cf52b3bae3a00e08d40a2334bf9f24) + + Change-Id: I26fb3ff045d41b840fc6565d1a17aca8e75fcd30 + Reviewed-on: https://gerrit.openafs.org/15323 + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Reviewed-by: Mark Vitale + Reviewed-by: Stephan Wiesand + +commit 4a0f5562915b1058de15ec46649c09cdbddce269 +Author: Cheyenne Wills +Date: Wed Jul 7 11:08:10 2021 -0600 + + 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 + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 489cfb587a87ab53817ad0b4eccd65d9f7b332e2) + + Change-Id: Idf9582fd65482f32e7f13af0bf734c2b970da757 + Reviewed-on: https://gerrit.openafs.org/15315 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Mark Vitale + Tested-by: Mark Vitale + Reviewed-by: Stephan Wiesand + +commit 4e4ffde5d0a17e48f82c4b67e921a8881ffc4fe5 +Author: Andrew Deason +Date: Mon May 25 16:48:34 2020 -0500 + + 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 + Tested-by: Benjamin Kaduk + (cherry picked from commit e0c288416df59a117cd818ada930fd1259955983) + + Change-Id: Ie188b9f108bf55cfae7fcb358a1de21bad076f11 + Reviewed-on: https://gerrit.openafs.org/15314 + Tested-by: BuildBot + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie + Reviewed-by: Andrew Deason + Reviewed-by: Stephan Wiesand + +commit 85df2442240c9384822e6658e9aad4f83c19d6e3 +Author: Mark Vitale +Date: Tue Mar 9 23:12:50 2021 -0500 + + 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 + Tested-by: BuildBot + (cherry picked from commit adf08b464efa8c29256dc7b261b10b60cc31119d) + + Change-Id: Ie3ef988d209a984839751051d7bd9a62369b5b11 + Reviewed-on: https://gerrit.openafs.org/15313 + Tested-by: BuildBot + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit 37d01094b929a6bb745aeb00a3f5a40fd8fe5822 +Author: Ben Huntsman +Date: Wed Aug 17 17:19:55 2022 -0700 + + 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 + Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 8b1beaffb40c93ddab50c75b37f3de5ae517a849) + + Change-Id: Id06478cbc87b6965c021f26902e13bdfc2ef83d5 + Reviewed-on: https://gerrit.openafs.org/15309 + Tested-by: BuildBot + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit 7c3c93db2977765a8b82426f0524b380f896b82f +Author: Andrew Deason +Date: Tue Jan 14 10:51:42 2020 -0600 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 4ce922d339777faf647f7129f5ae3f173a7870b1) + + Change-Id: I1a6ce7788e86c32e554f87785f96f1d7b56d1496 + Reviewed-on: https://gerrit.openafs.org/15308 + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit bfb3125fc1b73ae17a346d33a1a34e51379db9c4 +Author: Mark Vitale +Date: Mon May 4 15:55:07 2020 -0400 + + 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 + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 10c5ba12ace51440c7e98add83465a7018961e6f) + + Change-Id: I9584a53154ffe673d19191a0bd9f6a92d6daf140 + Reviewed-on: https://gerrit.openafs.org/15304 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Mark Vitale + Reviewed-by: Stephan Wiesand + +commit 9433217b56afe3f23b2eeeefdb8fa644c2185e4a +Author: Cheyenne Wills +Date: Mon Jun 14 16:13:57 2021 -0600 + + 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 + Reviewed-by: Cheyenne Wills + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 21df433134a059de8d3b3b46bb0892b34d910364) + + Change-Id: I197897f4f7e81bd2f931e3decefe447caae0c5d9 + Reviewed-on: https://gerrit.openafs.org/15301 + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Mark Vitale + Reviewed-by: Stephan Wiesand + +commit bfc7688475fe5d2a178072a8978cf75635a15400 +Author: Andrew Deason +Date: Wed Mar 13 18:30:43 2019 -0500 + + 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 + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 635594d6cceba6de4e09be5a9e9b908f7d16697d) + + Change-Id: I800516335f6ab0d01d2b29dd0ceba9213dafde59 + Reviewed-on: https://gerrit.openafs.org/15300 + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Mark Vitale + Reviewed-by: Benjamin Kaduk + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit 48d9848c5eef99bf1d8552acc055d3b91b2fbcc0 +Author: Yadavendra Yadav +Date: Wed Jul 7 12:32:36 2021 -0400 + + LINUX: defer afs_remunlink when current->fs==NULL + + afs_remunlink is called to delete a file on the fileserver after it + has been silly-renamed (due to being unlinked while the file is open). + Sometimes current->fs is NULL when this happens, typically when the + process is shutting down, after current->fs has been freed and file + handles are getting released. During afs_remunlink, we need to + interact with our cache files, and so we call dentry_open, which calls + security_file_open, which calls into the configured LSM for security + checks. Certain LSMs (e.g. Crowdstrike Falcon) will panic the kernel + in this situation if current->fs is NULL. + + There's no way to skip the LSM hooks, or to flag to the LSM that we're + making an in-kernel VFS call, so the only way to avoid these panics is + to do our I/O in another thread. Fortunately, we already have a way to + defer afs_remunlink calls to a background daemon (CUnlinkedDel), since + we already do this in some cases (when someone else is holding + afs_xvcache or afs_xdcache). + + So, to avoid the panic in the above scenario, defer calls to + afs_remunlink to a background daemon using CUnlinkedDel when + current->fs is NULL, and we're using a disk cache. + + More details on this issue is discussed at following thread: + https://lists.openafs.org/pipermail/openafs-info/2021-March/043073.html + + Reviewed-on: https://gerrit.openafs.org/14691 + Tested-by: BuildBot + Tested-by: Jonathan Billings + Reviewed-by: Benjamin Kaduk + Reviewed-by: Andrew Deason + (cherry picked from commit 9e043e1a0cdca7624de3e27872273263c57027ed) + + Change-Id: If85d992c2639e59af7578ebc295f91d4f8462b69 + Reviewed-on: https://gerrit.openafs.org/15295 + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit b1bbe87643462ae88f8564044d9bff2703fd5123 +Author: Mark Vitale +Date: Sat Mar 27 00:00:17 2021 -0400 + + afs: write-lock vcache->lock in afs_InactiveVCache + + Since the original IBM code import, the comments for + afs_InvalidateAllSegments indicate that vcache->lock W should be held at + entry. However, even back then, only LINUX and IRIX honored this + requirement when the 'inactive' vnode operation reached + afs_InvalidateAllSegments. + + Over the years, a number of commits have changed the operation and + locking for the LINUX inactive vnode op: + + 5293aa35617a6ad35980ce16fdf492ea960cc18a linux-iput-and-glock-changes-20010130 + e8591334602e5e8dad78dc6426d3c44d564572c1 linux-osi-clear-inode-locking-fix-20010816 + 652f3bd9cb7a5d7833a760ba50ef7c2c67214bba linux-dynamic-inodes-20050710 + e0d9e434bb778a2507c1cd6d96c1faa2071f2b2c put-inode-speedup-20050815 + b21c13dc3ab751118220dc31276995050841a1ae linux-dentry-iput-20060813 + + Eventually, ac52e2f3c0bec9298d020de963036409165f380e + linux-dont-lock-around-inactivevcache-20061010 removed the vcache->lock + from afs_dentry_iput (the current OpenAFS handler for inactive vcaches). + The commit message states: + + "iafs_InactiveVCache() [sic] calls afs_InvalidateAllSegments() which says + it should be called with the vnode locked. so the lock should + probably be moved to afs_InactiveVCache() so it can be droppped + before calling afs_remunlink()." + + Unfortunately, the vcache->lock was never moved to afs_InactiveVCache. + + Finally, 3be5880d1d2a0aef6600047ed43d602949cd5f4d 'afs: Avoid panics in + afs_InvalidateAllSegments' introduced a background operation + BInvalidateSegments that contains an assert for vcache->lock. This + assert has exposed the existing lack of proper locking for some paths to + afs_InvalidateAllSegments by causing a kernel panic: + + d_iput -> afs_dentry_iput -> afs_InactiveVCache -> + afs_InvalidateAllSegments -> afs_BQueue(BOP_INVALIDATE_SEGMENTS..) -> + BInvalidateSegments -> osi_Assert(WriteLocked(&vcache->lock)) + + Prevent the panic by modifying afs_InactiveVCache to obtain vcache->lock + W before calling afs_InvalidateAllSegments, and dropping it before + calling afs_remunlink. + + Thanks to Chaskiel Grundman for reporting and diagnosing the problem. + + Reviewed-on: https://gerrit.openafs.org/14584 + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit f02be4e3b89382317a3baa496f9cb672cdb4b32a) + + Change-Id: I38dc6e5d70b1743b96d2a227d28e58d1950b5835 + Reviewed-on: https://gerrit.openafs.org/15324 + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Mark Vitale + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + Reviewed-by: Stephan Wiesand + +commit 1023b96ab1ea842c883c070e6197e71826dbe8be +Author: Marcio Barbosa +Date: Wed Apr 20 13:06:17 2022 +0000 + + cmdebug: Print AFSFid fields as unsigned integers + + Currently, AFSFid fields are printed as signed integers. As a result, + large numbers can be erroneously printed as negative numbers. + + To fix this problem, print AFSFid fields as unsigned integers. + + Reviewed-on: https://gerrit.openafs.org/14950 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 29a89c82ad422f88b0898ad07e773dc2e71be983) + + Change-Id: Ieb303354f1332abb8278e62252c4842baa2132c7 + Reviewed-on: https://gerrit.openafs.org/15302 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Stephan Wiesand + +commit d2429aec59fb3cc7d8a2cc94aa9e0ce8256ecb94 +Author: Andrew Deason +Date: Wed Jun 3 15:53:48 2020 -0500 + + vol: Introduce and use FDH_BLOCKSIZE + + A couple of places in src/volser currently have some logic to get the + size and blocksize of a file. The existing logic is nontrivial due to + platform-specific quirks, and ignores afs_fstat errors. + + To fix these issue and consolidate the code into one place, introduce + a new function, FDH_BLOCKSIZE, which gets the file size and blksize. + Update the places in src/volser to use the new function. + + Reviewed-on: https://gerrit.openafs.org/14662 + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 939787565d5be55a8a803043dbc4f27b3f11b906) + + Change-Id: I32c73e87fa0b6b0b45971e06b8d8c5653f882f7b + Reviewed-on: https://gerrit.openafs.org/15303 + Reviewed-by: Michael Meffie + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 1eac15a85a50b1c322dd460f5c747538c88c1a31 +Author: Cheyenne Wills +Date: Mon Jan 10 18:11:58 2022 -0700 + + afs.h: fix out of tree build failures + + There are several compiler errors and warnings when building an out of + tree program that includes "afs/afs.h". + + - Errors for unknown type names 'afs_ucred_t' and 'wait_queue_head' + .../afs/afs.h:1542:16: error: unknown type name ‘afs_ucred_t’ + ... | afs_set_cr_uid(afs_ucred_t *cred, uid_t uid) { + .../afs/afs.h:1605:5: error: unknown type name ‘wait_queue_head_t’ + ... | wait_queue_head_t cond; + + - Warnings about declaring structures within missing declarations for + the structs: osi_File, dcache and afs_FetchOutput + .../afs/afs.h:1486:36: warning: ‘struct osi_file’ declared inside + parameter list will not be visible outside of this definition or + declaration + ... | int (*read)(void *rock, struct osi_file *tfile, + afs_uint32 offset, + + - Unable to find the file for the include opr/jhash.h + + The missing type name 'afs_ucred_t' is due to miss-placed declarations + for some kernel only functions. + + The type name 'wait_queue_head' is a data type for Linux kernel modules. + + The warnings for the missing declarations are due to either references + to the structures before they are declared, or because they are not + available in any of the other public header files. + + To fix the unknown type name afs_ucred_t, relocate the function + declarations that reference 'afs_ucred_t' into the KERNEL only section + (since afs_ucred_t is a kernel specific type). + + To fix the unknown type name 'wait_queue_head', relocate the afs_event + structure and the afs_evhasht variable to be within the KERNEL only + section. + + To resolve the warnings associated with the structures, simply declare + the structure names before they are referenced. All references that + are resulting in the warnings are declarations for pointers. + + Relocate the include for opr/jhash.h and the define for VCSIZE into the + kernel block. + + Reviewed-on: https://gerrit.openafs.org/14857 + Tested-by: BuildBot + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 92342b099dd5ea539efc5ad119d36a87647c0895) + + Change-Id: Ib321796e473495d7d8774133c5e690b53bb26c17 + Reviewed-on: https://gerrit.openafs.org/15299 + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 80cb460a8b434fa7fb2dacf642d54de1c0af5314 +Author: Andrew Deason +Date: Sun Apr 5 16:29:52 2020 -0500 + + libafs: Serialize INSTDIRS/DESTDIRS and COMPDIRS + + Our libafs build logic involves a few targets that 'cd' into a + per-kernel subdir: notably INSTDIRS and DESTDIRS (the targets to 'make + install' or 'make dest' our kernel modules) and COMPDIRS (the target + to setup/build the kernel module). + + Both of these potentially 'cd' into a subdirectory (e.g. MODLOAD64), + and run some make rules. Since INSTDIRS and COMPDIRS are different + targets and don't depend on each other for many platforms, running + those rules can happen in parallel. After they 'cd' into the relevant + dir, they run a new 'make' in a subshell, and so underlying rules for + building e.g. AFS_component_version_number.c are not serialized. + + So for a parallel build on, say, Solaris, we can encounter errors when + two sub-makes try to make AFS_component_version_number.c at the same + time, which looks something like this (with various lines output from + other sub-processes mixed in): + + cd src && cd sys && gmake install + gmake[3]: Leaving directory '/[...]/src/libuafs' + rm -f AFS_component_version_number.c.NEW + /opt/developerstudio12.6/bin/cc [...] -D_KERNEL -DSYSV -dn -m64 -xmodel=kernel -xvector=%none -xregs=no%float -Wu,-save_args -o AFS_component_version_number.o -c AFS_component_version_number.c + mv: cannot access AFS_component_version_number.c.NEW + gmake[4]: *** [/[...]/src/config/Makefile.version:13: AFS_component_version_number.c] Error 2 + gmake[4]: Leaving directory '/[...]/src/libafs/MODLOAD64' + gmake[3]: *** [Makefile:85: solaris_instdirs] Error 2 + gmake[3]: *** Waiting for unfinished jobs.... + + To avoid this, just make INSTDIRS and DESTDIRS depend on COMPDIRS, so + we can make sure they don't run at the same time. + + Reviewed-on: https://gerrit.openafs.org/14137 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 3db8c37e8ef6bea0f03ef6b8f82ed93d52937d7d) + + Change-Id: Ied7875e885f51a6d3f00d65f1783df9439a18ae3 + Reviewed-on: https://gerrit.openafs.org/15298 + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 30dc7fd2acbe756d5e618a6da484f0eebaf07e07 +Author: Andrew Deason +Date: Sat Sep 22 01:58:17 2018 -0500 + + SOLARIS: Fix libafs $(KOBJ) parallel make race + + Currently, our COMPDIRS make rule for SOLARIS libafs builds looks like + this: + + ${COMPDIRS} ${INSTDIRS} ${DESTDIRS}: + for t in $(KOBJ) ; do + # set some variables ; \ + cd $$t ; \ + $(MAKE) $@_libafs || exit $$? ; \ + cd ../ ;\ + done + + And Makefile.common has this: + + all: setup $(COMPDIRS) + + Where the 'setup' rule creates the $(KOBJ) dirs and sets up some + symlinks. + + For parallel builds, this means that our commands in the ${COMPDIRS} + target can be running in parallel with the 'setup' target, and so our + $(KOBJ) dirs may not exist by the time we try to 'cd $$t'. + + For single-KOBJ platforms this actually largely works, since the 'cd' + will fail, but then the subsequent 'make' will run (just in the wrong + dir), but this can cause us to wastefully re-compile the same source + files (and cause some possibly confusing error messages). For + platforms with multiple KOBJs, this causes obvious problems, since we + don't cd into each KOBJ dir. + + To solve this, just have the ${COMPDIRS}/etc rule depend on setup, so + we know that 'setup' has finished running. Also change our way of + 'cd'ing into each KOBJ dir to actually cause the rule to fail, to make + any errors here more obvious and consistent. + + Reviewed-on: https://gerrit.openafs.org/13344 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 00aa9200be86b187c903503e56b2af55639ea2b8) + + Change-Id: I4b68cc8aa7b50f792152c2c00da6c6e3684755b7 + Reviewed-on: https://gerrit.openafs.org/15297 + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 69839045c269af1b7023159e78dbc59e13e6202a +Author: Cheyenne Wills +Date: Wed Feb 9 14:00:13 2022 -0700 + + autoconf: Additional library test for ncurses + + Depending on how the ncurses libraries were built the external symbol + 'LINES' may be replaced with the '_nc_LINES' external symbol. Because + the symbol 'LINES' may or may not be present, the autoconf test can fail + to detect the correct libraries needed for curses support. + + Add an additional AC_CHECK_LIBs for the symbol _nc_LINES (within the + ncurses or tinfo libraries) when setting the $LIB_curses. + + This commit was adapted from the openSuSE source packaging for openafs. + + Background: when ncurses is built with --enable-reentrant, LINES is + defined as a C preprocessor macro that expands to a call to _nc_LINES + + Reviewed-on: https://gerrit.openafs.org/14889 + Tested-by: BuildBot + Reviewed-by: Ralf Brunckhorst + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit c98994dd116121af75f6df6891e706957c6c953d) + + Change-Id: I6eb15897f48eb93d72739965c10b5f51b21d7336 + Reviewed-on: https://gerrit.openafs.org/15296 + Reviewed-by: Michael Meffie + Reviewed-by: Cheyenne Wills + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit f7625760d515a4954596526e78b9a8c2a9e9ec13 +Author: Stephan Wiesand +Date: Wed Jan 18 14:18:08 2023 +0100 + + afs: check for non-NULL before memset in afs_LookupName + + Commit 981bc005f8161ca9ee52ea281c7d73e0e4e2461a refactored PNewStatMount + and PFlushMount by moving their common logic to a new function + afs_LookupName(). In this function, the output parameters are zeroed. + However, this is done before checking that their pointers are valid. + Add additional checks before memset(). + + Reviewed-on: https://gerrit.openafs.org/15283 + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit e2890626bc11964dd96cde0d7d8dd7fdfcf90857) + + Change-Id: I213ea7e23e01e7902919919581ad1d8e596303a2 + Reviewed-on: https://gerrit.openafs.org/15292 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit cba2b88851c3ae0ab1b18ea3ce77f7f5e8200b2f +Author: Jeffrey Hutzelman +Date: Tue Mar 1 10:31:14 2022 -0500 + + LINUX 5.13: set .proc_lseek in proc_ops + + When using the proc_ops structure, set .proc_lseek explicitly rather + than leaving it unset. This field has always been present in proc_ops, + but prior to Linux 5.13, it could be unset, causing default_llseek to be + used. Starting with commit d4455faccd6 (proc: mandate ->proc_lseek in + "struct proc_ops"), this field is now mandatory. + + This fixes a problem which would cause an oops if llseek(2) is called + on /proc/fs/openafs/afs_ioctl. + + Reviewed-on: https://gerrit.openafs.org/14918 + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 68851b782ca2cb5e4ae7457255841f44f3bef15c) + + Change-Id: Ifd3a517f595cfef7fd9dd1fdd3f3aca8fe1bc25f + Reviewed-on: https://gerrit.openafs.org/15286 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit b885159cc2bc6c746aec1d54cdd8a515d1115d14 +Author: Cheyenne Wills +Date: Wed Dec 14 13:40:48 2022 -0700 + + Linux: Replace lru_cache_add with folio_add_lru + + The Linux 6.2 commit: + "folio-compat: remove lru_cache_add()" (6e1ca48d0) + removed the lru_cache_add() function (which was introduced in Linux 5.8) + + The replacement function is folio_add_lru(), which was introduced with + the Linux 5.16 commit: + "mm/lru: Add folio_add_lru()" (0d31125d2d) + + Reviewed-on: https://gerrit.openafs.org/15227 + Reviewed-by: Benjamin Kaduk + Tested-by: Benjamin Kaduk + (cherry picked from commit cfac0df9cd7152be2672c665442aac84215494d6) + + Change-Id: I74535bf83cdd47c9dd60a7114ec7694ae9981c9b + Reviewed-on: https://gerrit.openafs.org/15281 + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Stephan Wiesand + +commit f0fee2c7752d18ff183d60bcfba4c98c3348cd5f +Author: Cheyenne Wills +Date: Fri Nov 18 08:41:50 2022 -0700 + + Linux: Check for block_dirty_folio + + The build for the openafs Linux kernel module fails on RHEL9.1 with an + undefined function reference for block_dirty_folio(). + + RedHat 9.1 includes the Linux commit: + fs: Add aops->dirty_folio (6f31a5a261db) + which added the dirty_folio member to the address_space_operations + structure. + + However RedHat 9.1 does not include the following 2 Linux commits: + fs: Convert __set_page_dirty_buffers to block_dirty_folio (e621900ad2) + which introduced block_dirty_folio() as a function that could be used to + handle the address_space_operations's dirty_folio operation. + + And + fs: Remove aops ->set_page_dirty (3a3bae50af) + which removed the set_page_dirty member in the address_space_operations + structure. + + The openafs commit: + Linux-5.18 replace set_page_dirty with dirty_folio (6aa129e743e88) + introduced an autoconf test that checks for the presence of aops' + dirty_folio member and assumed that the Linux function + block_dirty_folio() was also provided (since all three of the above + Linux commits were added in Linux-5.18-rc1). + + Without the (e621900ad2) commit, the openafs Linux kernel module fails + to build since block_dirty_folio() is not defined by Linux. + + Introduce new autoconf tests that checks for the presence of the + block_dirty_folio() function. + + Change the preprocessor conditional within LINUX/osi_vnodeops.c to only + use dirty_folio if aops has dirty_folio and block_dirty_folio() is + available. When block_dirty_folio() is not available, we continue to + use the older set_page_dirty method, which remains a valid method until + its removal by the (3a3bae50af) Linux commit. + + Note: Reviewing the Linux source for RedHat 9.1 shows that there is only + one location that is defining the dirty_folio member and it is providing + its own function instead of relying on block_dirty_folio. + + Reviewed-on: https://gerrit.openafs.org/15199 + Tested-by: BuildBot + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + (cherry picked from commit e7737edb932a1c4d55a2551a44e481b40310c96d) + + Change-Id: If29ad539c5530289ffa49aa1fa489f612e9f5c78 + Reviewed-on: https://gerrit.openafs.org/15228 + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit 9d217903f0c7f6b260f166fad6dbf77c67df7c2d +Author: Marcio Barbosa +Date: Thu Feb 13 00:39:00 2020 -0300 + + vos: take RO volume offline during convertROtoRW + + The vos convertROtoRW command converts a RO volume into a RW volume. + Unfortunately, the RO volume in question is not set as "out of service" + during this process. As a result, accesses to the volume being converted + can leave volume objects in an inconsistent state. + + Consider the following scenario: + + 1. Create a volume on host_b and add replicas on host_a and host_b. + + $ vos create host_b a vol_1 + $ vos addsite host_b a vol_1 + $ vos addiste host_a a vol_1 + + 2. Mount the volume: + + $ fs mkmount /afs/.mycell/vol_1 vol_1 + $ vos release vol_1 + $ vos release root.cell + + 3. Shutdown dafs on host_b: + + $ bos shutdown host_b dafs + + 4. Remove RO reference to host_b from the vldb: + + $ vos remsite host_b a vol_1 + + 5. Attach the RO copy by touching it: + + $ fs flushall + $ ls /afs/mycell/vol_1 + + 6. Convert RO copy to RW: + + $ vos convertROtoRW host_a a vol_1 + + Notice that FSYNC_com_VolDone fails silently (FSYNC_BAD_STATE), leaving + the volume object for the RO copy set as VOL_STATE_ATTACHED (on success, + this volume should be set as VOL_STATE_DELETED). + + 7. Add replica on host_a: + + $ vos addsite host_a a vol_1 + + 8. Wait until the "inUse" flag of the RO entry is cleared (or force this + to happen by attaching multiple volumes). + + 9. Release the volume: + + $ vos release vol_1 + + Failed to start transaction on volume 536870922 + Volume not attached, does not exist, or not on line + Error in vos release command. + Volume not attached, does not exist, or not on line + + To fix this problem, take the RO volume offline during the vos + convertROtoRW operation. + + Reviewed-on: https://gerrit.openafs.org/14066 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 32d35db64061e4102281c235cf693341f9de9271) + + Change-Id: I00a99819ac7d1d981695da3eae1bd60de1cb53ae + Reviewed-on: https://gerrit.openafs.org/15233 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit 5a48ce589a24f2280b085e50718b05d08db918bd +Author: Marcio Barbosa +Date: Fri Mar 6 15:15:38 2020 +0000 + + vol: fix namei_ConvertROtoRWvolume return code + + Commit 8632f23d6718a3cd621791e82d1cf6ead8690978 introduced checks for + the return value of snprintf calls in namei_ops. On success, the value + returned by this function represents the number of written characters. + Unfortunately, the variable used to store this value is the same + variable that represents the status code returned by + namei_ConvertROtoRWvolume. Consequently, a successful execution of + namei_ConvertROtoRWvolume results in a status code different the 0 (and + equal to the number of written characters). + + To fix this problem, set the status code in question back to 0 after a + successful execution of namei_ConvertROtoRWvolume. + + Reviewed-on: https://gerrit.openafs.org/14065 + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 957b06984b77cba74bd90217b723220c1844809b) + + Change-Id: If82cf4d2983e7b6f8975ca4a9fa104ee5e36b917 + Reviewed-on: https://gerrit.openafs.org/15232 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit 3084117f10bd62acb1182cb54fc85b1d96738f70 +Author: Cheyenne Wills +Date: Fri Nov 4 08:33:39 2022 -0600 + + Linux: Fix functions without prototypes + + The Linux kernel build has -Wstrict-prototypes enabled and flags + functions without a proper prototype. With clang-16 these warnings are + reported as errors when the kernel is configured with CONFIG_WERROR or + when openafs is configured with --enable-checking. + + src/libafs/MODLOAD-6.1.0-rc3-SP/osi_alloc.c:339:32: error: a + function declaration without a prototype is deprecated in all + versions of C [-Werror,-Wstrict-prototypes] + osi_linux_verify_alloced_memory() + ^ + void + + Update function prototypes to comply with -Wstrict-prototypes. There are no functional changes with this commit. - Note: This commit isolates references to 'readpage' so that future - commits can change the name in a more straight forward manner. - - Reviewed-on: https://gerrit.openafs.org/15039 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Benjamin Kaduk - (cherry picked from commit a81f7300f08d6e515adbde4bce4b72a3102b60f9) - - Change-Id: I9268fd2622ecd48ad6971a8faaeefef8128f4024 - Reviewed-on: https://gerrit.openafs.org/15093 - Tested-by: BuildBot - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Reviewed-by: Stephan Wiesand - -commit 6997f890445680ecda572778155c900ba9147b7b -Author: Cheyenne Wills -Date: Mon Jun 27 08:38:25 2022 -0600 - - Linux-5.18: replace readpages with readahead - - The linux 5.18 commit 'fs: Remove ->readpages address space - operation' (704528d8) removes the address_space_operations operation - "readpages", which is replaced with the "readahead" operation - that was introduced with the 5.8 commit 'mm: add readahead address - space operation' (8151b4c8). - - When readahead is called, the pages in 'rac' have already been added to - the lru caches and are locked. For each page that we get from the 'rac' - (i.e. from 'readahead_page(rac)'), we must unlock and put_page the page; - if we successfully populated the page with data, we also set - PageUpToDate. If we don't process all the pages in 'rac', the caller - will handle cleaning up any remaining pages; we don't need to unlock/put - them or touch them at all. - (See Linux Documentation/filesystems/vfs.rst) - - Add an autoconf test to detect the presence of 'readahead' in the - address_space_operations structure. - - For the implementation of readahead (which is contained in Linux's - osi_vnodeops.c): - - Add new functions 'afs_linux_bypass_readahead' and 'afs_linux_readahead' - as replacements for 'afs_bypass_readpages' and 'afs_linux_readpages' - when the linux kernel supports the readahead operation. - - Notes: - In afs_linux_bypass_readahead, the pages are already locked and are - already in the page cache, we just need to place the page into the - iovecp. The page's refcount will be decremented and will be unlocked - when processing the read request. - - In afs_linux_readahead, the lrupages is needed in case a page is added - to the cachefp's mapping in afs_linux_read_cache (which also handles - unlocking the page). - - In afs_linux_readahead, if there is no tdc, we must still unlock the - page otherwise the read process will wait on that page. - - Reviewed-on: https://gerrit.openafs.org/14953 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 7a181415db1b2142d125714f1dea32879e2ca07d) - - Change-Id: I2ed4f22bd2b12c76586ae5326841a23735a20af0 - Reviewed-on: https://gerrit.openafs.org/15065 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Tested-by: Michael Laß - Reviewed-by: Stephan Wiesand - -commit 45bf0cc73db964f52c74f3b5b09b1de26d79b35f -Author: Cheyenne Wills -Date: Tue Jun 7 12:19:44 2022 -0600 - - Prevent sscanf format widths from overrunning array - - cppcheck noted these instances of sscanf could wipe out the ending null - terminator. Length is now macro expanded rather than hard coded and the - array itself is one unit longer to avoid the overrun. - - Reviewed-on: https://gerrit.openafs.org/13136 - Reviewed-by: Michael Meffie + Reviewed-on: https://gerrit.openafs.org/15194 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Benjamin Kaduk - (cherry picked from commit 1162fcdba6c5234f4ac36e17f29e01ae04950004) + (cherry picked from commit 63db2de22ef75292463ec1f0979e32afc05d0b95) - Change-Id: I1759f4c11df003c6d0798910db9210ff91b95536 - Reviewed-on: https://gerrit.openafs.org/15064 - Tested-by: BuildBot - Reviewed-by: Andrew Deason + Change-Id: I2e9c09c3b88ca3597720b1d8885537600d307418 + Reviewed-on: https://gerrit.openafs.org/15275 Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: BuildBot Reviewed-by: Stephan Wiesand -commit 07b78426fe223b23bbb4739a4f017a49c97b8d29 +commit c990b0d086632aef51585beabb42fd9ff22d1fc4 Author: Cheyenne Wills -Date: Tue Jun 21 09:50:41 2022 -0600 +Date: Thu Dec 1 10:00:06 2022 -0700 - opr: replace AFS_STRINGIZE with opr_stringize + libadmin: Fix RPCStatsStateGet 'rpc' prototype - To avoid adding new includes for afs/afsutil.h in order to use - 'AFS_STRINGIZE', create a replacement, 'opr_stringize', in afs/opr.h. + clang-16 is flagging a incompatible-function-pointer-types warning which + results in build errors when --enable-warning is turned on. - Replace the usage of 'AFS_STRINGIZE' with opr_stringize and remove the - definition of 'AFS_STRINGIZE' + client.c:498:13: error: incompatible function pointer types passing + 'int (struct rx_connection *, afs_int32 *)' + (aka 'int (struct rx_connection *, int *)') to parameter of type + 'int (*)(struct rx_connection *, afs_RPCStatsState_p)' + (aka 'int (*)(struct rx_connection *, afs_RPCStatsState_t *)') + [-Wincompatible-function-pointer-types] - Reviewed-on: https://gerrit.openafs.org/15029 - Reviewed-by: Michael Meffie + (conn, RXSTATS_QueryPeerRPCStats, &state, &st)) { + ^~~~~~~~~~~~~~~~~~~~~~~~~ + + Update the 'util_RPCStatsStateGet()' function's parameter to match the + function type for the RPC functions actually being called. + + Reviewed-on: https://gerrit.openafs.org/15180 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk - (cherry picked from commit 7f54bbe1568ea66d04bf69f5f083aa0422fcb417) + (cherry picked from commit 97f0a20e50f027fe00adb22c39b71f0ac79f1ff7) - Change-Id: I09fe7ba2191d1522342ac2a935afc40b1c67b7a4 - Reviewed-on: https://gerrit.openafs.org/15063 - Tested-by: BuildBot - Reviewed-by: Andrew Deason + Change-Id: Icbbbd137fa6a404090ef7af94621100bb552d502 + Reviewed-on: https://gerrit.openafs.org/15274 Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: BuildBot Reviewed-by: Stephan Wiesand -commit f6e6ed4b316378031676d7180b9e71336a3c9f62 +commit 973c5c585f59c0e88a2852d290abcb5e8fdf2b86 Author: Cheyenne Wills -Date: Tue Jun 7 11:14:55 2022 -0600 +Date: Thu Dec 1 12:09:09 2022 -0700 - lwp: Ignore dangling-pointer warning in process.c + clang-16: Fix simple unused-but-set variables - In lwp/process.c the address of a stack variable is saved as part of - creating a new context. GCC-12 is flagging the statement with a - diagnostic: + Clang-16 is flagging variables as unused-but-set-variables resulting in + build errors when --enable-warning is used. - ./process.c:46:24: error: storing the address of local variable - ‘stackvar’ in ‘*savearea.topstack’ [-Werror=dangling-pointer=] - 46 | savearea->topstack = (char *)&stackvar; - | ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~ + db_verify.c:996:9: error: variable 'builtinUsers' set but not used + [-Werror,-Wunused-but-set-variable] + int builtinUsers = 0; + ^ + Remove the variables that are set but never actually used. - In this particular case, the code is meaning to save the address of the - stack in preparation of setting up a new context, which requires knowing - the address the current stack. + This commit fixes the simpler cases where variables are only set but + not used elsewhere. - The diagnostic is changed from a warning to an error when configured - with --enable-checking. - - Set the env variable CFLAGS_NODANGLING_POINTER to - '-Wno-dangling-pointer' if the compiler supports the option and update - the src/lwp/Makefile.in to use the flag when compiling process.c - - Reviewed-on: https://gerrit.openafs.org/14957 - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 748ae0fc25c51316d741afd9b9dfd479ffdf3250) - - Change-Id: I03d2d4a77b4a391f023f40e9793968e03a50c241 - Reviewed-on: https://gerrit.openafs.org/15062 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit f034932791d9bcf0ed23a79ab1d0913a3e338881 -Author: Cheyenne Wills -Date: Tue Jun 21 09:57:40 2022 -0600 - - afs: Avoid always-false NULL test on AFSTOV(avc) - - GCC-12 is flagging a comparison with the following diagnostic: - - src/afs/afs_vcache.c:3161:25: error: the comparison will always - evaluate as ‘false’ for the address of ‘v’ will never be NULL - [-Werror=address] - 3161 | AFSTOV(avc) == NULL || vType(avc) == VDIR || - | ^~ - - When the vcache structure does not have the vnode embedded the expansion - of the AFSTOV macro results in: - ((avc)->v) - which tests contents of a 'v'. - - When the vcache structure does have the vnode embedded, the expansion of - the macro results in: - (&(avc)->v) - which tests the address of 'v', which will never be NULL in this case. - - Update afs.h to add a new define 'AFS_VCACHE_EMBEDDED_VNODE' when the - vcache structure contains an embedded vnode structure. Restructure the - preprocessor statements for the AFSTOV definition - - Avoid testing AFSTOV(x) against NULL when AFS_VCACHE_EMBEDDED_VNODE is - defined. - - The diagnostic is changed from a warning to an error when configured - with --enable-checking. - - Reviewed-on: https://gerrit.openafs.org/14956 - Reviewed-by: Michael Meffie + Reviewed-on: https://gerrit.openafs.org/15178 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk - (cherry picked from commit 1d1a20c33258a9285a16e85a55df9c0fbf4a3ac2) + (cherry picked from commit afafde158ff875d2459bb81ac373cde3e45dac03) - Change-Id: Ieeb2b958c20aabbb412023c8e60c6d68e961c4b8 - Reviewed-on: https://gerrit.openafs.org/15061 - Tested-by: BuildBot - Reviewed-by: Andrew Deason + Change-Id: I65cd27325b768ba192831401f4ac71e94071ecc7 + Reviewed-on: https://gerrit.openafs.org/15273 Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: BuildBot Reviewed-by: Stephan Wiesand -commit f5de30623d1442fb3911e2deae4c12507f093ab8 +commit f336d0aa01d208b1a7f3c1c509e2bd5d4d11f095 Author: Cheyenne Wills -Date: Thu Jun 9 13:20:02 2022 -0600 +Date: Wed Nov 2 14:47:04 2022 -0600 - afs: introduce get_dcache_readahead + clang-16: Fix conditionally unused-but-set variables - Relocate the block of code that obtains the dcache for a readahead - operation from the afs_linux_readpages function into its own static - function. + clang-16 is flagging unused-but-set variables which result in build + errors when --enable-warning is turned on. - Reviewed-on: https://gerrit.openafs.org/14962 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 44e24ae5d7dc41e54d23638d5f64ab2e81e43ad0) + remote.c:485:15: error: variable 'pass' set but not used + [-Werror,-Wunused-but-set-variable] + afs_int32 pass; + ^ + These variables are actually used in specific cases depending on + build configuration (e.g. AFS_PTHREAD_ENV, etc.). - Change-Id: I5fce05cd241dc5a22526d931969cf11da89e3d48 - Reviewed-on: https://gerrit.openafs.org/15060 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit 5c9ec0359914e641da69b5490150e74d8ce3b8a7 -Author: Cheyenne Wills -Date: Mon Jun 6 12:27:43 2022 -0600 - - afs: introduce afs_alloc_ncr/afs_free_ncr + Relocate these variables so they are fully defined or referenced within + preprocessor '#if' blocks. - There is duplicated code for initializing a nocache_read_request - and also freeing the associated storage in certain cases. Create a set - of helper functions that allocates and frees a nocache_read_request and - its associated structures. - - afs_alloc_ncr allocates a nocache_read_request structure and if not - UKERNEL, will allocate and initialize the associated uio and iovec - structures. - - afs_free_ncr releases a noncache_read_request structure and the - associated uio and iovec structures if not UKERNEL. - - Update locations that allocate/free nocache_read_request structures to - use the new functions. - - Reviewed-on: https://gerrit.openafs.org/14954 - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 209eb92448001e59525413610356070d8e4f10a0) - - Change-Id: Id9c23195e062c720fdbde83a9b5d36fb287aa8a4 - Reviewed-on: https://gerrit.openafs.org/15059 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit 52061e0670e3ba4571cee887c6a04f6035490c95 -Author: Cheyenne Wills -Date: Wed Mar 30 11:09:45 2022 -0600 - - Linux-5.18 replace set_page_dirty with dirty_folio - - The commits going into Linux 5.18: - - fs: Add aops->dirty_folio (6f31a5a261db) - fs: Convert __set_page_dirty_buffers to block_dirty_folio (e621900ad2) - fs: Remove aops ->set_page_dirty (3a3bae50af) - - replaces the address_space_operations structure member set_page_dirty - which with dirty_folio. The linux function __set_page_dirty_buffers is - replaced by block_dirty_folio. - - Nothing within afs uses or implements the set_page_dirty function, - however the structure member is required to be initialized. - - Add an autoconf test for the dirty_folio member and if present, set the - address_space_operations member dirty_folio to block_dirty_folio - instead of setting the set_page_dirty member. - - Reviewed-on: https://gerrit.openafs.org/14939 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 6aa129e743e882cf30c35afd67eabf82274c5fca) - - Change-Id: I8afccecae7971d98f87a65db816c337fb2380854 - Reviewed-on: https://gerrit.openafs.org/15058 - Tested-by: BuildBot - Reviewed-by: Michael Laß - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit 1909260bb2cd2028e697f42ebd745e9ac12334d2 -Author: Cheyenne Wills -Date: Wed May 11 08:48:52 2022 -0600 - - afsd: Avoid fscanf overflows when paring cacheinfo - - clang-14 is producing the following diagnostic: - - afsd.c:581:44: error: 'fscanf' may overflow; destination buffer in - argument 3 has size 1024, but the corresponding specifier may - require size 1025 [-Werror,-Wfortify-source] - fscanf(cachefd, "%1024[^:]:%1024[^:]:%d", tCacheMountDir, - - fscanf is being used to parse the contents of a file and the buffer - sizes are hardcoded. Simply increase the size of the 2 buffers by 1. - - The diagnostic warning is changed to an error when configured with - --enable-checking. - - Reviewed-on: https://gerrit.openafs.org/14958 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 82c14b9a667174f044b7421e6e081ad323720a67) - - Change-Id: I81b5563599272b8f224962941d179ae2e93f7f47 - Reviewed-on: https://gerrit.openafs.org/15057 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit 80be173ac14d02af725c7ee1db9043ae79e6b535 -Author: Cheyenne Wills -Date: Tue May 24 20:14:36 2022 -0600 - - vol: Use asprintf in _namei_examine_special - - GCC-12 is flagging an snprintf statement with a format truncation - warning: - - namei_ops.c: In function ‘namei_ListAFSSubDirs’: - namei_ops.c:2029:22: error: ‘%s’ directive output may be truncated - writing up to 255 bytes into a region of size between 0 and 511 - [-Werror=format-truncation=] - - Change code to use asprintf instead of snprintf. Return an error if a - memory allocation fails. - - Reviewed-on: https://gerrit.openafs.org/14955 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit ae70db6cde5be5abd3bbbb26bd9af6fe68cc4b6b) - - Change-Id: I742e0210ac35eec7a143a780db4a6047a0a7c3fc - Reviewed-on: https://gerrit.openafs.org/15056 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit 05d8ecd96ddab47f449089c2a9627a314d585e1d -Author: Cheyenne Wills -Date: Thu Jul 16 15:07:15 2020 -0600 - - autoconf: fix detection for fallthrough attribute - - Due to bug , - ax_gcc_func_attribute.m4 fails to properly detect __attribute__((fallthrough)) - in clang. Until this is fixed in autoconf-archive upstream, fix our - local copy of ax_gcc_func_attribute.m4, so we can detect - __attribute__((fallthrough)) to make --enable-checking work with clang. - - Reviewed-on: https://gerrit.openafs.org/14273 + Reviewed-on: https://gerrit.openafs.org/15177 Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk Tested-by: BuildBot - (cherry picked from commit 899b1af4183fb09fd55a36e3d10ffbdb9671a47e) + (cherry picked from commit 97018ace991d300a6ff75a1dcd1a69b4044f2b89) - Change-Id: Ia7398f958897e326722a77db2e64262212ff3367 - Reviewed-on: https://gerrit.openafs.org/15055 - Tested-by: BuildBot - Reviewed-by: Andrew Deason + Change-Id: Iee3a196d9c23a8725171db4a3a884a077f0e95ac + Reviewed-on: https://gerrit.openafs.org/15277 Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: BuildBot Reviewed-by: Stephan Wiesand -commit b18c2f580f5680016dca748a77f64ca4f2778606 +commit fb3071563922df8172bab261e8f0c3e3e779b666 Author: Cheyenne Wills -Date: Tue Mar 1 15:35:07 2022 -0700 +Date: Thu Dec 1 09:05:58 2022 -0700 - cf: Use -Werror when checking for -Wno-* flags + clang-16: Fix unused-but-set 'for' control vars - When detecting valid compiler flags clang behaves differently than gcc - for certain types of flags. Specifically, gcc will ignore an unknown - "-Wno-someflag" while clang will issue a warning. If using clang and - --enable-checking is specified, this difference causes a build failure - because the warning for the unknown flag is turned into an error. + clang-16 is flagging unused-but-set variables which result in build + errors when --enable-warning is turned on. Several of these variables + are used within 'for(..)' loops but are not actually referenced anywhere + else. - The autoconf macro AX_APPEND_COMPILE_FLAGS (via the underlying macro - AX_CHECK_COMPILE_FLAGS) looks specifically for errors and not warnings - to determine if the flag is valid. In order to properly catch the above - type of unknown compiler flags, a '-Werror' must be passed as an - extra-flag. + fcrypt.c:181:16: error: variable 'i' set but not used + [-Werror,-Wunused-but-set-variable] + afs_uint32 i, j; + ^ + Refactor the for statements to eliminate the unused variables. - Update the autoconf functions that use AX_APPEND_COMPILE_FLAGS to use - '-Werror' as an extra flag when testing for "-Wno-..." flags. + Note, this commit is a little more complex than simply removing unused + variables. - Note, for gcc, the test may (incorrectly) think that the compiler - supports the given flag, but that is okay, since the flag will be - ignored by gcc during the build without raising any warnings or errors. - - Reviewed-on: https://gerrit.openafs.org/14900 + Reviewed-on: https://gerrit.openafs.org/15176 Tested-by: BuildBot Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk - (cherry picked from commit 573be0228778873c0d445263fb09989918bea4c1) + (cherry picked from commit 05eb420829f9bca155c1d5af9fe96844db974770) - Change-Id: Ie11cf176d4c88560d5fce9a0c5932d3a0d5dba1e - Reviewed-on: https://gerrit.openafs.org/15054 - Tested-by: BuildBot - Reviewed-by: Andrew Deason + Change-Id: I80506cb8ae1c4bef67225eb11e3f640e8de52d26 + Reviewed-on: https://gerrit.openafs.org/15271 Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: BuildBot Reviewed-by: Stephan Wiesand -commit e03825bf22c615d7fec18481dc0145b79a3b3e82 +commit b87081682dcc3035889c799d9752c6b35bdda87b Author: Cheyenne Wills -Date: Fri Jan 28 14:10:46 2022 -0700 +Date: Mon Nov 14 15:55:41 2022 -0700 - Linux-5.17: Kernel build uses -Wcast-function-type + crypto: Define krb5_keytype as krb5_enctype - The linux 5.17 commit: - "Makefile: Enable -Wcast-function-type" (552a23a0) - added the -Wcast-function-type compiler flag for kernel module builds. + When building with clang-16 and configured with --enable-checking, the + external source heimdal/krb5/crypto.c used in src/crypto/rfc3961 fails + with the following error: - This change catches a type mismatch in the external files obtained from - heimdal: hcrypto/evp.c and hcrypto/evp-algs.c and produces the following - type of compile time error messages. + src/external/heimdal/krb5/crypto.c:702:28 + error: implicit conversion from enumeration type 'krb5_enctype' (aka + 'enum ENCTYPE') to different enumeration type 'krb5_keytype' (aka + 'enum krb5_keytype') [-Werror,-Wenum-conversion] + *keytype = e->keytype->type; /* XXX */ + ~ ~~~~~~~~~~~~^~~~ - src/libafs/MODLOAD-.../evp.c: In function ‘hc_EVP_md_null’: - src/libafs/MODLOAD-.../evp.c:501:2: 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, - | ^ + Replace the enum definition of krb5_keytype with a typedef to + krb5_enctype and create an anonymous enum mapping of KEYTYPE_ARCFOUR to + ETYPE_ARCFOUR_HMAC_MD5. - Use AX_APPEND_COMPILE_FLAGS to create a CFLAGS_NOCAST_FUNCTION_TYPE - macro to disable this warning and update the CFLAGS for these 2 files - for the Linux libafs build. + It should be noted that krb5_keytype and KEYTYPE_ARCFOUR are only used + by the external file src/external/heimdal/krb5/crypto.c - Update the CODING documentation to add the new exceptions. In addition - add a brief description on how to set up autoconf to add a new build - macro to suppress compiler warnings. + Changing the type for krb5_keytype was suggested by Andrew Deason + (adeason@sinenomine.net). - Note: upstream heimdal has committed a fix for this in: - - hcrypto: Fix return type for null_Init, null_Update and null_Final - (fc4b3ce49b) - - Reviewed-on: https://gerrit.openafs.org/14881 + Reviewed-on: https://gerrit.openafs.org/15189 + Reviewed-by: Cheyenne Wills + Tested-by: BuildBot + Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - Reviewed-by: Andrew Deason - (cherry picked from commit 6bdfa976731ce07f3236893ecf12abb9e169b882) + (cherry picked from commit c9ac7cdfb6365e3fc1914de80019a10328de1f4f) - Change-Id: Ibd354f663d5876c421a8b4e89b8943c9e3d59ebc - Reviewed-on: https://gerrit.openafs.org/14946 + Change-Id: I15a793b35cfa920e8db1a99c5575b4f3f55be0dd + Reviewed-on: https://gerrit.openafs.org/15270 Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale Tested-by: BuildBot - Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand -commit 9e1ac3f56650b8f69735b75a723a493d4630b011 +commit 334debcd4c9032aa7c71bb79bce2be8acafe78e2 Author: Cheyenne Wills -Date: Sun Apr 5 15:51:17 2020 -0600 +Date: Wed Nov 2 14:53:21 2022 -0600 - cf: Use common macro to test compiler flags + dumptool: Remove unused 'sflag' variable - Use the AX_APPEND_COMPILE_FLAGS macro to test and set compiler - specific flags. + clang-16 is flagging unused-but-set variables which result in build + errors when --enable-warning is turned on. - Remove the OPENAFS_GCC_SUPPORTS_MARCH check entirely (and the - associated P5PLUS_KOPTS), since nothing has used it for quite some - time. + ./dumptool.c:1285:54: error: variable 'sflag' set but not used + [-Werror,-Wunused-but-set-variable] + int errflg = 0, lflag = 0, iflag = 0, Fflag = 0, sflag = 0, Rflag = 0; - Reviewed-on: https://gerrit.openafs.org/14132 + Within dumptool the '-s' option of the 'ls' subcommand sets the 'sflag' + variable, but the variable itself is never used anywhere else. + + Remove the variable 'sflag', and ignore the '-s' option. + + The sflag variable was unused in the commit that introduced the code: + "test-suite-pull-tools-directly-in-20020114" (fcb32c07ed6d) + + Reviewed-on: https://gerrit.openafs.org/15181 + Reviewed-by: Andrew Deason + Tested-by: BuildBot Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit 790824ff749b6ee01c4d7101493cbe8773ef41c6) + (cherry picked from commit 3e9d41c98ecf07519ff6d2a1413615547ace13b8) - Change-Id: I0880abd2e114568cbcf232197efced91bb2ea5e7 - Reviewed-on: https://gerrit.openafs.org/15053 - Tested-by: BuildBot - Reviewed-by: Andrew Deason + Change-Id: I4cd4584c6374a525714d392f98fb39be5406bdbc + Reviewed-on: https://gerrit.openafs.org/15269 Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma Reviewed-by: Stephan Wiesand -commit b34c14dae1ed94bc24580278e90b57df2b92b496 +commit 241dcae439cb1646f053391b3ee57553003cf6fa Author: Cheyenne Wills -Date: Thu Jul 2 13:39:27 2020 -0600 +Date: Fri Oct 28 17:53:15 2022 -0600 - LINUX: Don't panic on some file open errors + libuafs: include com_err.h in ukernel_swig.i - Commit 'LINUX: Return NULL for afs_linux_raw_open error' (f6af4a155) - updated afs_linux_raw_open to return NULL on some errors, but still - panics if obtaining the dentry fails. + clang-16 is flagging an implicit-function-definition which results in a + build error when --enable-warning is turned on. - Commit 'afs: Verify osi_UFSOpen worked' (c6b61a451) updated callers of - osi_UFSOpen to verify whether or not the open was successful. This - meant osi_UFSOpen (and routines it calls) could pass back an error - indication rather than panic when an error is encountered. + PERLUAFS/ukernel_swig_perl.c:1585:9: error: call to undeclared + function 'afs_com_err'; ISO C99 and later do not support + implicit function declarations [-Wimplicit-function-declaration] + afs_com_err("AFS::ukernel", code, "parsing line: '%s'", line); + ^ - Update afs_linux_raw_open to return a failure instead of panic if unable - to obtain a dentry. + Add an include for afs/com_err.h to resolve the warning. - Update osi_UFSOpen to return a NULL instead of panic if unable to obtain - memory or fails to open the file. All callers of osi_UFSOpen handle a - fail return, though some will still issue a panic. - - Update afs_linux_readpage_fastpath and afs_linux_readpages to not panic - if afs_linux_raw_open fails. Instead of panic, return an error. - - For testing, an error can be forced by removing a file from the - cache directory. - - Note this work is based on a commit by pruiter@sinenomine.net - - Reviewed-on: https://gerrit.openafs.org/14242 + Reviewed-on: https://gerrit.openafs.org/15179 Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 4be3e5d31fa3fbe6c80ad0973430074124b157bc) + + Change-Id: I62785fe6248cb4b26f680c2db044f59511a1e02e + Reviewed-on: https://gerrit.openafs.org/15268 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit 0b908b7b9b39e36fc1bf98701d7e28d9a7a2f310 +Author: Cheyenne Wills +Date: Fri Nov 4 08:24:09 2022 -0600 + + rx: Remove event_handler rx_pthread_* counters + + The event_handler() function contains several counters that are + set and incremented but are not actually used. Clang-16 is flagging + these with a 'unused-but-set-variable' warning resulting in build errors + when --enable-warnings is used. + + rx_pthread.c:136:19: error: variable 'rx_pthread_n_event_expired' set + but not used [-Werror,-Wunused-but-set-variable] + unsigned long rx_pthread_n_event_expired = 0; + + Several 'if' statements are used to conditionally set these variables, + but serve no other purpose. These 'if' statements can also be + eliminated. + + Remove the unused rx_pthread_* counter variables as well as the + associated 'if' statements. In addition the only purpose of the + 'error' variable was to conditionally increment one of the removed + variables, remove the 'error' variable. + + These variables have been 'unused but set' since the original commit + from IBM. + + Reviewed-on: https://gerrit.openafs.org/15175 + Reviewed-by: Benjamin Kaduk + Reviewed-by: Cheyenne Wills + Tested-by: BuildBot + Reviewed-by: Andrew Deason + (cherry picked from commit f7cb492c7e755ec91226c96cc82ad9f567f01f11) + + Change-Id: I4dfdd7e536f6af642789fc51f6f055652c63a46d + Reviewed-on: https://gerrit.openafs.org/15267 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 5af53db475cdf4350d1cc41c9d4d955156eced57 +Author: Mark Vitale +Date: Sun Jan 26 20:17:40 2020 -0500 + + afs: silence bogus warning about dcListCount uninitialized + + Commit 3be5880d1d2a0aef6600047ed43d602949cd5f4d 'afs: Avoid panics in + afs_InvalidateAllSegments' is correct, but at least one compiler (gcc + 4.3.4 on SLES 11.3) is fooled into issuing a warning: + + [...]/afs_segments.c: In function 'afs_InvalidateAllSegments_once': + [...]/afs_segments.c:506: error: 'dcListCount' may be used uninitialized in this function + + To silence the bogus warning, initialize dcListCount when defined. + + Reviewed-on: https://gerrit.openafs.org/14048 + Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit af73b9a3b1fc625694807287c0897391feaad52d) + (cherry picked from commit 09ec1073b4c5d2eb70dcf5d8063018bc82e5a35e) - Change-Id: I1e430403561d5b85d6a4094d4bf413a6eca4ff5a - Reviewed-on: https://gerrit.openafs.org/15052 - Tested-by: BuildBot - Reviewed-by: Michael Laß + Change-Id: I84b1d4b8b9041242d64b03a84ad4392ff9778950 + Reviewed-on: https://gerrit.openafs.org/15266 Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: BuildBot Reviewed-by: Stephan Wiesand -commit a18f4845cf4f10c0352502e95a1b4b489b37402d +commit 05a4adcdffaa75827fbdd80ab7b54195a2f0d243 +Author: Ganesh Chaudhari +Date: Fri Oct 7 21:52:40 2022 +0530 + + macos: Update postinstall instructions for MacOS 13 + + System preferences is getting replaced by System settings in MacOS 13. + So, this commit will address the required changes in the dialog box + which gets popped after installing OpenAFS. + + Signed-off-by: Ganesh Chaudhari + Reviewed-on: https://gerrit.openafs.org/15150 + Tested-by: BuildBot + Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + (cherry picked from commit c620c91416f726357d556ce043b6cc285cf87a8b) + + Change-Id: I6d8da31dc3735cab93c2b2226d436960c77b78ff + Reviewed-on: https://gerrit.openafs.org/15264 + Reviewed-by: Ganesh G. Chaudhari + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 9c6503e117f52dba91e10a09eb8d28c428550e34 +Author: Ganesh Chaudhari +Date: Fri Oct 7 19:13:34 2022 +0530 + + macOS: Add support for aarch64-*-darwin* sysname + + As of libtool 2.4.7, the supplied config.guess file modifies + the sysname returned on macOS arm64 from arm-*-darwin* to + aarch64-*-darwin*. As a result, trying to build OpenAFS on + macOS arm64 fails with the following message: + + configure: error: An AFS sysname is required + + To avoid this problem, added support for aarch64-*-darwin*. + + Signed-off-by: Ganesh Chaudhari + Reviewed-on: https://gerrit.openafs.org/15149 + Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit d38b068627f5e84cead88af85f904fea0c8edb6d) + + Change-Id: I7685c2b75f62fe28b8723e00fba22f5f7fe795f1 + Reviewed-on: https://gerrit.openafs.org/15263 + Reviewed-by: Ganesh G. Chaudhari + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 41e46e12ac74fab70c692cf475aad13be0bdb518 +Author: Ganesh Chaudhari +Date: Wed Sep 14 15:57:27 2022 +0530 + + macos: Add support for MacOS 13.0 (Ventura) + + This commit introduces the new set of changes / files required to + successfully build the OpenAFS source code on OS X 13.0 “Ventura”. + + Thank you Kailas Zadbuke (IBM) and Harish Sharma (IBM) for your help. + + Reviewed-on: https://gerrit.openafs.org/15139 + Tested-by: BuildBot + Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + (cherry picked from commit e5a97ef2b46c8821db81363f4917ef214fc34a5e) + + Change-Id: I5092fe02a3bc3b7a6cb4ecfd4c8660278da9b0e8 + Reviewed-on: https://gerrit.openafs.org/15262 + Reviewed-by: Ganesh G. Chaudhari + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit f6b088d2a7fe7fcabeb6b4635c8a01072c7219c4 +Author: Marcio Barbosa +Date: Sun Jun 20 00:52:36 2021 -0300 + + klog.krb5: remove "save and reuse password" logic + + In order to avoid repeated requests for the user's password, klog.krb5 + caches and reuses it whenever necessary. However, with the introduction + of commit 3a9a5783cd1fd73902655f0876e2069b42688c94, klog.krb5 always + requests a TGT regardless of the state of writeTicketFile, eliminating + the need for possible extra requests for the user's password. + + Moreover, krb5_get_init_creds_password() does not accept a custom + prompter on macOS (returns EINVAL). Consequently, if the -password + argument is omitted, klog.krb5 fails with the following error: + + klog: Invalid argument Unable to authenticate in realm + + Given that the user won't be prompted for a password multiple times, + remove the "save and reuse password" logic and use krb5_prompter_posix() + as the prompter function (instead of klog_prompter). + + Relevant issue identified by gangovind@in.ibm.com. + + Reviewed-on: https://gerrit.openafs.org/14643 + Tested-by: BuildBot + Reviewed-by: Ganesh G. Chaudhari + Tested-by: Ganesh G. Chaudhari + Reviewed-by: Benjamin Kaduk + (cherry picked from commit a10f99dbe025c74fb488b501daaf1f9574830cec) + + Change-Id: I6587283d93a2dc801c8a41f0663a6de1b5d8a045 + Reviewed-on: https://gerrit.openafs.org/15261 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 69f1ffb8989d8f1ac9a5ac4ea9459c358478e61d +Author: Marcio Barbosa +Date: Thu Apr 7 22:51:21 2022 +0000 + + DARWIN: On macOS 12, mount afs on user's directory + + Currently, /afs is mounted/unmounted by a LaunchDaemon. In order to + unmount /afs on restart/shutdown, this daemon runs umount -force /afs. + Unfortunately, SIP (System Integrity Protection) is not allowing the + LaunchDaemon in question to run this command successfully on macOS 12 + (exclusively on restart/shutdown): + +   umount: Operation not permitted + + In this situation, afs can't be turned off correctly, leaving many + unkillable afsd processes lingering around. As a result, the + restart/shutdown process gets stuck indefinitely. + + Fortunately, this problem doesn't happen if /afs is mounted on an user's + directory. That said, avoid this issue by mounting /afs on the current + user's directory (/Users/$USER/OpenAFS/afs). Notice that afs is still + accessible (including for other users) through a synthetic link added in + the root directory (/afs -> /Users/$USER/OpenAFS/afs). + + Reviewed-on: https://gerrit.openafs.org/14925 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 1c7eda8ea83bee3e674435109efccbc6082e4765) + + Change-Id: Idb013d76f00a78cfebd790900eabbcd6968029b7 + Reviewed-on: https://gerrit.openafs.org/15260 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit fd64dcd3fb49e5575bf0ac8f0bb36857953c4f8a +Author: Marcio Barbosa +Date: Tue Mar 15 10:58:16 2022 -0300 + + macos: Packaging support for MacOS X 12.0 + + This commit introduces the new set of changes / files required to + successfully create the dmg installer on OS X 12.0 "Monterey". + + Reviewed-on: https://gerrit.openafs.org/14924 + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 873d803a3dc7acffd74c9432872bed4f6575abf9) + + Change-Id: I4cbbbeb5eb740b4f7979fa2137cb7faa9027d774 + Reviewed-on: https://gerrit.openafs.org/15259 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 046e787f1f87c6e18676510f7f89206ead1069bb +Author: Marcio Barbosa +Date: Thu Apr 7 03:16:45 2022 +0000 + + macos: Add support for MacOS 12.0 + + This commit introduces the new set of changes / files required to + successfully build the OpenAFS source code on OS X 12.0 "Monterey". + + Reviewed-on: https://gerrit.openafs.org/14923 + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 7a862f940b2e2f2169e267fc6deb31db8f3534c0) + + Change-Id: I4f1b42002c670e15b3fecfd8d0cfb2f461b8d136 + Reviewed-on: https://gerrit.openafs.org/15258 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit fc80c74689ae6be3f428401aec071f0a273d4bff +Author: Mark Vitale +Date: Tue May 12 12:59:31 2020 -0400 + + DARWIN: disable kextutil check for versions requiring notarization + + Our kextutil signing check will fail for releases that require + notarization (Mojave 10.14.5 and up, Catalina 10.15 all versions), + because we aren't notarized yet at the time of the check. + + Instead, disable the check for those releases. + + Reviewed-on: https://gerrit.openafs.org/14222 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit d2e755e33a266df17169a1fc05db1e540b5e76af) + + Change-Id: Ie191503cb3f57c60a2a9c31e638dc7f79c496591 + Reviewed-on: https://gerrit.openafs.org/15257 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 6652a632795aa23e1894c049f2d48c0881968add +Author: Mark Vitale +Date: Sun May 10 20:53:22 2020 -0400 + + DARWIN: ensure OpenAFS.pkg is signed + + Installation fails because the OpenAFS.pkg was inadvertently omitted + from the codesign logic. + + Ensure that the package is signed. + + Reviewed-on: https://gerrit.openafs.org/14221 + Reviewed-by: Marcio Brito Barbosa + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 336f5d91c6f4e93f77560d456fb29fbd82b237e5) + + Change-Id: I58c0ca157653b76562ee7071a567db681d33fc2e + Reviewed-on: https://gerrit.openafs.org/15256 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit d20def23d094b11b88265d1f7430fc5e4d55484a +Author: Mark Vitale +Date: Sun May 10 20:51:59 2020 -0400 + + DARWIN: ensure PrefPane materials are properly signed + + Notarization fails because some prefPane materials were inadvertently + omitted by the codesign logic. + + Ensure that these objects are properly signed. + + Reviewed-on: https://gerrit.openafs.org/14220 + Reviewed-by: Marcio Brito Barbosa + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit d3f8d8122880de9f5b25868b39efd1cc7d385ff6) + + Change-Id: Ice6c954e41e375fbe8ac670586d2616c565f0499 + Reviewed-on: https://gerrit.openafs.org/15255 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 35fde5873a1a9327333d15af399738ae55680e22 +Author: Marcio Barbosa +Date: Tue Mar 15 10:38:45 2022 -0300 + + DARWIN: Replace afs_osi_cred by allocated ucred + + Building the current version of OpenAFS on macOS Monterey arm64 results + in the following error: + + error: globals with authenticated null values are currently unsupported + afs_ucred_t afs_osi_cred; + + To avoid this problem, replace the global in question by a pointer to a + dynamically allocated afs_osi_cred (afs_osi_credp). Ideally we would + create a new credential with kauth_cred_create(), but this function is + not well documented and using it results in crashes. Moreover, if the + kauth_cred_dup() function were still available (private since XNU + 1456.1.26 - macOS 10.6), we could also duplicate the current user's + credential during startup (like commit f40f466c7f did for BSD). + + Reviewed-on: https://gerrit.openafs.org/14922 + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 982d2f9dbe6586d06ffa2a61c02ea726b83b5902) + + Change-Id: I720132478d4d1b742f63576e6a98e96c7a935885 + Reviewed-on: https://gerrit.openafs.org/15254 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit 29f7182c3fe25db9666871567a631e9173568ac8 Author: Andrew Deason -Date: Thu Jan 17 15:45:36 2019 -0600 +Date: Mon Feb 25 11:35:24 2019 -0600 - afs: Introduce afs_IsDCacheFresh + Remove references to SunOS 4 - Numerous places in libafs check the DV of a dcache against the DV of - the vcache for the same file, in order to check if the dcache is up to - date and can be used. Consolidate all of these checks into a new - function, afs_IsDCacheFresh, to make it easier for future commits to - alter this logic. + We already removed support for Solaris versions before Solaris 8, in + commit e4c2810f ("Remove support for Solaris pre-8"), but there are + still some references to SunOS (meaning SunOS 4) in the tree. This is + even older than Solaris (aka SunOS 5), so get rid of these. - This commit should have no visible impact; it is just code - reorganization. + This commit removes most references to SunOS 4 regarding platform + support, and a few comments. This also removes a few comments that + were just wrong or nonsensical (e.g. CMAPPED in afs.h is used by + other platforms; some comments in platform-specific osi_file.c files + referenced SunOS for some reason). - Reviewed-on: https://gerrit.openafs.org/13435 + Reviewed-on: https://gerrit.openafs.org/13506 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 6e5638ac7297701a99ea396dee1df8f56a6a50da) + + Change-Id: I17821e2cd0050bb0a468bfadda2c446beafeb537 + Reviewed-on: https://gerrit.openafs.org/15253 + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit 3ee628c2dc5128ac68dd861b439a20db8837cecf +Author: Andrew Deason +Date: Fri Sep 21 12:11:46 2018 -0500 + + Remove alpha_dux/alpha_osf references + + Several files were still referencing the alpha_dux* and alpha_osf* + sysnames. The code for these platforms has been removed, so get rid of + this cruft. + + Reviewed-on: https://gerrit.openafs.org/13339 + Tested-by: BuildBot + Reviewed-by: Michael Meffie + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 809ee49b80d7bc0e720aaebe78fb9ecfd453065d) + + Change-Id: Iae1f642df6cfb4c2e757f0fc381cb98eb5bf448e + Reviewed-on: https://gerrit.openafs.org/15252 + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit 8ec429d0a3a7b3169d1eb24eb37e8084e5bc6a4f +Author: Marcio Barbosa +Date: Mon Mar 21 14:43:34 2022 -0300 + + DARWIN: Drop afs_event lock before destroying it + + On macOS arm64, a lock (lck_mtx_t) must be released (lck_mtx_unlock) + before it can be destroyed/freed (lck_mtx_free -> lck_mtx_destroy). If + this rules isn't respected, the operating system in question will panic + with the following message: + + panic("lck_mtx_assert(): mutex (%p) not owned", lock); + + Unfortunately, the current shutdown process of the osi_sleep module + doesn't respect this rule. As a result, macOS arm64 panics when the + OpenAFS client is shut down/restarted. To fix this problem, release + afs_event->lck (EVTLOCK_UNLOCK) before destroying it (EVTLOCK_DESTROY). + + Reviewed-on: https://gerrit.openafs.org/14933 + Tested-by: BuildBot + Reviewed-by: Mark Vitale + Tested-by: Mark Vitale + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 93b88935999ad25bc22daf64f9ebff30957e0a27) + + Change-Id: Ib81c3decc748c06b2f99cfa155095bffd1048f57 + Reviewed-on: https://gerrit.openafs.org/15251 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit b5dd4df6ec3e87c7f06d214b213e30270a358f13 +Author: Marcio Barbosa +Date: Thu Apr 7 22:35:02 2022 +0000 + + macos: Add support for Apple Silicon + + This commit introduces the new set of changes / files required to + successfully build the OpenAFS source code on Apple M1 (macOS 11+). + + Notice that kexts on Apple silicon must support the arm64e architecture, + since they run in kernel space and must support the same architecture + and restrictions as other kernel code. On the other hand, the utilities + that run on user space, like vos, fs, and others, have to be built for + arm64 (currently). + + Reviewed-on: https://gerrit.openafs.org/14746 + Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk Tested-by: Andrew Deason - (cherry picked from commit 0d8ce846ab2e6c45166a61f04eb3af271cbd27db) + (cherry picked from commit cdbcb6f947feff528adc324dd6487b21083e23aa) - Change-Id: I2d7f63339e0cd6e0df7f4b07000834ac946cb4b7 - Reviewed-on: https://gerrit.openafs.org/15051 - Tested-by: BuildBot - Reviewed-by: Michael Laß - Reviewed-by: Andrew Deason + Change-Id: I854e7553b65956032a3c15aa427189bf8e4e3a0d + Reviewed-on: https://gerrit.openafs.org/15250 Reviewed-by: Michael Meffie + Tested-by: BuildBot Reviewed-by: Stephan Wiesand -commit 524600accb775577bf931577d92aaec1723d2f6c -Author: Michael Meffie -Date: Wed Jun 29 10:33:23 2022 -0400 +commit 33bcff698f8b12c7830acf969f93eecad52a937f +Author: Marcio Barbosa +Date: Thu Apr 7 02:15:57 2022 +0000 - Change klog.krb5 -lifetime option help description + macos: Refactor param.x86_darwin_200.h - Change the klog.krb5 -lifetime help description to show this option is - ignored. This option name was copied from the krb4 command but is not - implemented for the krb5 version. It is retained for command line syntax - compatibility. + In preparation for a future commit, try to make param.x86_darwin_200.h + more readable. Also, rename this file to param.darwin_200.h so code from + other architectures can be included in this header. - Reviewed-on: https://gerrit.openafs.org/15045 - Tested-by: BuildBot + Reviewed-on: https://gerrit.openafs.org/14934 + Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk - (cherry picked from commit f0c9fe7f8983eccf6453e3345de72a0eed649a5a) + Tested-by: BuildBot + (cherry picked from commit 39b74c2c3725cfa39fc5076cd7803ee7d55923e3) - Change-Id: If2b34f8d9d8e65fb8b6497f0ab01ff1ef6d2196e - Reviewed-on: https://gerrit.openafs.org/15047 + Change-Id: I184591c24fac37b4c5a2b6fab7b42850b3004744 + Reviewed-on: https://gerrit.openafs.org/15249 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit b9c3dbc0a60a3295f1622bc79a05938173aa95b4 +Author: Marcio Barbosa +Date: Mon Feb 14 15:09:27 2022 -0800 + + build: Select param.h in sysname.m4 + + Currently, the way the file that will be used as param.h is selected + doesn't allow us to choose headers from other architectures, making + cross-compiling difficult. In an effort to facilitate this process, + select the header that will be used as param.h in sysname.m4. By doing + this, we will have more flexibility to select which header should be + used (in future commits). + + Reviewed-on: https://gerrit.openafs.org/14914 Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit d456bd9b258445f60745867c34ef7c7a8c7be187) + + Change-Id: Iaaa372887ac17f352a6a4bb9c14b896e88e3b28b + Reviewed-on: https://gerrit.openafs.org/15248 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Stephan Wiesand -commit 0d53d4170bb3992248db55d990db0ceae03513b2 -Author: Cheyenne Wills -Date: Thu Jan 27 20:19:17 2022 -0700 +commit 84b177ccc856519a6a1aac7e18cd30514fccac15 +Author: Marcio Barbosa +Date: Wed Apr 6 23:36:15 2022 +0000 - Linux-5.17: kernel func complete_and_exit renamed + macos: Build afscell for supported architectures - Handle the Linux kernel function rename made in commit - "exit: Rename complete_and_exit to kthread_complete_and_exit" - (cead1855) + Given that i386 is no longer supported, trying to build the current + version of afscell on macOS 11 (Big Sur) results in the following error: - Add a new autoconf test for the linux function kthread_complete_and_exit - and if not found use a define to map kthread_complete_and_exit to - complete_and_exit. + error: The i386 architecture is deprecated. You should update your ARCHS + build setting to remove the i386 architecture. - Replace calls to complete_and_exit with kthread_complete_and_exit. + To fix this problem, build afscell for all architectures listed in + ARCHS_STANDARD. - Reviewed-on: https://gerrit.openafs.org/14882 + For the macosx11.0 sdk: + + $ xcodebuild -showBuildSettings -scheme afscell -sdk macosx | grep ARCHS + + ARCHS = arm64 x86_64 + ARCHS_STANDARD = arm64 x86_64 + ARCHS_STANDARD_32_64_BIT = arm64 x86_64 i386 + ARCHS_STANDARD_32_BIT = i386 + ARCHS_STANDARD_64_BIT = arm64 x86_64 + ARCHS_STANDARD_INCLUDING_64_BIT = arm64 x86_64 + VALID_ARCHS = arm64 arm64e i386 x86_64 + + While here, add arm64 to the list of valid architectures. + + Reviewed-on: https://gerrit.openafs.org/14745 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk - (cherry picked from commit a651d4db7f86a24ea6784f6f27d5c8482667267b) + (cherry picked from commit dc6ced5e6d63ad89b1ad6f6b236a28b823abb59d) - Change-Id: Ibe96b92a84a8f876dda4019c221c37dabde93244 - Reviewed-on: https://gerrit.openafs.org/14945 + Change-Id: I483c41a5954caa8ed080134d82f2e08a7c1973a4 + Reviewed-on: https://gerrit.openafs.org/15247 Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale + Reviewed-by: Harish Sharma Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa Reviewed-by: Stephan Wiesand -commit fd98e964d6ba0c685d56021dbf61cc3d5d9d9af5 +commit a0898c2d90ed2928245576505f74e935a1ea2722 Author: Cheyenne Wills -Date: Fri Aug 27 08:20:42 2021 -0600 +Date: Mon Sep 19 16:25:13 2022 -0600 - clang-13: remove unused variables flagged by clang + UKERNEL: avoid double include of roken.h - Clang-13 changed the default for the unused-but-set-variable resulting - in build warnings/errors with the following type of messages + Commit 'afs: Replace strcpy &co by safer alternatives' (419f0cd7aa75719) + added an include for roken.h into UKERNEL/afsincludes.h. Neither + UKERNEL/afsincludes.h or roken.h has a guard against a double include, + which can result in a build failure on older kernels (discovered on a + 2.6.18 build): - vsprocs.c:3493:25: error: variable 'tentries' set but not used - [-Werror,-Wunused-but-set-variable] - afs_int32 nentries, tentries = 0; + In file included from ~/openafs/src/afs/UKERNEL/afsincludes.h:30, + from ~/openafs/src/afs/UKERNEL/afs_usrops.h:15, + from ~/openafs/src/afs/UKERNEL/afs_usrops.c:24: + include/roken.h:89: error: redefinition of typedef 'rk_socket_t' + include/roken.h:89: error: previous declaration of 'rk_socket_t' was here + In file included from ~/openafs/src/afs/UKERNEL/afsincludes.h:30, + from ../afs/afsincludes.h:16, + from ../afs/afs_bypasscache.h:68, + from ~/openafs/src/afs/UKERNEL/afs_usrops.c:30: - The locations where these local variables are being flagged show that - while the variables are being updated, they are actually never used for - anything (e.g. used as part of an assignment to another variable, passed - as a parameter, used for as returned value, etc.) + Since roken.h is from an external source, we cannot update it to add + the necessary check. - Remove the variables being flagged by the clang-13 compiler. + Update UKERNEL/afsincludes.h to add a check to see if it has already + been included. - Removal of these variables will not alter the overall functionality of + auth/ktc.c has a required include for roken.h, but it also can pull in + UKERNEL/afsincludes.h as well. This can result in a double include for + roken.h. + + Update auth/ktc.c to only include roken.h if not building UKERNEL. + + Reviewed-on: https://gerrit.openafs.org/15130 + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit cc0ffc56e85eec4133bcc5e745efa28f5d3c53a7) + + Change-Id: I4508c2d4bb878dadce649f0da2af16c9efa69b91 + Reviewed-on: https://gerrit.openafs.org/15265 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit 5993965112da00e29ebdb2be084b50bae5cbb90f +Author: Marcio Barbosa +Date: Wed Mar 23 17:58:41 2022 -0300 + + DARWIN: Declare/include functions before using them + + Every function should be explicitly declared before it can be called. + Since -Wimplicit-function-declaration is usually a warning and not an + error, calling undeclared functions does not prevent us from building the code. - Reviewed-on: https://gerrit.openafs.org/14775 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 8333e8e6020331013af912acb92a308e4f5a1dd2) - - Change-Id: Id5e7c6a323e352106b8f6bf32b7163846c366dec - Reviewed-on: https://gerrit.openafs.org/14991 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 588decb457501a8b0d0e65ea9dba726400f9c911 -Author: Cheyenne Wills -Date: Thu Jul 23 15:43:42 2020 -0600 - - clang-10: ignore fallthrough warning in generated code - - Clang-10 will not recognize '/* fall through */' as an indicator to - turn off the fallthrough warning due to the lack of a 'break' in a case - statement. - - Code generated by flex uses the '/* fall through */' comments to turn - off compiler warnings for fallthroughs in case statements. - - For code generated by flex, ignore the implicit-fallthrough via pragma - or disable the warning via a compile time flag. - - Add new env variable "CFLAGS_NOIMPLICIT_FALLTHROUGH" to selectively - disable the compile check in Makefiles when checking is enabled. - - Reviewed-on: https://gerrit.openafs.org/14275 + However, apple-clang 12 makes this an error by default, prohibiting the + build of the current version on macOS 11 (Big Sur). + + To fix this problem, declare functions before calling them. Also, + include mach/thread_act.h into afs_call.c so the declaration of + thread_terminate() can be found on macOS. Last, given that the third + argument of PIOCTL() (if UKERNEL is defined) is a pointer, cast it to + 'long'. Doing so, we can avoid another inhibited warning. Notice that + this PIOCTL definition is scoped to a single file (src/auth/ktc.c). + + Reviewed-on: https://gerrit.openafs.org/14744 Reviewed-by: Andrew Deason + Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk Tested-by: BuildBot - (cherry picked from commit e5f44f6e9af643cab3a66216dff901e0a4c5eda8) + (cherry picked from commit f9c96d0fd609e14fcb8ff7d9269024e026f742cb) - Change-Id: Ibe1b95e6784ca8b422378cf2896bdc7f1a6d8e61 - Reviewed-on: https://gerrit.openafs.org/14990 - Reviewed-by: Andrew Deason + Change-Id: I70dadc44d40e1fc877f9e0490e28636907432faa + Reviewed-on: https://gerrit.openafs.org/15246 Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Harish Sharma Reviewed-by: Stephan Wiesand + Tested-by: Stephan Wiesand -commit 7c8127c5a12a94457251b35643a9fa2f284d2a11 +commit 34d869996dda2de2449a1623de051b86e262212c Author: Andrew Deason -Date: Wed Jul 10 12:42:54 2019 -0500 +Date: Fri Jan 21 17:54:48 2022 -0600 - LINUX: Honor --enable-checking for libafs + afs: Organize setpag() declarations better - When we build the kernel module on LINUX, we don't pass in any of our - CFLAGS, since the Linux buildsystem itself figures out what flags are - needed. However, this means that we don't pass in -Werror when - --enable-checking is turned on, so warnings may not cause the build to - fail. + The current declarations for setpag() are a mess (not to be confused + with many other setpag functions, like afs_setpag()), accumulated + across various commits over time. Shuffle the #ifdef logic around, so + this becomes a much more straightforward #ifdef ladder, with one + declaration per conditional. And move the LINUX declaration to be next + to all of the others (even the LINUX setpag() is declared in + osi_groups.c, not osi_misc.c, so it's in the wrong spot anyway). - To fix this, create a new autoconf variable, called CFLAGS_WERROR, - that only contains -Werror if --enable-checking is turned on. We then - pass that into the Linux module buildsystem, so -Werror is given to - the compiler when building our module. + The resulting #ifdef logic should be identical to the original code, + but is now easier to follow. For the BSDs, it may look like we have + changed the conditional for the case of "XBSD && !DFBSD && !FBSD && + !NBSD", but that's a very roundabout way of saying OBSD (OpenBSD). - Reviewed-on: https://gerrit.openafs.org/13682 - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 6e0f1c3b45102e7644d25cf34395ca980414317f) - - [cwills@sinenomine.net] On master gerrit 14106 comes after this commit. - In the 1.8.x branch the 14106 commit is already pulled in (gerrit 14217) - which causes a conflict due a difference ('-fno-common') in the line - above the change in osconf.m4. - - Change-Id: I4e49d5c5fdf26399eb04d2f76196f3c3f4e7baf6 - Reviewed-on: https://gerrit.openafs.org/14989 - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Tested-by: BuildBot - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit 0cb26f198c6e049171b698098afab82203848434 -Author: Michael Meffie -Date: Fri Sep 3 07:05:36 2021 -0400 - - ptserver: Fix CreateEntry() stringop-overflow warnings - - The CreateEntry() prototype has been fixed to match the function - definition, so callers are expected to provide bounded arrays for the - user or group name. Fix the InitialGroup() macro which is used to set - the built-in names using string literal to avoid stringop-overflow - warnings. - - error: ‘CreateEntry’ accessing 64 bytes in a region of size 22 [-Werror=stringop-overflow=] - code = CreateEntry(tt, (name), &temp, /*idflag*/1, flag, SYSADMINID, SYSADMINID); \ - - note: in expansion of macro ‘InitialGroup’ - InitialGroup(SYSADMINID, "system:administrators"); - note: referencing argument 2 of type ‘char *’ - note: in a call to function ‘CreateEntry’ - CreateEntry(struct ubik_trans *at, char aname[PR_MAXNAMELEN], ... - - (Repeated for "system:backup", "system:anyuser", "system:authuser", - "system:ptsviewers", and "anonymous".) - - Reviewed-on: https://gerrit.openafs.org/14789 - Reviewed-by: Benjamin Kaduk - Tested-by: Benjamin Kaduk - (cherry picked from commit 7924aecf95bf4918a485a041f2426bd1fa407ac8) - - Change-Id: I6e30729f1b24beb1ed1c4b6d9162b347285b7edc - Reviewed-on: https://gerrit.openafs.org/14987 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale + Reviewed-on: https://gerrit.openafs.org/14883 Tested-by: BuildBot Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 07704dc7b4a58a05e921d374302a3026fa95a44e -Author: Michael Meffie -Date: Mon Aug 23 15:42:52 2021 -0400 - - libadmin: Fix isAlias may be uninitialized warning - - The cfgutil_HostNameIsAlias() function has an output parameter called - isAlias, which is used when cfgutil_HostIsAlias() returns non-zero. - However, it possible for isAlias to not be set before returning. GCC 12 - issues a warning about the possible use of the uninitialized isAlias - variable: - - cfginternal.c:366:32: error: ‘isAlias’ may be used uninitialized - [-Werror=maybe-uninitialized] - - Initialize the cfgutil_HostNameIsAlias() isAlias output flag to false. - Also, fix the misleading code indentation around the - cfgutil_HostNameIsAlias() call. - - Reviewed-on: https://gerrit.openafs.org/14772 - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot Reviewed-by: Benjamin Kaduk - (cherry picked from commit 4a8d0c4089078fb3df9cc06b595c80c9b4c2ca7f) + (cherry picked from commit 738a6487ad088068d19a18c6330e01a40f2fd278) - Change-Id: I4cadcb4380962e47213fcfd310c1cac331100f65 - Reviewed-on: https://gerrit.openafs.org/14986 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot + Change-Id: I9dc933fa96fc6e7839c010c5207e644179343898 + Reviewed-on: https://gerrit.openafs.org/15245 Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: Andrew Deason Reviewed-by: Stephan Wiesand -commit 1f868e7bdde59440695f5b2e99aa562f953250ad -Author: Michael Meffie -Date: Mon Aug 23 15:37:13 2021 -0400 +commit b56d5cdfa8cfff3bd3c166a38204cfa4dceaaf73 +Author: Marcio Barbosa +Date: Wed Mar 23 17:31:54 2022 -0300 - bucoord: Fix doDispatch() array-parameter gcc warning + bucoord: Introduce ubik_Call_SingleServer_BUDB_* - The doDispatch() prototype does not match the function definition. The - targv parameter is declared as an unbounded array in the prototype, but - is defined as a bounded array. As of GCC 12, a warning is issued for the - mismatch. + In an effort to avoid the usage of undeclared functions, add wrappers + for ubik_Call_SingleServer() (_BUDB_GetVolumes(), _BUDB_DumpDB()) and + adjust its callers accordingly. - main.c:346:18: error: argument 2 of type ‘char *[100]’ with - mismatched bound [-Werror=array-parameter=] - bucoord_internal.h:123:40: note: previously declared as ‘char *[]’ + Also, make sure that ubik_Call_SingleServer() uses the same signature as + ubik_Call(). This change helps us to get rid of casting errors. - Within doDispatch(), the targv argument is just passed to cmd_Dispatch() - (this is the only use of targv). Since cmd_Displatch() expects an - unbounded array, update the doDispatch() definition to match the - prototype. - - Reviewed-on: https://gerrit.openafs.org/14771 - Reviewed-by: Michael Meffie - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 92a6242de2d8ea280debc283a7c089f97c1670bc) - - Change-Id: Idc674dccac5adcbe610e059463e493716cf80f57 - Reviewed-on: https://gerrit.openafs.org/14985 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot + Reviewed-on: https://gerrit.openafs.org/14886 Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 3a32158d000a29c8ca7282db02ffb27c6f2a892d -Author: Michael Meffie -Date: Mon Aug 23 15:33:19 2021 -0400 - - Fix PrintInode() mismatched array parameter warnings - - The PrintInode() prototypes do not match the function definitions. - - When AFS_64BIT_IOPS_ENV is defined (which is the common case and is - required for namei), the buffer parameter is declared as a bounded - character array (afs_ino_str_t) in the prototype, but is defined as an - unbounded character pointer. When AFS_64BIT_IOPS_ENV is not defined - (for legacy 32-bit inode vice partitions), PrintInode() is declared with - no specified parameters. - - A static buffer is used to hold the formatted string when a NULL is - passed as the first argument to PrintInode(). However, this method is - only used by the volinfo and iopen utility programs. - - Fix the mismatch function prototypes and definitions to use the bounded - char array (afs_ino_str_t) in all cases. Remove the deprecated function - declaration with no specified parameters. Update vol-info and iopen to - pass an afs_ino_str_t buffer and remove the now unused static buffer. - Update the duplicated PrintInode() function definition in namei_ops.c. - (This duplicated code could be removed in a future commit.) - - Reviewed-on: https://gerrit.openafs.org/14770 - Tested-by: BuildBot Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk - (cherry picked from commit a1e57d2e42b6d01e5ece93d5d49a4b9f3ecd3edc) - - Change-Id: Ia8685805513c2c17e9253d83aa471718a09a449a - Reviewed-on: https://gerrit.openafs.org/14984 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale Tested-by: BuildBot - Reviewed-by: Andrew Deason + (cherry picked from commit 981b3d723ec56dad553be570147d1b2aa632f4e1) + + Change-Id: I5893a939bc5cd64eec9dbbf1ce8a0dc5032c81f0 + Reviewed-on: https://gerrit.openafs.org/15244 + Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma Reviewed-by: Stephan Wiesand + Tested-by: Stephan Wiesand -commit c6b47f77dc27c4624c3348c8de0aee8f0ed15970 +commit 1e6fd4ceae1f8146a5dfa7c66330289564dbe7be +Author: Marcio Barbosa +Date: Tue Apr 5 22:39:56 2022 +0000 + + afs: Ensure dirEntry->name has room for entry name + + Currently, the afs_dynroot_addDirEnt() function assumes that the caller + has allocated the directory to be large enough to hold the necessary + entry. In order to make sure that memory isn't being accidentally + stomped, use strlcpy to truncate instead of stomping on other memory. + That way, if the caller makes a mistake we don't silently corrupt memory. + + We specifically do not assert that there is no truncation or panic if + truncation occurs, since the effect of a truncated entry in the + dynamic AFS root volume is limited and does not justify bringing down + the entire client. + + Reviewed-on: https://gerrit.openafs.org/14938 + Reviewed-by: Andrew Deason + Tested-by: BuildBot + Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Benjamin Kaduk + (cherry picked from commit aa9180652876a3ba9157776b69a6995ac4201d1b) + + Change-Id: I21a402bb6e20f2546c61bdabde021817dd3827d8 + Reviewed-on: https://gerrit.openafs.org/15243 + Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + Tested-by: Stephan Wiesand + +commit 79c8c8639952fc3305b50152ba450ed8d858e7be Author: Michael Meffie -Date: Mon Aug 23 19:43:45 2021 -0400 +Date: Wed Sep 1 12:38:14 2021 -0400 - pts: Fix stringop-overflow warnings + fs: Trim trailing lsmount and flushmount path slashes - The ptutil functions are defined to accept bounded character arrays for - user and group names. As of GCC 11, callers which provide the names as - string literals now trigger the stringop-overflow warning, since the - regions provided by the string literals are smaller than the bounded - areas. + Remove trailing slashes from paths given to `fs lsmount` and `fs + flushmount`. This makes for a more pleasant user experience when shell + tab completion is used to specify the paths. - error: ‘pr_ChangeEntry’ accessing 64 bytes in a region of size 1 - [-Werror=stringop-overflow=] - note: referencing argument 4 of type ‘char *’ + Thanks to Stephan Wiesand for pointing out this issue. - error: ‘pr_IsAMemberOf’ accessing 64 bytes in a region of size 22 - [-Werror=stringop-overflow=] - note: referencing argument 2 of type ‘char *’ + Reviewed-on: https://gerrit.openafs.org/14779 + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + Reviewed-by: Benjamin Kaduk + (cherry picked from commit a7a672cae871aa9cf9cc003a37579cb4df51b3fe) - error: ‘pr_CreateUser’ accessing 64 bytes in a region of size 16 - [-Werror=stringop-overflow=] - note: referencing argument 1 of type ‘char *’ - - error: ‘pr_Delete’ accessing 64 bytes in a region of size 16 - [-Werror=stringop-overflow=] - note: referencing argument 1 of type ‘char *’ - - Update the callers in pts and testpt which pass literal strings. Instead - of passing char pointers to literal strings, assign the strings to - prname buffers and pass the prname buffers to the pr utility functions. - - Reviewed-on: https://gerrit.openafs.org/14769 + Change-Id: I24a2ae323f64f2d73be8fbc26860fa2864e34bfe + Reviewed-on: https://gerrit.openafs.org/15242 + Reviewed-by: Michael Meffie Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit a3aac5106beddc5a6f7a09c2d21c2524342aca01) - - Change-Id: I38883cdf9c6db701370b3c6755ca28e50f618c82 - Reviewed-on: https://gerrit.openafs.org/14983 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Harish Sharma Reviewed-by: Stephan Wiesand + Tested-by: Stephan Wiesand -commit 8765514b2ac7c258646fa446dca3040a23be4da4 -Author: Michael Meffie -Date: Tue Aug 24 16:40:22 2021 -0400 - - ptserver: Fix CreateEntry() mismatched array parameter warning - - The CreateEntry() prototype does not match the function definition. The - aname parameter is declared as an unbounded array in the prototype but - is defined as a bounded array. As of GCC 12, a warning is issued for the - mismatch. - - error: argument 2 of type ‘char[64]’ with mismatched bound - [-Werror=array-parameter=] - CreateEntry(struct ubik_trans *at, char aname[PR_MAXNAMELEN], ... - - note: previously declared as ‘char[]’ - extern afs_int32 CreateEntry(struct ubik_trans *at, char aname[], ... - - Fix the prototype to declare the 'aname' parameter as a bounded array as - expected for this function. - - Reviewed-on: https://gerrit.openafs.org/14768 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit fe64ddd3b49bf15222d32d443ff226dd4c2b899e) - - Change-Id: If29ada7f9460591de8d2b61c17d00090465625b2 - Reviewed-on: https://gerrit.openafs.org/14982 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 5a1944282e77c681c30ddf12f41fc8e07efee3ea -Author: Michael Meffie -Date: Mon Aug 23 14:23:01 2021 -0400 - - ubik: Fix ubeacon_updateUbikNetworkAddress() mismatched array parameter warning - - The ubeacon_updateUbikNetworkAddress() prototype does not match the - function definition. The ubik_host parameter is declared as an unbounded - array in the prototype but is defined as a bounded array. As of GCC 12, - a warning is issued for the mismatch: - - error: argument 1 of type ‘afs_uint32[256]’ {aka ‘unsigned int[256]’} - with mismatched bound [-Werror=array-parameter=] - ubeacon_updateUbikNetworkAddress( - afs_uint32 ubik_host[UBIK_MAX_INTERFACE_ADDR]) - - note: previously declared as ‘afs_uint32[]’ {aka ‘unsigned int[]’} - extern int ubeacon_updateUbikNetworkAddress(afs_uint32 ubik_host[]); - - Restore the ubik_host array length in the function prototype, which was - dropped in commit 9020e6e2f0357b1082705dcaa6626573433969ec (ubik: Defer - updateUbikNetworkAddress until after RX startup). - - Reviewed-on: https://gerrit.openafs.org/14767 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 36796bbb83af2650a872234fdb5cf7124bf6cfa8) - - Change-Id: Ia27b5b9642dbd355e1310419424ed0ac04add4b2 - Reviewed-on: https://gerrit.openafs.org/14981 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 0130ff6fc4f6ca0f85346941f39c9fe3eea6e3aa -Author: Michael Meffie -Date: Mon Sep 10 23:47:33 2018 -0400 - - klog.krb5 -lifetime is not implemented - - The klog.krb5 -lifetime option was copied from earlier versions of log - and klog, which had the ability to set the krb4 token lifetime. However, - the -lifetime option is not feasible the krb5 version, and so is not - implemented in klog.krb5. - - Update the klog.krb5 man page to document the -lifetime option has no - effect. Remove the code which unnecessarily checks the unused klog.krb5 - -lifetime command line argument. - - The unused lifetime variable was discovered by Pat Riehecky using the - clang scan-build static analyzer. - - Reviewed-on: https://gerrit.openafs.org/13309 - Tested-by: BuildBot - Reviewed-by: PatRiehecky - Reviewed-by: Michael Meffie - Reviewed-by: Benjamin Kaduk - (cherry picked from commit da699c8b81e818ba97ff8115397d7f7afe0bf512) - - Change-Id: I81cd0024f4727ba401df7b5813163b11f9b43bd4 - Reviewed-on: https://gerrit.openafs.org/14980 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 7d4f5fe3e2f8009ebfa45626f104b61cf9c6c924 -Author: Michael Meffie -Date: Mon Oct 1 11:38:37 2018 -0400 - - ubik: do not reuse the offset variable for the sync site address - - The ubik SendFile function performs a sanity check of the host address - before proceeding with the file transfer. Currently this check reuses - the file offset local variable to hold the value of the sync site - address, a 32-bit IPv4 address. Not only is this confusing, but also - causes a signed/unsigned type mismatch when comparing host addresses. - Instead of being so stingy with local variables, declare a new local - variable of the correct type to hold the value of the sync site address. - - This separation is also a prerequisite for supporting larger address - types in the future. - - Reviewed-on: https://gerrit.openafs.org/13351 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit f0bab78cbe4f59609fa18647a480cc6989948786) - - Change-Id: I2bda69a2586628b51e84c3facf116bf652e3df0a - Reviewed-on: https://gerrit.openafs.org/14979 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 1c5c7eba38dc510bf571225e3feeba9b7565bd27 +commit 91f11551714c6b6f653fd367bc8d184c8aba9e7b Author: Andrew Deason -Date: Thu Mar 24 12:04:13 2022 -0500 +Date: Fri Aug 24 13:03:24 2018 -0500 - afs: Remove redundant AFS_LINUX_ENV test + afs: Detect VIOCPREFETCH special case properly - After our Linux checks were converted to AFS_LINUX_ENV in commit - 6329a523 (Change AFS*_LINUXnn_ENV to AFS*_LINUX_ENV), the extra - AFS_LINUX_ENV check in this line doesn't make any sense. Get rid of - it. + Currently, afs_syscall_pioctl handles the VIOCPREFETCH pioctl as a + special case, calling into a different code path to handle + backgrounding the prefetch operation. However, we detect that we're + handling a VIOCPREFETCH operation just by looking at the lower 8 bits + of the given opcode. This means that any pioctl that ends in 0x0F will + trigger this codepath, such as if we add a 'C' or 'O' pioctl that uses + code 0x0F. - Reviewed-on: https://gerrit.openafs.org/14935 - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Cheyenne Wills + We only want to catch VIOCPREFETCH requests for this code path, so fix + the check to also check if we're processing a 'V' pioctl. + + Reviewed-on: https://gerrit.openafs.org/13301 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot - (cherry picked from commit a7d04f0770beb08ea7db2dcdc3dee80b2a57233a) + (cherry picked from commit 252b3bcc75ea141ff93a7b3147865f4b952fcaca) - Change-Id: I797e1d677cc758d0475011167c0cbafeedf9788c - Reviewed-on: https://gerrit.openafs.org/15037 - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Michael Meffie + Change-Id: I12d0616059dd8115b109b1ffa4cafe6ddc4b1662 + Reviewed-on: https://gerrit.openafs.org/15241 Reviewed-by: Andrew Deason - Reviewed-by: Benjamin Kaduk + Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Tested-by: Andrew Deason Reviewed-by: Stephan Wiesand -commit 147d3bf945f5f3c5135a372a91d079c8ef99fb50 -Author: Cheyenne Wills -Date: Thu Jun 2 11:17:45 2022 -0600 +commit 581450c74c57680eeb89bf937b4d42936df6196b +Author: Marcio Barbosa +Date: Wed Apr 6 20:59:56 2022 +0000 - Cleanup AFS_*LINUX_ENV usage + afs: Replace strcpy &co by safer alternatives - Commit 6329a523f6305541871bc3d1694065e7b17abe77 changed all - occurrences of AFS_*LINUXnn_ENV to AFS_*LINUX_ENV, but did not perform - any refactoring of the use of these variables. + In addition to being unsafe, these functions (strcpy, strncpy, strcat, + and sprintf) are deprecated on macOS. Replace these functions by safer + alternatives (strlcpy, strlcat, snprintf, and afs_strdup). - This commit completes the task by refactoring the preprocessor - conditionals that involved removing dead code or collapsing statements. - - The updates should have no functional changes. - - Reviewed-on: https://gerrit.openafs.org/14388 - Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit cbc18e4b311bdd2c461f60b7b96eb2ab8a6d1ee5) - - Change-Id: I02e9f0cab5e60994c67593b0709ae1e500d23545 - Reviewed-on: https://gerrit.openafs.org/14978 - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Stephan Wiesand - -commit 43644792092698ace05a6e96bf58464d7837abdd -Author: Cheyenne Wills -Date: Thu Jun 2 11:19:32 2022 -0600 - - Change AFS*_LINUXnn_ENV to AFS*_LINUX_ENV - - The minimum Linux kernel that is now supported is linux-2.6.18. The - Linux versioned preprocessor macros AFS_*LINUXnn_ENV are no longer - needed to distinguish the different levels of Linux and can be merged - into just a single set of macros. - - Perform a global change of _LINUX\d+_ENV to _LINUX_ENV. e.g. - AFS_LINUX24_ENV -> AFS_LINUX_ENV - AFS_USR_LINUX24_ENV -> AFS_USR_LINUX_ENV - AFS_AMD64_LINUX20_ENV -> AFS_AMD64_LINUX_ENV - - Replace the multiple definitions for the versioned 'AFS*_LINUXnn_ENV' - with just single non-version definitions 'AFS*_LINUX_ENV'. - - Apart from replacing the now-redundant #define directives and tidying up - a few comments at the close of a preprocessor block to match their - current form, this commit was done using a mechanical change of the - variable names and did not reduce preprocessor statements that could now - be combined or eliminated. Nor does this commit remove dead code. A - follow-up commit (Cleanup AFS_*LINUX_ENV usage) will handle these - changes. - - The updates should have no functional changes. - - Reviewed-on: https://gerrit.openafs.org/14387 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 6329a523f6305541871bc3d1694065e7b17abe77) - - [cwills@sinenomine.net] Conflicts due to: - 'afs: Set AFS_VFSFSID to a numerical value' is already in 1.8.x - 'Linux 5.15: Convert osi_Msg macro to a function' is already in 1.8.x - 'fsint: remove dead code' is not in 1.8.x (removes fsint/afsaux.c) - 'Remove rpctestlib' is not in 1.8.x (removes rpc_test_procs.c) - - Change-Id: I19da50622f63db0fcad7acd834559c538e6030be - Reviewed-on: https://gerrit.openafs.org/14977 - Tested-by: BuildBot - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Stephan Wiesand - -commit a07ac7f818d8c4c79eed096bf57d2a147dc827be -Author: Andrew Deason -Date: Thu Jun 2 11:11:24 2022 -0600 - - Remove AFS_PARISC_LINUX24_ENV references - - Since commit 91713206 (Remove LINUX24 from src/afs), - AFS_PARISC_LINUX24_ENV is never defined. Remove references to it. - - Reviewed-on: https://gerrit.openafs.org/14472 - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit e0e0b3cea6305cdbccc71039a05d6121c32c51cf) - - Change-Id: I4871f5ba6018ab47c78d3f07d4665b5a2676102f - Reviewed-on: https://gerrit.openafs.org/14976 - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 49512eb8c94f81ed8611e288008275899ac6bfd2 -Author: Andrew Deason -Date: Tue Jun 2 13:37:00 2020 -0500 - - afs: Always define our own osi_timeval32_t - - Since OpenAFS 1.0, osi_GetTime has taken a timeval-like pointer, which - contains 32-bit fields (the actual type has been called either - osi_timeval_t or osi_timeval32_t over time). For platforms that have a - native timeval-like type with 32-bit fields, we just define - osi_timeval32_t to that type, and elsewhere we define our own struct - to be osi_timeval32_t. For platforms that use the native timeval, we - can then define osi_GetTime() to just be, e.g., microtime(). - - This approach is difficult to maintain, though, because we must keep - track of whether 'struct timeval' contains 32-bit fields on each - platform, which can depend on many factors. It's easy to make mistakes - (the current tree already contains mistakes), and there's not much - benefit. - - To avoid all of this, just always define osi_timeval32_t to be our own - struct with afs_int32 fields, and provide definitions for osi_GetTime - that convert from the native time struct to our osi_timeval32_t. This - does mean that for some platforms we do an unnecessary type - conversion, but this is a small price to pay for more straightforward - and maintainable code. - - To be a little more sure that our types are correct, change - osi_GetTime to be defined as an inline function instead of a macro. - - At the same time, do a similar conversion for the KERNEL - implementation of the rx clock_GetTime function. Get rid of - platform-specific mess, and do a straightforward type conversion - between osi_timeval32_t and struct clock in an inline function. - - Reviewed-on: https://gerrit.openafs.org/14238 - Reviewed-by: Michael Meffie - Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit eccd4b9778014c36a4b3af6d9e80194066bd2195) - - Change-Id: Ia6ccc7ff3e3a7cfb346449c1335e7a045688aebf - Reviewed-on: https://gerrit.openafs.org/14974 - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit e01db4d01e6215628edcd13ae76392629424fd97 -Author: Andrew Deason -Date: Tue Jun 2 13:12:14 2020 -0500 - - afs: Move osi_GetTime out of param.h - - Most platforms currently #define osi_GetTime in their param.h. This is - really redundant, since the definition of osi_GetTime almost never - changes for a given platform, so we end up with many copies of the - same osi_GetTime definition for a given platform. - - Move osi_GetTime out of param.h for these platforms, and define it in - osi_machdep.h instead, which is where most platform-specific - definitions go. - - For DFBSD, we don't have an osi_machdep.h at all yet, so create a new - one to contain the osi_GetTime definition. Currently we don't build - libafs at all on DFBSD, but do this anyway so we don't lose the - existing osi_GetTime definition. - - For NBSD, we were providing (conflicting!) definitions for osi_GetTime - in param.h and in osi_machdep.h. Just remove the definitions in - param.h, since those should have been getting overridden by the - osi_machdep.h definition. - - Reviewed-on: https://gerrit.openafs.org/14237 - Tested-by: BuildBot - Reviewed-by: Michael Meffie - Reviewed-by: Benjamin Kaduk - (cherry picked from commit a5c3dfe99fa1831e3b416e89f52a03fd1cf9f73d) - - Change-Id: I3afff0c1b4c14649cc072d555d0c3ebd6de8a0fe - Reviewed-on: https://gerrit.openafs.org/14972 - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit f792585297f597c5ac6b53afb89d9e66cc387845 -Author: Mark Vitale -Date: Tue May 5 11:26:00 2020 -0400 - - UKERNEL: remove redundant declaration of osi_GetTime - - Commit c861bb0d779b54236b63eda87d9dfaf7792d1659 "Additional UKERNEL - headers, prototyping and other fixes" added the following lines to - src/rx/rx_prototypes.h: - - #if defined(UKERNEL) && !defined(osi_GetTime) - extern int osi_GetTime(struct timeval *tv); - #endif - - However, this appears to be redundant with the declaration in - src/afs/afs_prototypes.h: - - #ifdef UKERNEL - ... - extern int osi_GetTime(struct timeval *tv); - ... - #endif - - which was added much earlier with commit - 8f2df21ffe59e9aa66219bf24656775b584c122d - "pull-prototypes-to-head-20020821". - - Remove the redundant declaration in rx/rx_prototypes.h. - - No functional change is incurrred by this commit. - - Reviewed-on: https://gerrit.openafs.org/14192 - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 03f44172180563cb9d12d79e5512aae815fee899) - - Change-Id: I2e562f0e25bf4dd0f47f952782792585a8e7fc20 - Reviewed-on: https://gerrit.openafs.org/14975 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit c45808df7c97ff4656d7592c7fef437bd07e9163 -Author: Mark Vitale -Date: Mon May 18 14:19:25 2020 -0400 - - Convert all osi_timeval_t to osi_timeval32_t - - Since commit 130144850c6d05bc69e06257a5d7219eb98697d8 "xstat: cm xstat - time values are 32 bit", OpenAFS has had two timeval definitions: - osi_timeval_t and osi_timeval32_t. Since they are functionally - equivalent, convert all references to osi_timeval_t to osi_timeval32_t. - This makes clear that this struct is always expected to contain 32-bit - members for tv_sec and tv_usec. - - There are still a few platforms where osi_timeval32_t is mistakenly - defined with 64-bit members; these will be addressed in future commits. + Notice that, in order to use afs_strdup(), this commit adds the afs_util + library to the AFSPAGOBJS list. Given that afs_strcasecmp() is also + implemented in afs_util.c, src/crypto/hcrypto/kernel/strcasecmp.c can be + removed from the tree. No functional change should be incurred by this commit. - Reviewed-on: https://gerrit.openafs.org/14215 + This commit is a continuation of a patch initially developed by + cwills@sinenomine.net. + + Reviewed-on: https://gerrit.openafs.org/14743 + Reviewed-by: Andrew Deason + Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 419f0cd7aa75719dcf4df97e603ad4f0d936ddd9) + + [cwills@sinenomine.net] + Part of the (419f0cd7aa) changes to afs_callback.c were pulled in to a + 1.8.x specific commit: + "afs: Avoid unbounded string copy in SRXAFSCB_GetLock()" (79a04c344) + In order to resync the code, the include roken.h in afs_callback.c + introduced in that commit needed to be removed. + + Change-Id: Ica0e9bdc82de2b1e89e6d4b513e775b2809fbc34 + Reviewed-on: https://gerrit.openafs.org/15240 + Reviewed-by: Michael Meffie + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + Tested-by: Stephan Wiesand + +commit c7048f9a5c29df5816b6bcebaa42965bccb12557 +Author: Mark Vitale +Date: Thu Jun 14 14:38:54 2018 -0400 + + afs: remove dead code + + afs_CheckLocks has been dead code since openafs-ibm-1_0. + + No functional change incurred. + + Reviewed-on: https://gerrit.openafs.org/13210 + Tested-by: BuildBot + Reviewed-by: Benjamin Kaduk + (cherry picked from commit 0839a3326858f7d7a0042614710dcf7316bb6018) + + Change-Id: I1c564255990803dac7abe1789f2941bf4fa30b58 + Reviewed-on: https://gerrit.openafs.org/15239 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit fc5be911a0ef216b9af79a0ec6bc32512085d398 +Author: Marcio Barbosa +Date: Wed Mar 23 16:04:46 2022 -0300 + + UKERNEL: Remove flock -> usr_flock redirection + + In order to replace 'struck flock' with 'struct usr_flock' and 'flock()' + with 'usr_flock()', the current version of src/afs/UKERNEL/sysincludes.h + defines flock to usr_flock. This can cause problems when trying to use + libroken in UKERNEL code, because roken.h redefines flock. + + To avoid conflicts with libroken (included in a future commit), add a + new UKERNEL specific AFS_FLOCK -> usr_flock redirection. Doing so, the + flock -> usr_flock redirection can be removed. While here, also remove + 'usr_flock()' as it shouldn't be called and is not defined in any header + file. + + Reviewed-on: https://gerrit.openafs.org/14913 + Reviewed-by: Andrew Deason + Reviewed-by: Cheyenne Wills + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 51c0387aaa5ec507c6e29063ef56d98e2931402d) + + Change-Id: I3c2d9de056bae3f2fed68f1ec183540b63584a43 + Reviewed-on: https://gerrit.openafs.org/15238 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit 276632ea7334fd27972585823f358e92b448da59 +Author: Andrew Deason +Date: Thu Jan 27 14:49:15 2022 -0600 + + UKERNEL: Remove socket -> usr_socket redirection + + Currently, src/afs/UKERNEL/sysincludes.h #defines 'socket' to + 'usr_socket', in order for 'struct socket' declarations to use struct + usr_socket. Redefining a simple word/function like 'socket' can easily + cause issues, and currently makes it difficult to introduce libroken + callers in UKERNEL code. There are already several instances of + '#undef socket' in the tree for UKERNEL, suggesting that this wasn't a + good idea to start with. + + Fortunately, this redefinition of 'socket' in UKERNEL seems + unnecessary, since the only place 'struct usr_socket' is actually + deferenced is inside src/rx/UKERNEL/rx_knet.c. So we can treat 'struct + usr_socket' as a struct definition that's just internal to rx_knet.c, + and no other code even needs to know about the struct, or think that + it's equivalent to 'struct socket'. + + Most code in rx_knet.c already explicitly casts between 'struct + socket' and 'struct usr_socket'. The only exception is rxi_Recvmsg + starting in commits near 27c42be1 (ukernel-rx-knet-deref-20060126), + but this is easily fixed by adding an additional explicit cast. + + Reviewed-on: https://gerrit.openafs.org/14887 + Reviewed-by: Benjamin Kaduk + Tested-by: BuildBot + (cherry picked from commit 17b16cb3989d1f41e314795515daf6c9b41cf1de) + + Change-Id: I35c7b7fc61c1c741be928fa7beb889d8848f0b81 + Reviewed-on: https://gerrit.openafs.org/15237 + Reviewed-by: Andrew Deason + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Stephan Wiesand + +commit f2f0be5e04f2a700b721f647a87cbffe2ccd606a +Author: Marcio Barbosa +Date: Wed Mar 23 15:10:15 2022 -0300 + + afs: Save size of sysname_info->name + + In preparation for a future commit, save the size of sysname_info->name + by adding a new field (name_size) into the sysname_info struct. Also, + remove the sysname_info->allocked field, since now we can find out if + memory has been allocated by checking if sysname_info->name_size is + different than zero. + + No functional change should be incurred by this commit. + + Reviewed-on: https://gerrit.openafs.org/14912 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk - (cherry picked from commit c6eff25be9fc959f666b33425c9ee2635224826e) + (cherry picked from commit c40c0bd00b7e49e67377e13f5b902c13a0e4478c) - Change-Id: I55a2ac3d7fb65c3b14aded755cd81056a3775f74 - Reviewed-on: https://gerrit.openafs.org/14971 + Change-Id: I5a7d0d733dfc48d4d4eb5d00ef959ad980722e17 + Reviewed-on: https://gerrit.openafs.org/15236 Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Harish Sharma Reviewed-by: Stephan Wiesand -commit 00232a56dddd05d257f18e280efcd3ee43f1e2dc -Author: Mark Vitale -Date: Mon May 4 17:35:05 2020 -0400 +commit 6ba75f842f307e94db86b95c9da98e9e40d11c35 +Author: Marcio Barbosa +Date: Thu Jul 1 10:47:50 2021 -0300 - UKERNEL: remove dead code osi_SetTime + fs: add option to evaluate symlink or mtpt - osi_SetTime has been dead code since the original IBM code import. - Remove it from the tree. + Currently, several fs subcommands for Windows offer an option (-literal) + to evaluate symlink / mount point rather than the object it refers to. + Provide the same option on Unix for fs_getfid. + + Reviewed-on: https://gerrit.openafs.org/14542 + Reviewed-by: Andrew Deason + Reviewed-by: Benjamin Kaduk + Tested-by: Benjamin Kaduk + (cherry picked from commit 83d947c150322c3c7c65130ecf08719e466cae04) + + Change-Id: Ife60e046c149f3586dbdad0e9b3fd6059967ece1 + Reviewed-on: https://gerrit.openafs.org/15235 + Reviewed-by: Michael Meffie + Tested-by: BuildBot + Reviewed-by: Harish Sharma + Reviewed-by: Stephan Wiesand + +commit f1fd9c9cae8438635ea6e64fff05507921046ef3 +Author: Marcio Barbosa +Date: Tue Aug 17 19:52:11 2021 +0000 + + afs: refactor PNewStatMount and PFlushMount + + Both functions use the same logic to find a name in a given directory. + To avoid repetition, move this logic to a separate function called + afs_LookupName(). No functional change is incurred by this commit. - Reviewed-on: https://gerrit.openafs.org/14191 - Reviewed-by: Andrew Deason - Tested-by: BuildBot + Reviewed-on: https://gerrit.openafs.org/14541 Reviewed-by: Benjamin Kaduk - (cherry picked from commit d6101128664918e6fcefbaeb68c4c1d439851411) + Tested-by: BuildBot + (cherry picked from commit 981bc005f8161ca9ee52ea281c7d73e0e4e2461a) - Change-Id: I8a406e4199b959f7470b53882ee143efb8723d7c - Reviewed-on: https://gerrit.openafs.org/14973 + Change-Id: I11f03146da86c91f83ad682df7ad1943cb4ab68f + Reviewed-on: https://gerrit.openafs.org/15234 Reviewed-by: Michael Meffie Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Harish Sharma Reviewed-by: Stephan Wiesand -commit 7bead34f357ec10f287062206f4056dbfe8adfdb +commit b17625959386459059f6f43875d8817383554481 Author: Cheyenne Wills -Date: Thu Jun 2 11:18:59 2022 -0600 +Date: Thu Dec 1 14:18:36 2022 -0700 - clang-10: use AFS_FALLTHROUGH for case fallthrough + cf: Handle autoconf linux checks with -Werror - Clang-10 will not recognize '/* fallthrough */' as an indicator to - turn off the fallthrough diagnostic due to the lack of a 'break' in a - case statement. Clang-10 requires the '__attribute__((fallthrough))' - statement to disable the diagnostic. + When the linux kernel has been configured with CONFIG_WERROR=y, several + autoconf configure checks used to detect linux features fail due to the + compiler performing additional coding checks (e.g. unused variables, + uninitialized variables, etc.). Typically these additional coding + checks produce compiler warnings, but with CONFIG_WERROR=y these + warnings are reported as compiler errors, resulting in a misconfigured + build environment. - In addition clang-10 is finding additional locations where fall throughs - occur. + When testing for kernel features, turn off -Werror in the autoconf + functions AC_CHECK_LINUX_BUILD and AC_CHECK_LINUX_FUNC by explicitly + setting the compiler '-Wno-error' flag. - Determine if the compiler supports '__attribute__((fallthrough))' to - disable the implicit fallthrough diagnostic. + In addition, fix the commented description for AC_CHECK_LINUX_BUILD to + match the actual parameters - Define a new macro 'AFS_FALLTHROUGH' that will disable the fallthrough - diagnostic. Set it as a wrapper for the Linux kernel's 'fallthrough' - macro if available, otherwise set it as a wrapper macro for - '__attribute__((fallthrough))' if the compiler supports it. - - Update CODING to document the use of AFS_FALLTHROUGH when needing to - fallthrough between case statements. - - Replace the '/* fallthrough */' comments with AFS_FALLTHROUGH, and add - AFS_FALLTHROUGH as needed. - - Replace some fallthroughs with a break (or goto) if the flow was was - just to a break (or goto). - - e.g. case x: case x: - somestmt; somestmt; - break; - case y: case y: - break; break; - - Correct a mis-indented brace '}' in src/WINNT/afsd/smb3.c - - Note, the clang maintainers have rejected the use of comments as a flag - to turn off the fall through warnings. - - Reviewed-on: https://gerrit.openafs.org/14274 - Tested-by: BuildBot + Reviewed-on: https://gerrit.openafs.org/15191 Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk - (cherry picked from commit 16f1b2f894c28614df0f096be8232b1176e87c70) + Tested-by: BuildBot + (cherry picked from commit e2ad1ca5f7355062e808f1717e7410b7ae893371) - [cwills@sinenomine.net Note the fallthrough case in asetkey.c that - exists in the original master commit is not present 1.8.x] - - Change-Id: I4d92d519bd168ac111f46d37bcf7dca7021e5463 - Reviewed-on: https://gerrit.openafs.org/14970 - Reviewed-by: Andrew Deason + Change-Id: I2c8ba4c421ed751aa6ff2899ea173c1e84053322 + Reviewed-on: https://gerrit.openafs.org/15231 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand -commit 97b8fe13831d575ada7ea85c794637d1b4dd3493 +commit 57df4dff496ca9bea04510759b8fdd9cd2cc0009 Author: Cheyenne Wills -Date: Thu Jun 2 10:56:39 2022 -0600 +Date: Thu Dec 1 12:55:26 2022 -0700 - Add more 'fall through' switch comments + cf: Detect how to pass CFLAGS to linux kbuild - Commit a455452d (LINUX 5.3: Add comments for fallthrough switch cases) - added the special /* fall through */ comment to various switch/case - blocks, in order to avoid implicit-fallthrough warnings from causing - the build to fail when building the Linux kernel module. + The autoconf test LINUX_KBUILD_USES_EXTRA_CFLAGS fails on modern kernels + when detecting how to pass CFLAGS to the compiler when building a Linux + kernel module. The result of this test is used by configure when + testing for Linux kernel features. - In this commit, add additional /* fall through */ comments to the rest - of the tree where falling through is intentional. Add a "break;" in one - place in dumptool.c where falling through seems like a mistake, and flag - certain functions as AFS_NORETURN to avoid needing to explicitly break - or fallthrough. + In addition the EXTRA_CFLAGS method of passing compiler parameters has + been deprecated since Linux 2.6.24 commit: + "kbuild: introduce ccflags-y, asflags-y and ldflags-y" (f77bf01425b) - Check for the availability of the -Wimplicit-fallthrough compiler flag - and use it when --enable-checking is set, to prevent additional cases - from creeping into the tree. + The currently preferred method is to use the make variable 'ccflags-y' + to set compiler flags. - Note: the -Wimplicit-fallthrough compiler flag was added in gcc 7. + Replace the autoconf function LINUX_KBUILD_USES_EXTRA_CFLAGS with a new + test, LINUX_KBUILD_FIND_CFLAGS_METHOD, that checks the various ways to + pass compiler flags when building the kernel module. - Reviewed-on: https://gerrit.openafs.org/14125 + Set the build variable "LINUX_KBUILD_CFLAGS_VAR" with the determined + method for setting kbuild compiler flags. + + Update the AC_TRY_KBUILD26 autoconf function and the + make_kbuild_makefile.pl script to use the determined method for setting + the compiler flags for the kbuild process. + + Background: + + The autoconf test, LINUX_KBUILD_USES_EXTRA_CFLAGS, is used to determine + when to use either CFLAGS for EXTRA_CFLAGS when performing other + autoconf tests for Linux kernel features. The test was added with the + openafs commit: + "linux-2624-20071123" (af7cf697ef8) + + LINUX_KBUILD_USES_EXTRA_CFLAGS relied on the Linux 2.6.24 commit: + "kbuild: check for wrong use of CFLAGS" (0c53c8e6eb4) + which caused a build failure if CFLAGS where used instead of + EXTRA_CFLAGS. + + Later with the Linux 4.20 commit: + "kbuild: remove old check for CFLAGS use" (0d91bf584fe) + which removed the build failure when CFLAGS were set and this resulted + in LINUX_KBUILD_USES_EXTRA_CFLAGS failing to properly determining how to + set compiler flags in the kbuild process. + + As mentioned above, the EXTRA_CFLAGS method itself has been deprecated + in Linux 2.6.24, but support for using it has still present in the + kbuild processes. + + Reviewed-on: https://gerrit.openafs.org/15196 + Tested-by: BuildBot + Reviewed-by: Cheyenne Wills Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit 929d501421579290ce1d4f9aabe45980e5458a9a) + (cherry picked from commit f81b01de1a51f02798ac764fb2f6948b592639da) - Change-Id: I57d19d715fe61e9125b0b9efc8ae36934001bb10 - Reviewed-on: https://gerrit.openafs.org/14969 - Reviewed-by: Michael Meffie + Change-Id: Ib1e07bf6b8734a427a2682ca694fbe2e083f1ecd + Reviewed-on: https://gerrit.openafs.org/15230 Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa + Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand -commit 249461a7bbe0668137dcafb455c1c0593d90e503 +commit 2cf76b31ce4c912b1151c141818f6e8c5cddcab2 Author: Andrew Deason -Date: Tue Mar 31 21:19:18 2020 -0500 +Date: Fri Jun 28 14:14:48 2019 -0500 - vos: Properly print volume transaction flags + LINUX: Run the 'sparse' checker if available - Currently, the code in 'vos status' treats the 'iflags' and 'vflags' - of a transaction like an enumerated type; that is, we only check if - 'iflags' is equal to ITOffline or ITBusy, etc. But both of these flags - fields are bitfields; any combination of the relevant flags could - theoretically be set. + The Linux kernel module buildsystem supports running an external tool + (by default, the 'sparse' tool) during the build to run additional + static checks on the source code to flag various warnings. - Practically speaking, we only ever set at most one of the flags in - 'iflags', but if anything ever did set more than one flag, our output - would look broken (we'd print "attachFlags:" without any flags). + Tell the kernel build to run such a tool, if 'sparse' is installed. + This causes various new warnings in the build, such as: - For 'vflags', multiple flags are often set at once: the most common - combination is VTDeleteOnSalvage|VTOutOfService. So currently, we - usually print "attachFlags:" without any actual flags, since the - 'vflags' field isn't exactly equal to VTDeleteOnSalvage (instead it's - set to VTDeleteOnSalvage|VTOutOfService). And if we ever did see just - VTDeleteOnSalvage set by itself, the way the switch() cases fall - through to each other, we'd print out that _all_ flags are set. + CHECK /.../src/libafs/MODLOAD-4.9.0-8-amd64-MP/afs_tokens.c + /.../src/libafs/MODLOAD-4.9.0-8-amd64-MP/afs_tokens.c:73:1: warning: symbol 'afs_FreeOneToken' was not declared. Should it be static? + /.../src/libafs/MODLOAD-4.9.0-8-amd64-MP/afs_tokens.c:160:1: warning: symbol 'afs_IsTokenExpired' was not declared. Should it be static? + /.../src/libafs/MODLOAD-4.9.0-8-amd64-MP/afs_tokens.c:187:1: warning: symbol 'afs_IsTokenUsable' was not declared. Should it be static? - To fix all of this, just test for the individual flag bits instead. + None cause the build to fail currently, but are just printed for + potential further investigation. - Reviewed-on: https://gerrit.openafs.org/14126 - Tested-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills - Reviewed-by: Benjamin Kaduk - (cherry picked from commit f841c189a53f3a6bcf5c25336e4e0ad5362036e2) + To control detecting 'sparse', add the --with-sparse configure option + and SPARSE configure variable. Default to checking if sparse is + available, and enabling it if so. - Change-Id: Id57d2569bbaa94bb9e7e621cdd16c1e171899362 - Reviewed-on: https://gerrit.openafs.org/14968 - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit ee428c60eba4c632de6e8a958a81745a12c76208 -Author: Michael Meffie -Date: Thu Jun 2 10:48:49 2022 -0600 - - autoconf: attribute type checks + Further information on using sparse in the Linux kernel is available + in Documentation/sparse.txt in the Linux tree. - Check for function attributes by type and update src/afs/stds.h to - conditionally include the attributes detected, instead of checking for - specific compilers and compiler versions. + Using 'sparse' during the build was suggested by yadayada@in.ibm.com. - This allows attributes to be used when building under Solaris Studio. - - Reviewed-on: https://gerrit.openafs.org/12963 - Reviewed-by: Michael Meffie - Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit 1f29c9f05f53966df1bbd9ece479155f78f995e0) - - Change-Id: I6163e3ebf73c6616dfd3de78e76b14b5907bd4df - Reviewed-on: https://gerrit.openafs.org/14967 - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit b075d032c994959fbe84006104f88a5bcf34fd2b -Author: Michael Meffie -Date: Thu Jun 2 10:47:46 2022 -0600 - - autoconf: check for format __attribute__ to avoid warnings - - Building with Solaris Studio generates a ludicrous number of warnings - in the form: - - roken.h, line ...: warning: attribute "format" is unknown, ignored - - Modern Solaris Studio supports several GCC-style function attributes, - including the `noreturn' attribute, however does not support the - `format' attribute. - - Currently, configure defines HAVE___ATTRIBUTE__ when the `noreturn' - attribute is available. roken headers conditionally declare printf-like - functions with the `format' function attribute when HAVE___ATTRIBUTE__ - is defined, leading to the warning messages when building under Solaris - Studio. Unsupported function attributes generate warnings, not errors. - - Fix these warnings by defining HAVE___ATTRIBUTE__ if and only if the - `format' attribute is supported by the compiler, instead of checking for - `noreturn'. Note that the `format' type is currently the only attribute - used by roken at this time. - - Reviewed-on: https://gerrit.openafs.org/12956 - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit f9b3cf888304d42c2a1a8472fdeeab68a7347859) - - Change-Id: I7ae19fa3d7d90e67d6eb63ef9b51a74a215e9273 - Reviewed-on: https://gerrit.openafs.org/14966 - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 96bc48a5730b2dcc14f2abaa8cdb5e433cedbdcd -Author: Andrew Deason -Date: Sat Apr 4 22:35:07 2020 -0500 - - Use autoconf-archive m4 from src/external - - Switch to using the m4 macros from autoconf-archive in our - src/external mechanism, instead of manually-copied versions in src/cf. - The src/external copy of ax_gcc_func_attribute.m4 is identical to the - existing copy in src/cf, so that should incur no changes. There are - also a few new macros pulled in, but they are currently unused. - - Increase our AC_PREREQ in configure.ac to 2.64, to match the AC_PREREQ - in some of the new files. - - Reviewed-on: https://gerrit.openafs.org/14135 - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills - Reviewed-by: Benjamin Kaduk - (cherry picked from commit ca847ddf35e336a8bc3159ce4b26f0162417bbd5) - - Change-Id: Ifa43b3869e426fada5bd925b0ae002a0f6436232 - Reviewed-on: https://gerrit.openafs.org/14944 - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit e2dc2e062886e2cbd10139bbaef8230801153d12 -Author: Autoconf Archive Maintainers -Date: Tue Apr 7 10:23:16 2020 -0500 - - Import of code from autoconf-archive - - This commit updates the code imported from autoconf-archive to - 24358c8c5ca679949ef522964d94e4d1cd1f941a (v2019.01.06) - - New files are: - m4/ax_append_compile_flags.m4 - m4/ax_append_flag.m4 - m4/ax_check_compile_flag.m4 - m4/ax_gcc_func_attribute.m4 - m4/ax_require_defined.m4 - - Reviewed-on: https://gerrit.openafs.org/14138 + Reviewed-on: https://gerrit.openafs.org/13665 Reviewed-by: Cheyenne Wills Tested-by: BuildBot Reviewed-by: Benjamin Kaduk - (cherry picked from commit d8205bbb482554812fbe66afa3c337d991a247b6) + (cherry picked from commit 1210a8d6d96db2d84595d35ef81ec5d176de05e8) - Change-Id: Ibc18f5ddef8b63ba258fa666ada60577a845aa8f - Reviewed-on: https://gerrit.openafs.org/14943 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Stephan Wiesand - -commit 666510fff2909f81279828cb63cf57dbf74cd29e -Author: Andrew Deason -Date: Sat Apr 4 22:28:21 2020 -0500 - - Add autoconf-archive to src/external - - Add autoconf-archive to the src/external mechanism, so we can more - easily import and update the AX_* m4 macros we pull in from - autoconf-archive. Commits are imported from - . - - We already have a copy of ax_gcc_func_attribute.m4 in the tree, so - include that in the list of files. While we're here, also include a - few more macros for checking compiler flags, which will be used in - subsequent commits. - - Reviewed-on: https://gerrit.openafs.org/14133 - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit a072c65bba86cbcd81157e354d3719ac41a2c97d) - - Change-Id: I785607be9abe85e43287c4880103a365e264473b - Reviewed-on: https://gerrit.openafs.org/14942 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Tested-by: BuildBot - Reviewed-by: Stephan Wiesand - -commit e8a2fb80228820ca2c38cb910a129c0a2e436df5 -Author: Michael Meffie -Date: Fri Mar 16 20:41:35 2018 -0400 - - autoconf: import gcc function attribute check macro - - Import Gabriele Svelto's AC_GCC_FUNC_ATTRIBUTE autoconf macro to check for - GCC-style function attributes. This macro is part of the GNU Autoconf - Archive[1]. The imported file is distributed under an all-permissive license. - - [1] https://www.gnu.org/software/autoconf-archive/ - - Reviewed-on: https://gerrit.openafs.org/12962 + Change-Id: I5d52b1eed48564956a687fba0419185b01621b13 + Reviewed-on: https://gerrit.openafs.org/15229 Tested-by: BuildBot Reviewed-by: Andrew Deason - Reviewed-by: Benjamin Kaduk - (cherry picked from commit b818854f19e33315d1b6453b72a55b54d740e976) - - Change-Id: I6305bf70715048da7da0d605d4ad4bf5551291c0 - Reviewed-on: https://gerrit.openafs.org/14988 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Tested-by: BuildBot - Reviewed-by: Stephan Wiesand - -commit fb767628e7249630b12f709a2af526be0dd133b9 -Author: Andrew Deason -Date: Sun Dec 22 00:43:07 2019 -0600 - - FBSD: Use GENERIC kernel headers by default - - Currently, if --with-bsd-kernel-build is not specified during - configure, we do not set KERNBUILDDIR during the libafs build at all. - This means that we do not use an opt_global.h during the build. - - For the GENERIC kernel, in the past this has worked well enough to - produce a working kernel module, but with FreeBSD 12, the GENERIC - kernel turns on the VIMAGE option by default. If our kernel module is - built without VIMAGE defined, our kernel module cannot be loaded into - GENERIC, since VIMAGE changes the definitions of some symbols that we - use (for example, trying to load such a libafs fails with the message - "link_elf_obj: symbol in_ifaddrhead undefined"). - - To allow the build to work by default for GENERIC kernels, without - needing any additional configure flags, change the libafs Makefile to - use the headers for the GENERIC kernel if no kernel build dir is - given. To do this, we create a directory in our build tree and - generate the opt_*.h headers in there (using config(8)), and specify - that directory as the kernel build dir. - - This approach only works for GENERIC kernels, of course, but that is - the most common scenario. Users that want to build for a custom kernel - configuration still need to specify the actual kernel build dir with - --with-bsd-kernel-build. - - Reviewed-on: https://gerrit.openafs.org/14001 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit a9c1939eeb36372872f3258a9ae7259a564332c3) - - Change-Id: I456871c2b55cd3fc1eef7bf68011a725e253b902 - Reviewed-on: https://gerrit.openafs.org/14921 - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 84324f434d298736e93948ef7cabf3df0d106131 -Author: Andrew Deason -Date: Wed Jan 1 17:09:24 2020 -0600 - - FBSD: Avoid recursive osi_VM_StoreAllSegments lock - - Currently, osi_VM_StoreAllSegments calls vget() for the given vnode, - which requires locking the vnode. However, the vnode should already be - locked. For example, when called from the close syscall, we reach this - function via: vn_close1 -> afs_vop_close -> afs_close -> - afs_StoreOnLastReference -> afs_StoreAllSegments -> - osi_VM_StoreAllSegments. This causes a panic like so: - - kernel: panic: lockmgr_xlock_hard: recursing on non recursive lockmgr 0x[...] @ /usr/src/sys/kern/vfs_subr.c:2730 - - We can also reach this code path from the BOP_STORE background - operation (BStore -> afs_StoreOnLastReference -> afs_StoreAllSegments - -> osi_VM_StoreAllSegments), initiated from afs_close(), which has the - vnode locked. In this case, we won't be recursively locking the vnode, - since the process calling afs_close() is the one that holds the lock, - and the background thread is the process trying to lock the vnode - again. So we'll just deadlock. - - From the comments in this function, it seems like locking the vnode at - all in here is unnecessary, since the vnode should be locked from the - higher-level functions anyway. So just skip the vget and all of the - related looping retry logic. As a result, this function can now become - somewhat simplified. - - Reviewed-on: https://gerrit.openafs.org/14000 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit bdd4a0c78b1acaf1c947ca53d16159ef95cc9840) - - Change-Id: I9f279cef6aef9beff6636edc0cd7cfa5f3d36cfa - Reviewed-on: https://gerrit.openafs.org/14920 - Reviewed-by: Michael Meffie - Reviewed-by: Cheyenne Wills - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 873dfea8bfdafbbeb9ca965680f3cf793ce14628 -Author: Mans Nilsson -Date: Thu Dec 16 21:36:22 2021 +0100 - - Add sysname, files and header entries for FreeBSD 12.3 - - Created a new sysname "amd64_fbsd_123" in src/config/afs_sysnames.h - and added "param" files with minimal changes: - - modified: src/config/afs_sysnames.h - new file: src/config/param.amd64_fbsd_123.h - new file: src/config/param.i386_fbsd_123.h - - This mod builds on 12.3 with all tests passing. - - Reviewed-on: https://gerrit.openafs.org/14860 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 7a6192276b3779205fa8bc8c141eda41cf28e37e) - - Change-Id: Id66f9fe5663b33671ba1b9e68b8715a5eacd5da2 - Reviewed-on: https://gerrit.openafs.org/14878 - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 0453c15b2a2cbef3afacb87a2c5622fc0c539f3e -Author: Michael Meffie -Date: Tue Aug 4 10:34:07 2020 -0400 - - tests: Accommodate c-tap-harness 4.7 - - The SOURCE and BUILD environment variables have been changed to - C_TAP_SOURCE and C_TAP_BUILD in the new version of c-tap-harness. The - runtests command syntax has changed as well. - - Convert all of the old SOURCE and BUILD environment variables to the new - C_TAP_SOURCE and C_TAP_BUILD names. - - Add the required -l command line option to specify the test list. - - Add the new runtests -v option to run the tests in verbose mode to make - it easier to see which tests failed. - - Reviewed-on: https://gerrit.openafs.org/14295 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 624219a1b2192e5c7b6b45e2cbe784a9c5f33a96) - - Change-Id: I3a1ed224a6271918711bdd520094df348d7f8cae - Reviewed-on: https://gerrit.openafs.org/14880 - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Stephan Wiesand - -commit 613c71829866efd922759647064e5a2944d5a968 -Author: Russ Allbery -Date: Mon Aug 3 20:59:25 2020 -0400 - - Import of code from c-tap-harness - - This commit updates the code imported from c-tap-harness to - abdb66561ffd4d2f238fdb06f448ccf09d80c059 (release/4.7) - - Upstream changes are: - - Daniel Collins (1): - Add is_blob() test function. - - Daniel Kahn Gillmor (1): - LICENSE: use https for all URLs - - Daria Brashear (1): - Add verbose mode environment variable to runtests - - Julien ÉLIE (2): - Document -v in usage and comments of runtests - Avoid realloc of zero length in tests/runtests.c - - Marc Dionne (1): - Add test_cleanup_register_with_data - - Russ Allbery (115): - clang --analyze cleanups for runtests - Modernize POD tests - Update README to my current layout - Explicitly note that test programs must be executable - Fix comment typo in tests/runtests.c - Switch to a copyright-format 1.0 LICENSE file - Flush harness output after each line - Show the test count as ? when the plan is deferred - More correctly backspace over test counts when aborting - Refactor test list handling - Allow passing tests on the runtests command line - Don't allow command-line arguments if a list was given - Search for tests under the name given as well - Release 2.0 - Fix backward incompatibility when searching for tests - Document decision to ignore TAP version directives - Release 2.1 - Document different runtests behavior in bail handling - Change exit status of bail to 255 - Release 2.2 - Add a new test_cleanup_register C API - Add warn_unused_result attributes - Add portability for warn_unsed_result attributes to tap/macros.h - Minor coding style fix (spacing) in runtests.c - Split the runtests usage string for ISO C90 string limits - Include stddef.h - Diagnose failure to register the exit handler - Use diag internally in the basic C TAP library - Some additional comments about cleanup functions - Move repetitive printing code in the C TAP library to a macro - Set a flag when bailing for more correct cleanup - Change my email address to eagle@eyrie.org - Release 2.3 - Add diag_file_add and diag_file_remove functions - Don't die for unknown files passed to diag_file_remove - Release 2.4 - Update comment about AIX and WCOREDUMP - Don't test for NULL before calling free - Be more careful about file descriptors in child processes - Run cleanup functions in non-primary processes as well - Release 3.0 - Update collective package copyright notices at start of LICENSE - Check integer overflows on memory allocation, fix string creation - Switch POD spelling test to use Lancaster consensus variable - Add new bnrealloc API for brealloc with checked multiplication - Rename nrealloc to reallocarray - Return the test status from test functions - Fix the overflow check for breallocarray - Fix the overflow check for xreallocarray in runtests - Restructure test result reallocation in runtests - Change diag and sysdiag to always return true - Release 3.1 - Fix typos in basic.c and basic.h - Fix usage message when running runtests with no arguments - Update introductory runtests comments for current syntax - Add the -l flag to suggested runtests invocation in README - Support comments and blank lines in test lists - Release 3.2 - Update licensing information - Various improvements to verbose support - Compile warning-free with Clang, check Autoconf macros - Release 3.3 - Remove unnecessary assert.h include in tap/basic.c - Fix some additional -v documentation issues - Rebalance usage to avoid too-long strings - Fix segfault in runtests with empty test list - Release 3.4 - Document running autogen if starting from Git - Rename autogen to bootstrap - Support and prefer C_TAP_SOURCE and C_TAP_BUILD - Fix comment typo in tests/runtests.c - Add missing va_end to is_double - Release 4.0 - Fix all non-https www.eyrie.org URLs - Add is_bool C test function - Add DocKnot metadata and a Markdown README file - Update documentation for new DocKnot standards - Release 4.1 - Use more defaults from DocKnot templates - Fix new fall-through warning in GCC 7 - Use compiler warnings from rra-c-util, fix issues - Merge pull request #4 from solemnwarning/master - Coding style fixes and NEWS for is_blob - Re-enable -Wunknown-pragmas for GCC - Avoid zero-length realloc allocations in breallocarray - Update copyright date on tests/runtests.c - Release 4.2 - Add SPDX-License-Identifier headers to source files - Add and run new check-cppcheck target - Fix instructions for running one test - Identify values as left and right - Fix is_string comparisons with NULL pointers - Add support for running tests under valgrind - Replace putc with fprintf - Update shared files from rra-c-util - Release 4.3 - Update NEWS date for 4.3 release - Collapse some copyright dates - NEWS and coding style for test_cleanup_register_with_data - Remove unused variables caught by Clang scan-build - Update to rra-c-util 8.0 - Fix error checking in bstrndup - Release 4.4 - Add support for C++ - Document that C TAP Harness can be built as C++ - Release 4.5 - Regenerate README files - Reformat using clang-format 10 - Update to rra-c-util 8.1 - Release 4.6 - Fix spelling errors caught by codespell - Protect the test suite against C_TAP_VERBOSE - Switch to GitHub Actions for CI - Add NEWS entry for GCC 10 warning fixes - Release 4.7 - - Reviewed-on: https://gerrit.openafs.org/14294 - Reviewed-by: Andrew Deason - Tested-by: Andrew Deason - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 3f377aa117273eba5c77ad652c0b086446b3f874) - - Change-Id: I7b72d9ebd34d3bb5a05268339e136bb1b4309b92 - Reviewed-on: https://gerrit.openafs.org/14879 - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Reviewed-by: Stephan Wiesand - Tested-by: Stephan Wiesand - -commit dea63972a3bbb889fb978e75540825d8e6786590 -Author: Andrew Deason -Date: Fri Mar 5 22:20:35 2021 -0600 - - dir: Explicitly 'make all' in src/dir/test - - Currently, we 'cd test' and then just run 'make', which makes the - first target specified in the Makefile. On some platforms (FreeBSD), - this results in 'make' trying to build '%.c', which of course we - cannot do, since that's a pattern rule, and so 'make' fails. - - To fix this, just 'make all' explicitly, to make the intended targets - in src/dir/test. - - Reviewed-on: https://gerrit.openafs.org/14550 - Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit c0b7367253eb6c346d577e099a0b0172d4d24ff3) - - Change-Id: I3c1cc73d88471a31ce2d95325c8dafe797d1c43d - Reviewed-on: https://gerrit.openafs.org/14911 - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 2d4f2625fce8fdc3491148c51404197de5c4ffc4 -Author: Mark Vitale -Date: Tue Mar 5 23:11:38 2019 -0500 - - dir: make dtest buildable again - - Commit 7fe4125fe3435092b75ed29b884d8d3c2d1a2cad 'dir/vol: Die() really - does' overlooked src/dir/test/dtest.c, breaking its build. - - Fix the signature of Die() and the makefile so dtest can be built. - In addition, change the Makefile so it is always built. - - Reviewed-on: https://gerrit.openafs.org/13794 - Reviewed-by: Andrew Deason - Reviewed-by: Cheyenne Wills - Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit 192a2ff49af5dbbb4f8175eec7cb63bfe97e444e) - - Change-Id: I92df1068c0c071ac643bd8c43eb7e63efdf4f09b - Reviewed-on: https://gerrit.openafs.org/14910 - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - Tested-by: Stephan Wiesand - -commit a083a277a7f2407c2378b634c37a6fb13770baf1 -Author: Michael Meffie -Date: Thu Dec 27 09:32:35 2018 -0500 - - build: declare test targets as phony - - Modern versions `make` will not build the 'test' target since a - directory exists with the same name. - - $ grep -C1 '^test:' Makefile - test: - cd test; $(MAKE) - - $ make test - make: 'test' is up to date. - - Declare these targets as .PHONY to force make to build the test programs - even when the 'test' directory is present. Also use '&&' to concatenate - commands instead ';' to avoid running the second command when the first - fails. - - Reviewed-on: https://gerrit.openafs.org/13419 - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 0bd55a02bb5707b1b8b26347d5cb6ad71765f622) - - Change-Id: I4bc8c09720a19658afbab733ea74332083bb29f4 - Reviewed-on: https://gerrit.openafs.org/14909 - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 97449810aca0448c50e1afa162a24b1cad99a62b -Author: Andrew Deason -Date: Fri Apr 16 11:11:35 2021 -0500 - - rx: Remove delays in multi_End_Ignore - - When using our multi_Rx mechanism, callers can use either multi_End or - multi_End_Ignore at the end of the multi_Rx block. Among other things, - these macros run 'rx_EndCall(call, code)' for each call in the - multi_Rx invocation that hasn't already ended. For multi_End, 'code' - is RX_USER_ABORT, and for multi_End_Ignore, 'code' is 0; the macros - are otherwise equivalent. - - When multi_End is used, this means any un-ended calls are aborted with - RX_USER_ABORT, and the call immediately ends. But when - multi_End_Ignore is used, the call is not aborted, and so we must wait - for the peer to acknowledge that it has received our packets before - ending (done via an rxi_ReadProc call in rx_EndCall). - - This means that if a caller multi_Abort's out of a multi call and uses - multi_End_Ignore, we'll wait for the peer to acknowledge our packets - for all of the calls we haven't processed. Waiting for that is a - complete waste of time, since we don't care about the results of those - calls (since we multi_Abort'd). This doesn't matter much if those - calls are responded to promptly, but if the peer is not up or is just - slow, it can cause us to wait several seconds until we timeout. - - There are currently only three users of multi_End_Ignore: - - - DoProbe in src/ubik/recovery.c - - - MultiBreakCallBackAlternateAddress_r in src/viced/callback.c - - - MultiProbeAlternateAddress_r in src/viced/callback.c - - All of these use multi_Rx to try and probe multiple IPs for the same - machine in parallel, and so some of the calls may very well be trying - to contact unreachable IPs; we only need one to work for the call to - succeed. - - To avoid the unnecessary delays in these codepaths, convert them to - use multi_End. Change multi_End_Ignore to be the same as multi_End, - and multi_Finalize_Ignore to the same as multi_Finalize, to make sure - the bad behavior is not used. The _Ignore macros/functions are now - unused in the tree, but keep them around for now since - multi_Finalize_Ignore is exported by libafsrpc. - - Thanks to mbarbosa@sinenomine.net for discovering this weird behavior. - - Reviewed-on: https://gerrit.openafs.org/14595 - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 002b031d01e3c0f2ad3e1069b98800c3a7228bd5) - - Change-Id: Ic49c0810bdc9643600a5c060bef4a669798afaf3 - Reviewed-on: https://gerrit.openafs.org/14815 - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 7658c64177af38081d61abae63203c8c98b9c95e -Author: Andrew Deason -Date: Thu Apr 4 16:18:57 2019 -0400 - - fs: Avoid unnecessary cell DNS lookups - - Currently, many routines in 'fs' cause afsconf_GetCellInfo to be - called for the given cell, which causes an AFSDB/SRV lookup for the - given cell if the cell has no dbservers specified in the local - CellServDB. Sites often define such CellServDB records to indicate - that the given cell exists, but the dbserver IPs should only be looked - up via DNS. - - However, 'fs' is only calling afsconf_GetCellInfo in order to - canonicalize the cell name (we're allowed to give an abbreviated name - for a cell on the command line if the abbreviation is unambiguous, but - we want to give the full name to the kernel). We don't care about the - other cell info at all, so triggering a DNS lookup is completely - unnecessary. - - If our DNS server is not responding, e.g. because we've lost network - access entirely, this causes the relevant 'fs' commands to fail, - possibly after a long delay. Some fs commands such as 'fs setcell' are - often run during client startup, and can still otherwise run fine - without network access, and so such failures are unnecessary. - - To fix this, we introduce a new function, called afsconf_GetCellName, - which only returns the full name for a cell, and does not require a - DNS lookup for such "empty" cells in the local CellServDB. For all - code paths in 'fs' that just need the cell name (which is all of them - besides 'fs mkmount'), use this new function. - - Reviewed-on: https://gerrit.openafs.org/13540 - Reviewed-by: Michael Meffie - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 4a150387e3151ecdfca8b4f7c732a1e876968279) - - Change-Id: Ia81eb1e067fe399949d3ea8ae1957e87f6698753 - Reviewed-on: https://gerrit.openafs.org/14814 - Reviewed-by: Andrew Deason - Reviewed-by: Michael Meffie - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 73ebdb11ef16d4f7ead62ce1265c0f59d1a97452 -Author: Mark Vitale -Date: Fri Jan 29 01:00:56 2016 -0500 - - afs: clarify cold and warm shutdown logic - - Currently, any code that wants to perform a cold shutdown must first set - global afs_cold_shutdown = 1, then call afs_shutdown(void). - - Instead, modify afs_shutdown() to accept a single parm which specifies - AFS_WARM or AFS_COLD shutdown, and to set the value of global - afs_cold_shutdown based on this parm. Remove all other assignments for - afs_cold_shutdown. Modify all callers of afs_shutdown() to specify - AFS_WARM or AFS_COLD as needed to maintain equivalent function. - - This should make it much easier to tell at a glance what type of - shutdown is being requested by each caller to afs_shutdown(). - - No functional change should be incurred by this commit. - - Reviewed-on: https://gerrit.openafs.org/12182 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Benjamin Kaduk - (cherry picked from commit a2e03e74c4959f72c90288ec85a40c037c9c6243) - - Change-Id: I9271c1161f419ea02b9fe43ec46219dce19c9d50 - Reviewed-on: https://gerrit.openafs.org/14813 - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 0ef2427d12bb3c07a6dd66ac07bbfe958871e8d4 -Author: Michael Meffie -Date: Fri Oct 18 13:43:36 2019 -0400 - - warn when starting without keys - - The server processes will happily start without keys and then fail all - authenticated access, including database synchronization and local - commands with -localauth. At least issue warnings to let admins know - the keys are missing and that akeyconvert or asetkey needs to be run. - - The situation is not helped by fact the filenames of the key files have - changed between versions. In 1.6.x the (non-DES) keys were in the - rxkad.keytab file and in later versions they are in the KeyFile* files, - so if you are used to 1.6.x it is not obvious what is wrong. - - Reviewed-on: https://gerrit.openafs.org/13911 - Reviewed-by: Andrew Deason - Reviewed-by: Cheyenne Wills - Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit 042f809ccfe12bafed73aa4eb4db2c86737e0b22) - - Change-Id: I280d3c83b4576684f2035f79d94966bc5a174681 - Reviewed-on: https://gerrit.openafs.org/14594 - Reviewed-by: Mark Vitale - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit 07c43cb949010b32bec9c7e7769e6b7b40c871ee -Author: Cheyenne Wills -Date: Thu Jun 2 13:45:27 2022 -0600 - - autoconf: Remove/update obsolete autoconf macros - - Autoconf 2.70 (released in 2020-12) produces warning messages about - obsolete constructs by default. - - Running regen.sh with autoconf 2.70 installed produces the following - warnings: - - .. - configure.ac:7: warning: The macro `AC_CONFIG_HEADER' is obsolete. - configure.ac:21: warning: AC_PROG_LEX without either yywrap or noyywrap - is obsolete - configure.ac:21: warning: The macro `AC_HEADER_STDC' is obsolete. - configure.ac:21: warning: The macro `AC_HEADER_TIME' is obsolete. - .. - - Replace AC_CONFIG_HEADER with AC_CONFIG_HEADERS - - Add the noyywrap parameter to AC_PROG_LEX. Use the noyywrap option - since we already provide a yywrap function in the .l sources. - - Remove AC_HEADER_STDC. There are no references to the the autoconf - variable set by this macro. This macro was marked as obsolete prior to - autoconf 2.64 with the following note: - "This macro is obsolescent, as current systems have conforming header - files. New programs need not use this macro." - - AC_HEADER_TIME was marked as obsolete prior to autoconf 2.64 with the - following note: - "This macro is obsolescent, as current systems can include both files - when they exist. New programs need not use this macro." - - The only reference that requires AC_HEADER_TIME is within the external - roken code pulled from heimdal. Compiles that use the external upstream - heimdal packages result in a build error if TIME_WITH_SYS_TIME is not - defined: - building src/crypto/hcrypto - src/external/heimdal/hcrypto/camellia.c - include/roken.h:803:58: error: ‘struct tm’ declared inside - - Update autoheader.m4 so a define for TIME_WITH_SYS_TIME is created. This - avoids modifying the external heimdal/roken code. - - Reviewed-on: https://gerrit.openafs.org/14838 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 2a659ba160fbdc87a5fb4f330ffda82c1534929d) - - [cwills@sinenomine.net resolved conflict with MACOS_VERSION numbers] - - Change-Id: I1f5ed4ac66bd5bc35ef79e784e784ae2847321a2 - Reviewed-on: https://gerrit.openafs.org/14965 - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit ec106b0768dc2ce54c48bf5d9799a966ba29a0a9 -Author: Pat Riehecky -Date: Wed Sep 19 15:51:00 2018 -0500 - - configure.ac: Add missing double include guard - - This is primarily a sanity check (identified by clang-tidy). - - Reviewed-on: https://gerrit.openafs.org/13333 - Reviewed-by: Cheyenne Wills - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit ec45ae60536190c2f5fbf272a9acfe0a85824e24) - - Change-Id: I6cf42d3645fa2669971a3adcd320397afb4cf2bd - Reviewed-on: https://gerrit.openafs.org/14964 - Reviewed-by: Michael Meffie - Tested-by: BuildBot - Reviewed-by: Mark Vitale - Reviewed-by: Andrew Deason - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Stephan Wiesand - -commit f8a2aceb05914908b6a9d3e03c75e3a0c5e1a55c -Author: Cheyenne Wills -Date: Tue Dec 22 11:06:42 2020 -0700 - - afs: Cleanup afsincludes.h indentation - - Clean up the indentation of preprocessor statements - - Remove commented out code. - - Reviewed-on: https://gerrit.openafs.org/14471 - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 031ebf43a8d4db79ee1aa9aff571094354c548b1) - - Change-Id: I04c86b8ac8735ec50bf955bb418bb81ee5105afd - Reviewed-on: https://gerrit.openafs.org/14931 - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Stephan Wiesand - -commit 7a03627a64789b6c5fb44def81d4d39df3587d9d -Author: Cheyenne Wills -Date: Tue Dec 22 11:03:33 2020 -0700 - - afs: Clean up VNOPS/afs_vnops_attrs.c indentation - - Clean up the indentation of preprocessor statements, add #endif comments - where helpful. - - Clean up whitespace in code indentation. - - Reviewed-on: https://gerrit.openafs.org/14470 - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 873a5d9e8835b969370f1f031acef60745a0fff8) - - Change-Id: Ia3c41652e99c44164dec852b0f8ab2f103e8e3c1 - Reviewed-on: https://gerrit.openafs.org/14930 - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Stephan Wiesand - -commit f92508b5f7cbf9562f841d226cc9cd9f345c020b -Author: Cheyenne Wills -Date: Wed Dec 23 13:25:31 2020 -0700 - - afs: Clean up afs_init.c indentation - - Clean up the indentation of preprocessor statements, add #endif comments - where helpful. - - Clean up whitespace in code indentation. - - Reviewed-on: https://gerrit.openafs.org/14469 - Reviewed-by: Andrew Deason - Tested-by: BuildBot - Reviewed-by: Benjamin Kaduk - (cherry picked from commit d7469128ceefbd96b61f32f62fd1e11c3674dac8) - - Change-Id: Iccf5587e02b3caf0ec6725dc554255366b879d9e - Reviewed-on: https://gerrit.openafs.org/14929 - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit 97dd85ba97799fe97d424bbdbad9ced6e582ebaa -Author: Mark Vitale -Date: Sun May 10 22:13:13 2020 -0400 - - DARWIN: remove vestigial etap_event_t typedefs - - These typedefs have been present since commit - a41175cfbbf4d06ccfe14ae54bef8b7464ecd80b - "initial-darwin-support-20010327"; at least some of this material was - obtained directly from IBM after the initial code import. - - Based on research of old Darwin source code and kernel documentation, - the Event Trace Analysis Package (ETAP) was a lock-profiling interface - provided in older versions of Mach and xnu. ETAP was not enabled by - default; the kernel had to be recompiled with certain options to enable - it. Support for ETAP was removed from the xnu tree sometime between - xnu-517 (10.3 Panther) and xnu-792 (10.4 Tiger), although some - references remain in the latter under PPC support (osfmk/ppc/hw_lock.s). - All remaining references to etap_event_t disappeared when PPC support - was removed, some time between xnu-1456.1.26 (10.6 Snow Leopard) and - xnu-1699.24.8 (10.7.2 Lion). - - Therefore, it is possible that these typedefs were needed in the past by - (IBM/Transarc) AFS to support use of some lock APIs (e.g., - simple_lock_init, usimple_lock_init) after the ETAP code was withdrawn - from xnu. However, these typedefs have probably always been vestigial - for OpenAFS, because OpenAFS has never used any lock API that took - etap_event_t as an argument. - - Regardless, OpenAFS does not need these definitions to build and run on - any currently supported version of macOS. - - Remove the vestigial code. - - No functional change should be incurred by this commit. - - Reviewed-on: https://gerrit.openafs.org/14219 - Tested-by: BuildBot - Reviewed-by: Marcio Brito Barbosa - Reviewed-by: Benjamin Kaduk - (cherry picked from commit 145c90bdbeeff4ea95acacd7dc110f0c6fcba281) - - Change-Id: I96cdfe756cb8917079a7cc46d6186e69337caf0d - Reviewed-on: https://gerrit.openafs.org/14928 - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Mark Vitale - Reviewed-by: Stephan Wiesand - -commit 8db804eb1ec3f6a4b41dafff31f4805688a3da60 -Author: Andrew Deason -Date: Thu Jul 18 16:21:10 2019 -0500 - - afs: Handle osi_NewVnode failures - - Currently, code inside afs_vcache.c assumes that osi_NewVnode always - returns non-NULL, which means that osi_NewVnode must panic if it - cannot create a new vnode. - - All of the callers of afs_GetVCache, afs_NewVCache, etc, already - handle getting a NULL return, though (after all, the given fid may not - exist or be inaccessible due to network errors, etc). So, just - propagate NULL returns from osi_NewVnode up to our callers, to avoid - panics in these situations. - - Modify osi_NewVnode on many arches to return an error on allocation - failure, instead of panic'ing. - - Reviewed-on: https://gerrit.openafs.org/13701 - Reviewed-by: Benjamin Kaduk - Reviewed-by: Yadavendra Yadav - Tested-by: BuildBot - (cherry picked from commit ea9e5e8519dc486cfb019447ee5d695de104079d) - - Change-Id: I2a3c5aac44a57093caee4008b86420ed05c66eb7 - Reviewed-on: https://gerrit.openafs.org/14927 - Tested-by: BuildBot - Reviewed-by: Andrew Deason - Reviewed-by: Cheyenne Wills - Reviewed-by: Michael Meffie - Reviewed-by: Stephan Wiesand - -commit dfc2626e2aac0904c954915ed1d474030414cb78 -Author: Mark Vitale -Date: Fri Oct 5 10:39:23 2018 -0400 - - rx: remove rx_atomic bitops - - The rx_atomic bitops were introduced with commit - 1839cdbe268f4b19ac8e81ae78548f5c78e0c641 ("rx: atomic bit ops"). - - The last (only) reference to them was recently removed with commit - 5ced6025b9f11fadbdf2e092bf40cc87499ed277 ("rx: Convert rxinit_status to - rx_IsRunning()"). - - Remove the now unreferenced bitops. This commit is comprised of partial - or complete reverts of the following commits: - - ae4ad509d35 rx: fix rx_atomic warnings under Solaris (partial) - c16423ec4e6 rx: fix atomics on darwin (partial) - 9dc6dd9858a rx: Fix AIX test_and_set_bit (complete) - 1839cdbe268 rx: atomic bit ops (complete) - - Note: The rx_atomic bitops for Linux systems are known to be broken due - to incorrect casting of rx_atomic_t into the unsigned long operand - expected by the native Linux bitops. The failure modes include silent - overruns on little-endian and incorrect results on big-endian. Do not - merely revert this commit in order to bring these bitops back into the - tree. - - Reviewed-on: https://gerrit.openafs.org/13390 - Reviewed-by: Benjamin Kaduk - Tested-by: BuildBot - (cherry picked from commit d0dbd0f12119f0e874ba30adec81061ac6ae27c7) - - Change-Id: I214ec09c07fb35a4d1dbf9719ec3861bde931638 - Reviewed-on: https://gerrit.openafs.org/14926 - Tested-by: BuildBot - Reviewed-by: Cheyenne Wills Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand diff --git a/RELNOTES-1.8.10 b/RELNOTES-1.8.10 new file mode 100644 index 0000000..5f1e8db --- /dev/null +++ b/RELNOTES-1.8.10 @@ -0,0 +1,65 @@ + User-Visible OpenAFS Changes + +OpenAFS 1.8.10 + + All platforms + + * Improved error messages and diagnostics (15302 15313) + + * Fixes for parallel or out of tree builds (15297..9) + + * Fixed "make clean" to remove several artifacts overlooked in the past + (15377) + + * Fixed the autoconf check for ncurses to catch libs built with + "--enable-reentrant" (15296) + + * Removed the obsolete kdump debugging tool (15315) + + * Avoid some more possible string buffer overflows (15240) + + All client platforms + + * Take the readonly volume offline during "vos convertROtoRW" (15233) + + * Updated the CellServDB to the latest version from grand.central.org + (15323) + + All UNIX/Linux client platforms + + * Trim trailing slashes from paths given to "fs lsmount" and + "fs flushmount" (15242) + + * Provide the "-literal" option for the "fs getfid" command, which allows + querying a symlink or mount point rather than the object pointed to + (15235) + + * Avoid some potential kernel panics (15295 15324 15331) + + AIX + + * Improved support for this platform, including releases 7.1, 7.2 and 7.3 + (15309 15368..76 15378..86 15403 15422 15424..5 15441..2) + + macOS + * Added support for Apple Silicon and macOS releases up to 13 ("Ventura") + (15246 15250..1 15254 15258..64) + + * Fixes around signing and notarization of the OpenAFS packages (15255..7) + + * Build "afscell" on supported platforms, and only those (15247) + + Linux + + * Support building for newer distributions and compilers (15266..71 + 15273..5 15277) + + Linux clients + + * Support mainline kernels up to 6.4 and distribution kernels + derived from those (15228 15281 15388..9 15410..11) + + * Fixes and enhancements around the kernel module build (15229..31 15265) + + * Fixed potential cache inconsistencies for symbolic link metadata (15443) + diff --git a/RELNOTES-1.8.9 b/RELNOTES-1.8.9 deleted file mode 100644 index 82354ad..0000000 --- a/RELNOTES-1.8.9 +++ /dev/null @@ -1,69 +0,0 @@ - User-Visible OpenAFS Changes - -OpenAFS 1.8.9 - - All platforms - - * Support for building with more recent compilers (14970 14982..14987 - 14990 14991 15056 15057 15061..15064) - - * Build fixes and improvements around the test suite (14879 14880 - 14909..14911 15133) - - * Removed a vestigial autoconf check for GSSAPI support that could - cause unnecessary configure errors (15137) - - * Documentation improvements (14980 15047) - - * Improved diagnostics and error messages. In particular, warn when - server processes are started without keys and properly print the - volume transaction flags in "vos status" output (14594 14968) - - All server platforms - - * Avoid several second delays in some situations when the file server - is breaking callbacks on clients with alternate addresses. Avoid - unnecessary several second delays in some cases during database - quorum processing (14815) - - * Detect invalid (negative) inputs to FetchData RPCs and reject them - early. The previous behavior only detected the error when actually - attempting to read from storage, which resulted in the volume being - taken offline since errors were assumed to originate from the - underlying storage (15224) - - All UNIX/Linux client platforms - - * Do not perform DNS SRV/AFSDB record queries when running "fs - getcellstatus", "fs checkservers", and "fs setcell". The DNS - lookups incur network delays and were not needed to process these - commands. (14814) - - * Avoid possible string buffer overflows with long cell names (15151) - - FreeBSD - - * Added support for release 12.3 and further improvements (14878 - 14920 14921) - - Linux clients - - * Support mainline kernels up to 6.0 (14942..14944 14989 14945 - 14946 15058 15065 15094 15095 15148) - - * Fixed a potential memory leak (15096) - - * Avoid a possible performance penalty during file reads when - the file was opened for both reading and writing (15129) - - * Fixed a type cast which could make builds fail against older kernels - (15134) - - * In Red Hat packaging, systemd will no longer load the openafs module - during boot (15128) - - Most client platforms - - * Handle certain failure conditions rather than panicking the system - (14927 15052) - diff --git a/b885159.diff b/b885159.diff deleted file mode 100644 index 9df8d37..0000000 --- a/b885159.diff +++ /dev/null @@ -1,83 +0,0 @@ -From b885159cc2bc6c746aec1d54cdd8a515d1115d14 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Wed, 14 Dec 2022 13:40:48 -0700 -Subject: [PATCH] Linux: Replace lru_cache_add with folio_add_lru - -The Linux 6.2 commit: - "folio-compat: remove lru_cache_add()" (6e1ca48d0) -removed the lru_cache_add() function (which was introduced in Linux 5.8) - -The replacement function is folio_add_lru(), which was introduced with -the Linux 5.16 commit: - "mm/lru: Add folio_add_lru()" (0d31125d2d) - -Reviewed-on: https://gerrit.openafs.org/15227 -Reviewed-by: Benjamin Kaduk -Tested-by: Benjamin Kaduk -(cherry picked from commit cfac0df9cd7152be2672c665442aac84215494d6) - -Change-Id: I74535bf83cdd47c9dd60a7114ec7694ae9981c9b -Reviewed-on: https://gerrit.openafs.org/15281 -Reviewed-by: Andrew Deason -Tested-by: BuildBot -Reviewed-by: Michael Meffie -Reviewed-by: Stephan Wiesand ---- - -diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c -index 5ff3a16..d875788 100644 ---- a/src/afs/LINUX/osi_vnodeops.c -+++ b/src/afs/LINUX/osi_vnodeops.c -@@ -32,7 +32,7 @@ - #endif - #include - #include --#if defined(HAVE_LINUX_LRU_CACHE_ADD_FILE) -+#if defined(HAVE_LINUX_FOLIO_ADD_LRU) || defined(HAVE_LINUX_LRU_CACHE_ADD_FILE) - # include - #else - # include -@@ -78,7 +78,8 @@ - - /* Handle interfacing with Linux's pagevec/lru facilities */ - --#if defined(HAVE_LINUX_LRU_CACHE_ADD_FILE) || defined(HAVE_LINUX_LRU_CACHE_ADD) -+#if defined(HAVE_LINUX_FOLIO_ADD_LRU) || \ -+ defined(HAVE_LINUX_LRU_CACHE_ADD_FILE) || defined(HAVE_LINUX_LRU_CACHE_ADD) - - /* - * Linux's lru_cache_add_file provides a simplified LRU interface without -@@ -97,7 +98,10 @@ - static inline void - afs_lru_cache_add(struct afs_lru_pages *alrupages, struct page *page) - { --# if defined(HAVE_LINUX_LRU_CACHE_ADD) -+# if defined(HAVE_LINUX_FOLIO_ADD_LRU) -+ struct folio *folio = page_folio(page); -+ folio_add_lru(folio); -+# elif defined(HAVE_LINUX_LRU_CACHE_ADD) - lru_cache_add(page); - # elif defined(HAVE_LINUX_LRU_CACHE_ADD_FILE) - lru_cache_add_file(page); -diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 -index 504c731..a53c186 100644 ---- a/src/cf/linux-kernel-func.m4 -+++ b/src/cf/linux-kernel-func.m4 -@@ -173,10 +173,17 @@ - - dnl lru_cache_add exported in Linux 5.8 - dnl replaces lru_cache_add_file -+dnl removed in linux 6.1. folio_add_lru is a replacement - AC_CHECK_LINUX_FUNC([lru_cache_add], - [#include ], - [lru_cache_add(NULL);]) - -+dnl Linux 5.16 added folio_add_lru as a replacement for -+dnl lru_cache_add -+AC_CHECK_LINUX_FUNC([folio_add_lru], -+ [#include ], -+ [folio_add_lru(NULL);]) -+ - dnl Linux 5.8 replaced kernel_setsockopt with helper functions - dnl e.g. ip_sock_set_mtu_discover, ip_sock_set_recverr - AC_CHECK_LINUX_FUNC([ip_sock_set], diff --git a/f6fbb85.diff b/f6fbb85.diff deleted file mode 100644 index b7e90f5..0000000 --- a/f6fbb85.diff +++ /dev/null @@ -1,274 +0,0 @@ -From f6fbb85c00411bf97e9855be73baf49bd6b061d7 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills -Date: Wed, 29 Mar 2023 12:11:38 -0600 -Subject: [PATCH] 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 -Tested-by: BuildBot -Reviewed-by: Cheyenne Wills -Reviewed-by: Benjamin Kaduk -(cherry picked from commit 858ee34545e57acab1e4e5813cd1b9a011538b9e) - -Change-Id: If89c6f401db04826ef45de83b91240f106cca616 -Reviewed-on: https://gerrit.openafs.org/15389 -Tested-by: BuildBot -Reviewed-by: Andrew Deason -Reviewed-by: Mark Vitale -Reviewed-by: Michael Meffie -Reviewed-by: Kailas Zadbuke -Reviewed-by: Stephan Wiesand ---- - -diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h -index 808c608..bb4969c 100644 ---- a/src/afs/LINUX/osi_compat.h -+++ b/src/afs/LINUX/osi_compat.h -@@ -534,7 +534,9 @@ - - int code = 0; - struct inode *inode = OSIFILE_INODE(afile); --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+ code = inode->i_op->setattr(afs_mnt_idmap, afile->filp->f_dentry, newattrs); -+#elif defined(IOP_TAKES_USER_NAMESPACE) - code = inode->i_op->setattr(afs_ns, afile->filp->f_dentry, newattrs); - #elif !defined(HAVE_LINUX_INODE_SETATTR) - code = inode->i_op->setattr(afile->filp->f_dentry, newattrs); -@@ -763,7 +765,9 @@ - static inline int - afs_setattr_prepare(struct dentry *dp, struct iattr *newattrs) - { --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+ return setattr_prepare(afs_mnt_idmap, dp, newattrs); -+#elif defined(IOP_TAKES_USER_NAMESPACE) - return setattr_prepare(afs_ns, dp, newattrs); - #elif defined(HAVE_LINUX_SETATTR_PREPARE) - return setattr_prepare(dp, newattrs); -diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h -index 34940c6..2220e05 100644 ---- a/src/afs/LINUX/osi_machdep.h -+++ b/src/afs/LINUX/osi_machdep.h -@@ -217,6 +217,10 @@ - # define afs_current_user_ns() ((struct user_namespace *)NULL) - # endif - -+#if defined(IOP_TAKES_MNT_IDMAP) -+extern struct mnt_idmap *afs_mnt_idmap; -+#endif -+ - static inline kuid_t afs_make_kuid(uid_t uid) { - return make_kuid(afs_ns, uid); - } -diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c -index 79ba57c..fdc347d 100644 ---- a/src/afs/LINUX/osi_module.c -+++ b/src/afs/LINUX/osi_module.c -@@ -31,6 +31,10 @@ - #include - #include - -+#if defined(IOP_TAKES_MNT_IDMAP) -+# include -+#endif -+ - #include "osi_pagecopy.h" - - extern struct file_system_type afs_fs_type; -@@ -46,6 +50,20 @@ - struct user_namespace *afs_ns; - #endif - -+#if defined(IOP_TAKES_MNT_IDMAP) -+struct mnt_idmap *afs_mnt_idmap; -+ -+static void -+afs_init_idmap(void) -+{ -+ struct path fs_root; -+ -+ get_fs_root(current->fs, &fs_root); -+ afs_mnt_idmap = mnt_idmap(fs_root.mnt); -+ path_put(&fs_root); -+} -+#endif -+ - int __init - afs_init(void) - { -@@ -55,6 +73,10 @@ - afs_ns = afs_current_user_ns(); - #endif - -+#if defined(IOP_TAKES_MNT_IDMAP) -+ afs_init_idmap(); -+#endif -+ - osi_Init(); - - /* Initialize CellLRU since it is used while traversing CellServDB proc -diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c -index d875788..2c5439d 100644 ---- a/src/afs/LINUX/osi_vnodeops.c -+++ b/src/afs/LINUX/osi_vnodeops.c -@@ -1146,7 +1146,10 @@ - * Linux version of setattr call. What to change is in the iattr struct. - * We need to set bits in both the Linux inode as well as the vcache. - */ --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+static int -+afs_notify_change(struct mnt_idmap *idmap, struct dentry *dp, struct iattr *iattrp) -+#elif defined(IOP_TAKES_USER_NAMESPACE) - static int - afs_notify_change(struct user_namespace *mnt_userns, struct dentry *dp, struct iattr *iattrp) - #else -@@ -1180,7 +1183,18 @@ - return afs_convert_code(code); - } - --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+static int -+afs_linux_getattr(struct mnt_idmap *idmap, const struct path *path, struct kstat *stat, -+ u32 request_mask, unsigned int sync_mode) -+{ -+ int err = afs_linux_revalidate(path->dentry); -+ if (!err) { -+ generic_fillattr(afs_mnt_idmap, path->dentry->d_inode, stat); -+ } -+ return err; -+} -+#elif defined(IOP_TAKES_USER_NAMESPACE) - static int - afs_linux_getattr(struct user_namespace *mnt_userns, const struct path *path, struct kstat *stat, - u32 request_mask, unsigned int sync_mode) -@@ -1661,7 +1675,11 @@ - * name is in kernel space at this point. - */ - --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+static int -+afs_linux_create(struct mnt_idmap *idmap, struct inode *dip, -+ struct dentry *dp, umode_t mode, bool excl) -+#elif defined(IOP_TAKES_USER_NAMESPACE) - static int - afs_linux_create(struct user_namespace *mnt_userns, struct inode *dip, - struct dentry *dp, umode_t mode, bool excl) -@@ -1953,7 +1971,11 @@ - } - - --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+static int -+afs_linux_symlink(struct mnt_idmap *idmap, struct inode *dip, -+ struct dentry *dp, const char *target) -+#elif defined(IOP_TAKES_USER_NAMESPACE) - static int - afs_linux_symlink(struct user_namespace *mnt_userns, struct inode *dip, - struct dentry *dp, const char *target) -@@ -1988,7 +2010,11 @@ - return afs_convert_code(code); - } - --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+static int -+afs_linux_mkdir(struct mnt_idmap *idmap, struct inode *dip, -+ struct dentry *dp, umode_t mode) -+#elif defined(IOP_TAKES_USER_NAMESPACE) - static int - afs_linux_mkdir(struct user_namespace *mnt_userns, struct inode *dip, - struct dentry *dp, umode_t mode) -@@ -2068,7 +2094,13 @@ - } - - --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+static int -+afs_linux_rename(struct mnt_idmap *idmap, -+ struct inode *oldip, struct dentry *olddp, -+ struct inode *newip, struct dentry *newdp, -+ unsigned int flags) -+#elif defined(IOP_TAKES_USER_NAMESPACE) - static int - afs_linux_rename(struct user_namespace *mnt_userns, - struct inode *oldip, struct dentry *olddp, -@@ -2092,7 +2124,7 @@ - struct dentry *rehash = NULL; - - #if defined(HAVE_LINUX_INODE_OPERATIONS_RENAME_TAKES_FLAGS) || \ -- defined(IOP_TAKES_USER_NAMESPACE) -+ defined(IOP_TAKES_MNT_IDMAP) || defined(IOP_TAKES_USER_NAMESPACE) - if (flags) - return -EINVAL; /* no support for new flags yet */ - #endif -@@ -3388,7 +3420,10 @@ - * Check access rights - returns error if can't check or permission denied. - */ - --#if defined(IOP_TAKES_USER_NAMESPACE) -+#if defined(IOP_TAKES_MNT_IDMAP) -+static int -+afs_linux_permission(struct mnt_idmap *idmap, struct inode *ip, int mode) -+#elif defined(IOP_TAKES_USER_NAMESPACE) - static int - afs_linux_permission(struct user_namespace *mnt_userns, struct inode *ip, int mode) - #elif defined(IOP_PERMISSION_TAKES_FLAGS) -diff --git a/src/cf/linux-kernel-sig.m4 b/src/cf/linux-kernel-sig.m4 -index e0cc9a2..5301f35 100644 ---- a/src/cf/linux-kernel-sig.m4 -+++ b/src/cf/linux-kernel-sig.m4 -@@ -28,4 +28,17 @@ - AS_IF([test AS_VAR_GET([ac_cv_linux_operation_inode_operations_create_user_namespace]) = yes], - [AC_DEFINE([IOP_TAKES_USER_NAMESPACE], 1, - [define if inodeops require struct user_namespace])]) -+dnl Linux 6.3 replaced the user_namespace parameter with mnt_idmap for -+dnl the inode operations functions. -+AC_CHECK_LINUX_OPERATION([inode_operations], [create], [mnt_idmap], -+ [#include ], -+ [int], -+ [struct mnt_idmap *idmap, -+ struct inode *inode, struct dentry *dentry, -+ umode_t umode, bool flag]) -+dnl if HAVE_LINUX_INODE_OPERATIONS_CREATE_MNT_IDMAP, create a more generic -+dnl define. -+AS_IF([test AS_VAR_GET([ac_cv_linux_operation_inode_operations_create_mnt_idmap]) = yes], -+ [AC_DEFINE([IOP_TAKES_MNT_IDMAP], 1, -+ [define if inodeops require struct mnt_idmap])]) - ]) -\ No newline at end of file diff --git a/openafs-1.8.10-doc.tar.bz2 b/openafs-1.8.10-doc.tar.bz2 new file mode 100644 index 0000000..1de5b9a --- /dev/null +++ b/openafs-1.8.10-doc.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c3809e8afea017d8af2528f60cf0e0f9fa8454fac86533a3e67221f2eb5fb5d +size 3770320 diff --git a/openafs-1.8.10-doc.tar.bz2.md5 b/openafs-1.8.10-doc.tar.bz2.md5 new file mode 100644 index 0000000..ff9b585 --- /dev/null +++ b/openafs-1.8.10-doc.tar.bz2.md5 @@ -0,0 +1 @@ +b7c71e48198ab210a5be0bb40fcdda1d openafs-1.8.10-doc.tar.bz2 diff --git a/openafs-1.8.10-doc.tar.bz2.sha256 b/openafs-1.8.10-doc.tar.bz2.sha256 new file mode 100644 index 0000000..23bacc9 --- /dev/null +++ b/openafs-1.8.10-doc.tar.bz2.sha256 @@ -0,0 +1 @@ +9c3809e8afea017d8af2528f60cf0e0f9fa8454fac86533a3e67221f2eb5fb5d openafs-1.8.10-doc.tar.bz2 diff --git a/openafs-1.8.10-src.tar.bz2 b/openafs-1.8.10-src.tar.bz2 new file mode 100644 index 0000000..b990e01 --- /dev/null +++ b/openafs-1.8.10-src.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9fec11364623549e8db7374072f5c8f01b841f6bfe7e85673cbce35ff43ffb07 +size 14845228 diff --git a/openafs-1.8.10-src.tar.bz2.md5 b/openafs-1.8.10-src.tar.bz2.md5 new file mode 100644 index 0000000..4f2642f --- /dev/null +++ b/openafs-1.8.10-src.tar.bz2.md5 @@ -0,0 +1 @@ +9e8676d04ff3d95d60eaee5e7429a6bb openafs-1.8.10-src.tar.bz2 diff --git a/openafs-1.8.10-src.tar.bz2.sha256 b/openafs-1.8.10-src.tar.bz2.sha256 new file mode 100644 index 0000000..90a1c25 --- /dev/null +++ b/openafs-1.8.10-src.tar.bz2.sha256 @@ -0,0 +1 @@ +9fec11364623549e8db7374072f5c8f01b841f6bfe7e85673cbce35ff43ffb07 openafs-1.8.10-src.tar.bz2 diff --git a/openafs-1.8.9-doc.tar.bz2 b/openafs-1.8.9-doc.tar.bz2 deleted file mode 100644 index b9ec961..0000000 --- a/openafs-1.8.9-doc.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ef91e854eab4aa74268525954a41c2a2ad0a2eaf530eaa22bb9e4bf453b15939 -size 3771797 diff --git a/openafs-1.8.9-doc.tar.bz2.md5 b/openafs-1.8.9-doc.tar.bz2.md5 deleted file mode 100644 index 3b8e29c..0000000 --- a/openafs-1.8.9-doc.tar.bz2.md5 +++ /dev/null @@ -1 +0,0 @@ -1f59a2942007bac5c7a8b83360852e29 openafs-1.8.9-doc.tar.bz2 diff --git a/openafs-1.8.9-doc.tar.bz2.sha256 b/openafs-1.8.9-doc.tar.bz2.sha256 deleted file mode 100644 index cdc1b7e..0000000 --- a/openafs-1.8.9-doc.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -ef91e854eab4aa74268525954a41c2a2ad0a2eaf530eaa22bb9e4bf453b15939 openafs-1.8.9-doc.tar.bz2 diff --git a/openafs-1.8.9-src.tar.bz2 b/openafs-1.8.9-src.tar.bz2 deleted file mode 100644 index 42f789a..0000000 --- a/openafs-1.8.9-src.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d126178be1f42cca18cb7c0c2691ac354518e3790170150a76bbd25f4d151f06 -size 14875192 diff --git a/openafs-1.8.9-src.tar.bz2.md5 b/openafs-1.8.9-src.tar.bz2.md5 deleted file mode 100644 index a7585ef..0000000 --- a/openafs-1.8.9-src.tar.bz2.md5 +++ /dev/null @@ -1 +0,0 @@ -b48ac2fdeffc2005b78e255c67ac43ba openafs-1.8.9-src.tar.bz2 diff --git a/openafs-1.8.9-src.tar.bz2.sha256 b/openafs-1.8.9-src.tar.bz2.sha256 deleted file mode 100644 index fbcca19..0000000 --- a/openafs-1.8.9-src.tar.bz2.sha256 +++ /dev/null @@ -1 +0,0 @@ -d126178be1f42cca18cb7c0c2691ac354518e3790170150a76bbd25f4d151f06 openafs-1.8.9-src.tar.bz2 diff --git a/openafs.changes b/openafs.changes index 6d88b37..070c78c 100644 --- a/openafs.changes +++ b/openafs.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Jul 10 10:24:31 UTC 2023 - Christof Hanke + +- update to official openafs-1.8.10 +- remove obsolete patches: + * 7a3ad3bc.diff + * b885159.diff + * f6fbb85.diff + * 4cf7a9a.diff + ------------------------------------------------------------------- Tue May 30 12:21:37 UTC 2023 - Christof Hanke diff --git a/openafs.spec b/openafs.spec index b71c07c..0760341 100644 --- a/openafs.spec +++ b/openafs.spec @@ -57,11 +57,11 @@ # used for %setup only # leave upstream tar-balls untouched for integrity checks. -%define upstream_version 1.8.9 +%define upstream_version 1.8.10 Name: openafs -Version: 1.8.9 +Version: 1.8.10 Release: 0 Summary: OpenAFS Distributed File System License: IPL-1.0 @@ -103,14 +103,6 @@ Source58: openafs.cacheinfo Source98: kmp_only.files Source99: openafs.changes -# PATCH-FIX-UPSTREAM fix build with kernel 6.2 -Patch1: b885159.diff -# PATCH-FIX-UPSTREAM fix build with kernel 6.3 -Patch2: f6fbb85.diff -Patch3: 7a3ad3bc.diff -# PATCH-FIX-UPSTREAM make configure detect ncurses 6 correctly -Patch4: 4cf7a9a.diff - # GENERAL BuildRequires and Requires # @@ -320,10 +312,6 @@ for src_file in %{S:0} %{S:1}; do done %setup -q -n openafs-%{upstream_version} -T -b 0 -b 1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 ./regen.sh @@ -367,7 +355,6 @@ export afslogsdir='/var/log/openafs' export afsdbdir='/var/lib/openafs/db' %configure \ --disable-transarc-paths \ - --disable-pam \ --disable-strip-binaries \ --includedir=%{_includedir}/openafs \ --sysconfdir=%{_sysconfdir} \