diff options
36 files changed, 3585 insertions, 880 deletions
@@ -1,34 +1,81 @@ pkgbase = openafs-modules-dkms pkgdesc = Kernel module for OpenAFS (dkms) - pkgver = 1.8.7 + pkgver = 1.8.11 pkgrel = 1 url = http://www.openafs.org arch = i686 arch = x86_64 arch = armv7h - license = custom:"IBM Public License Version 1.0" + license = IPL-1.0 depends = dkms depends = libelf depends = openafs - provides = openafs-modules=1.8.7 + provides = openafs-modules=1.8.11 conflicts = openafs-features-libafs conflicts = openafs-modules conflicts = openafs<1.6.6-2 options = !emptydirs - source = http://openafs.org/dl/openafs/1.8.7/openafs-1.8.7-src.tar.bz2 + source = http://openafs.org/dl/openafs/1.8.11/openafs-1.8.11-src.tar.bz2 + source = 0001-afs-Make-afs_AllocDCache-static.patch + source = 0002-LINUX-Minor-osi_vfsop.c-cleanup.patch + source = 0003-afs-Remove-SRXAFSCB_GetDE.patch + source = 0004-afs-remove-dead-ICL-fstrace-code.patch + source = 0005-cf-Add-function-prototypes-for-linux-conftest.patch + source = 0006-afs-Remove-DFlushDCache.patch + source = 0007-afs-Remove-afs_MemExtendEntry.patch + source = 0008-afs-Remove-afs_osi_UnmaskUserLoop.patch + source = 0009-afs-Remove-dummy_PSetAcl.patch + source = 0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch + source = 0011-afs-Remove-afs_DbgDisconFiles.patch + source = 0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch + source = 0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch + source = 0014-Linux-6.8-Add-function-prototypes-for-krb5.patch + source = 0015-afs-Declare-init_hckernel_mutex.patch + source = 0016-afs-Add-includes-to-pick-up-function-prototypes.patch + source = 0017-afs-Move-function-prototypes-into-headers.patch + source = 0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch + source = 0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch + source = 0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch + source = 0021-afs-fix-ops-variable-may-be-used-uninitialized.patch + source = 0022-afs-Add-static-attribute-to-internal-functions.patch + source = 0023-rx-Add-static-attribute-to-internal-functions.patch + source = 0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch + source = 0025-rxgen-Declare-generated-PKG_OpCodeStats.patch + source = 0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch + source = 0027-Linux-6.8-Remove-ctl_table-sentinels.patch + source = 0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch + source = 0029-afs-Drop-GLOCK-for-various-Rx-calls.patch source = dkms.conf - source = 0001-Avoid-duplicate-definitions-of-globals.patch - source = 0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch - source = 0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch - source = 0004-LINUX-5.8-use-lru_cache_add.patch - source = 0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch - sha256sums = 53543a561fce67714fec9f2a6bf408c5cc1d061c7dc9d1459458275e8ccbfa79 + sha256sums = e2efb4710996b7d23198b53c56295a8f9e24e8a555317c5fc63b8125a3714ecd + sha256sums = e85f5656f76700e4236b1033cf4b7f08c59ab757d52d2a67dcb2c65762388733 + sha256sums = 8d48b727e77b1e952310ad9f94bd4ece9e64e1f03a35463bb23dffa1009738d8 + sha256sums = c44c91e31df1ec77f1a39eb7b172c4e348e41b293ae05606288bfe333ad7c29b + sha256sums = 48dd1065f8bcb90d0bdc7ae5b484da5a1a5d93461f6ac1d6ceef103d2b807f22 + sha256sums = ce054eadb9c84173b0bd1318ef88cb9500049431779252e501491d9389141bad + sha256sums = ae525167f5f6f7e0301eee70b3424e51e45e56e9fe9588b95cf72d5fa96717b9 + sha256sums = 974861c174969591351c5fb4a47946e02f979c2b5590f89d9d16dfbe4238451f + sha256sums = e5d72b5e08c63df10299b56bfebf3c5c44e07d16c0436fb2c0eef3614ad505e3 + sha256sums = 8143496d251dd1f13b8603b4e692fbd67f925caccd12035598e70542d24389f5 + sha256sums = 216e684f8181adc4a4b3c4ba934997cada10831c5608e724e91d09e836ec626d + sha256sums = 2e573535da21f8be5b83c8e82166c0bdc5896293b28e793fa4c1bdb9ff942dbd + sha256sums = 0535fbdd3c8431b7b16842f1fa6592355f647ae456112e97d34d541e74204be5 + sha256sums = 7aacef8bd6832f119472f7d52af36951a56f1e54d36d9bce59998fcf818517e5 + sha256sums = 3db5177c80a7694c1be3b74f419570a5076edc519b40112cf17e68fecc7574a3 + sha256sums = 9fe647d54c999e358597fe671dc7e88da609a69bb93624e15919d9b4cc4fdb5a + sha256sums = 7ced2ca2d4f54b2fa15c584869de122810ee0d1b024d1bf541f38d77172e311c + sha256sums = c88c8b8e1c993da773eea3ae4f17e5171189ed7e1fc5769fdb49d82cae0cffd3 + sha256sums = c57c826c9f26568241bcb17eff04067a1b5e388f72523765aa80d480c3690325 + sha256sums = d508dd6136170fcb4794e283178f9c5f4ede12f415b882ba7c13470e8f09bdde + sha256sums = 894eb7e7889749cefa9cbf86e2eceda470d20510a5a7a5be2cd851f8570e076c + sha256sums = fb36b0ef833811910cae42d8411a00dcf2aff08c8799f766e32cda3ad5a7f0e2 + sha256sums = d08d38ff53890632900de5d69dc105711d5bce2d02a55ffe70c87b38ca39aca7 + sha256sums = db700b5f62e979af60856278306e8fce6df21dfb24996dd0d690c82222f4d793 + sha256sums = 46294f8323bf71ee96c8f765bb36fc5e0af6b2257deac7eaea4f4cb9568d9fe1 + sha256sums = 5d4a2614065046a32ef805198349e70476d3ed9e079a4ef7577e71e0dac1d2fa + sha256sums = 4c8201265f558bac146bf8cee38f8c925b2c2262133ae88d9eb2f0623a0ada07 + sha256sums = ceb02a7a5e596434215693f065ad6221f568f85aab173df4752248d2c4d8f971 + sha256sums = 2b05242c5516871191a251a617c6c02e80f34b92b6cfeb0c9c6a1f3e0ff915d9 + sha256sums = 82b197ac5f2639d891c8a646963ef6b87ef4171c7a70ac6ca7a9a55511090952 sha256sums = 5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0 - sha256sums = 18634d85ca4dec3366533a2767e652dab27202667de1d04f578f40a94d8ec15a - sha256sums = 4b9d269e2b3c214f9240917b9d895b41e09c1afdbef75e30a0db02a240bf9b0e - sha256sums = 9e630d2029c113f482c321007522ce887273250c4125aa6fee1229aa78e8f8c3 - sha256sums = 6deaa098e7e6113c426d9449c5b6252c76dfbe4a67705420215ae501de8e9f0d - sha256sums = 3a0a022a8a4cb1034e60dec9c55727e1be846080f5923a7edcc7e18fe6b57606 pkgname = openafs-modules-dkms - diff --git a/0001-Avoid-duplicate-definitions-of-globals.patch b/0001-Avoid-duplicate-definitions-of-globals.patch deleted file mode 100644 index a2f77c7e0ed3..000000000000 --- a/0001-Avoid-duplicate-definitions-of-globals.patch +++ /dev/null @@ -1,353 +0,0 @@ -From ac4debb46bc0b95ff2f98d416703bc8df60b8415 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills <cwills@sinenomine.net> -Date: Fri, 22 May 2020 12:16:48 -0600 -Subject: [PATCH 1/5] Avoid duplicate definitions of globals - -GCC 10 changed a default flag from -fcommon to -fno-common. See -https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85678 for some background. - -The change in gcc 10 results in build link-time errors. For example: - ../../src/xstat/.libs/liboafs_xstat_cm.a(xstat_cm.o):(.bss+0x2050): - multiple definition of `numCollections'; - -Ensure that only one definition for global data objects exist and change -references to use "extern" as needed. - -To ensure that future changes do not introduce duplicated global -definitions, add the -fno-common flag to XCFLAGS when using the -configure --enable-checking setting. - -[cwills@sinenomine.net: Note for 1.8.x: renamed terminationEvent -to cm_terminationEvent/fs_terminationEvent instead of deleting it.] - -Reviewed-on: https://gerrit.openafs.org/14106 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Andrew Deason <adeason@sinenomine.net> -Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> -(cherry picked from commit 0e2072ae386d4111bef161eb955964b649c31386) - -Change-Id: I54ca61d372cf763e4a28c0b0829ea361219f6203 -Reviewed-on: https://gerrit.openafs.org/14217 -Reviewed-by: Andrew Deason <adeason@sinenomine.net> -Reviewed-by: Mark Vitale <mvitale@sinenomine.net> -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> ---- - src/bucoord/main.c | 6 ++---- - src/butc/dbentries.c | 2 +- - src/butc/dump.c | 7 +++---- - src/butc/lwps.c | 2 +- - src/butc/tcmain.c | 2 +- - src/cf/osconf.m4 | 2 +- - src/fsprobe/fsprobe.h | 1 - - src/uss/uss_vol.c | 2 +- - src/viced/host.c | 2 ++ - src/viced/host.h | 2 +- - src/vol/fssync-server.c | 3 --- - src/vol/volume.c | 3 --- - src/xstat/xstat_cm.c | 7 +++---- - src/xstat/xstat_cm.h | 3 +-- - src/xstat/xstat_cm_test.c | 4 ++-- - src/xstat/xstat_fs.c | 7 +++---- - src/xstat/xstat_fs.h | 3 +-- - src/xstat/xstat_fs_test.c | 4 ++-- - 18 files changed, 25 insertions(+), 37 deletions(-) - -diff --git a/src/bucoord/main.c b/src/bucoord/main.c -index d2a5f368b..a453cc9dd 100644 ---- a/src/bucoord/main.c -+++ b/src/bucoord/main.c -@@ -47,9 +47,9 @@ char tcell[64]; - /* - * Global configuration information for the Backup Coordinator. - */ --struct bc_config *bc_globalConfig; /*Ptr to global BC configuration info */ -+extern struct bc_config *bc_globalConfig; /*Ptr to global BC configuration info */ - --struct ubik_client *cstruct; /* Ptr to Ubik client structure */ -+extern struct ubik_client *cstruct; /* Ptr to Ubik client structure */ - time_t tokenExpires; /* The token's expiration time */ - - static const char *DefaultConfDir; /*Default backup config directory */ -@@ -162,8 +162,6 @@ bc_InitTextConfig(void) - udbClientTextP ctPtr; - int i; - -- extern struct bc_config *bc_globalConfig; -- - mkdir(DefaultConfDir, 777); /* temporary */ - - /* initialize the client text structures */ -diff --git a/src/butc/dbentries.c b/src/butc/dbentries.c -index 37b35d307..29ddcbd01 100644 ---- a/src/butc/dbentries.c -+++ b/src/butc/dbentries.c -@@ -31,7 +31,7 @@ - #include "error_macros.h" - - dlqlinkT savedEntries; --dlqlinkT entries_to_flush; -+static dlqlinkT entries_to_flush; - - int dbWatcherinprogress; - -diff --git a/src/butc/dump.c b/src/butc/dump.c -index 1f4eb9b8f..f8fc943a6 100644 ---- a/src/butc/dump.c -+++ b/src/butc/dump.c -@@ -42,8 +42,7 @@ extern int isafile; - extern int forcemultiple; - - extern struct ubik_client *cstruct; --dlqlinkT savedEntries; --dlqlinkT entries_to_flush; -+extern dlqlinkT savedEntries; - - extern afs_int32 groupId; - extern afs_int32 BufferSize; -@@ -61,8 +60,8 @@ extern char *xbsalGName; - extern char *globalButcLog; - #endif /*xbsa */ - --afs_int32 dataSize; /* Size of data to read on each rx_Read() call */ --afs_int32 tapeblocks; /* Number of 16K tape datablocks in buffer (!CONF_XBSA) */ -+extern afs_int32 dataSize; /* Size of data to read on each rx_Read() call */ -+extern afs_int32 tapeblocks; /* Number of 16K tape datablocks in buffer (!CONF_XBSA) */ - - /* TBD - * -diff --git a/src/butc/lwps.c b/src/butc/lwps.c -index d262991d8..aff5e9e07 100644 ---- a/src/butc/lwps.c -+++ b/src/butc/lwps.c -@@ -51,7 +51,7 @@ extern int forcemultiple; - #endif - - /* XBSA Global Parameters */ --afs_int32 xbsaType; -+extern afs_int32 xbsaType; - #ifdef xbsa - struct butx_transactionInfo butxInfo; - #endif -diff --git a/src/butc/tcmain.c b/src/butc/tcmain.c -index e8a20938e..a0298addb 100644 ---- a/src/butc/tcmain.c -+++ b/src/butc/tcmain.c -@@ -66,7 +66,7 @@ - #define TL_PREFIX "TL" - #define CFG_PREFIX "CFG" - --struct ubik_client *cstruct; -+extern struct ubik_client *cstruct; - FILE *logIO, *ErrorlogIO, *centralLogIO, *lastLogIO; - char lFile[AFSDIR_PATH_MAX]; - char logFile[AFSDIR_PATH_MAX + 256]; -diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 -index 5f0d73fc2..e36152bd4 100644 ---- a/src/cf/osconf.m4 -+++ b/src/cf/osconf.m4 -@@ -672,7 +672,7 @@ if test "x$GCC" = "xyes"; then - XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Wpointer-arith" - fi - if test "x$enable_checking" != "xno"; then -- XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith" -+ XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith -fno-common" - if test "x$enable_checking" != "xall"; then - CFLAGS_NOERROR="-Wno-error" - CFLAGS_NOUNUSED="-Wno-unused" -diff --git a/src/fsprobe/fsprobe.h b/src/fsprobe/fsprobe.h -index 94083bfe9..3060371ae 100644 ---- a/src/fsprobe/fsprobe.h -+++ b/src/fsprobe/fsprobe.h -@@ -103,7 +103,6 @@ struct fsprobe_ProbeResults { - - extern int fsprobe_numServers; /*# servers connected */ - extern struct fsprobe_ConnectionInfo *fsprobe_ConnInfo; /*Ptr to connections */ --extern int numCollections; /*Num data collections */ - extern struct fsprobe_ProbeResults fsprobe_Results; /*Latest probe results */ - - extern int fsprobe_Init(int, struct sockaddr_in *, int, int (*)(void), int ); -diff --git a/src/uss/uss_vol.c b/src/uss/uss_vol.c -index c9c13941d..b31a42a06 100644 ---- a/src/uss/uss_vol.c -+++ b/src/uss/uss_vol.c -@@ -61,7 +61,7 @@ extern int line; - * will work and we can avoid nasty little core dumps. - */ - struct ubik_client *uconn_vldbP; /*Ubik connection struct */ --struct ubik_client *cstruct; /*Required name for above */ -+extern struct ubik_client *cstruct; /*Required name for above */ - - /* - * ------------------------ Private globals ----------------------- -diff --git a/src/viced/host.c b/src/viced/host.c -index 36f9e88c0..e7657caac 100644 ---- a/src/viced/host.c -+++ b/src/viced/host.c -@@ -67,6 +67,8 @@ int hostCount = 0; /* number of hosts in hostList */ - int rxcon_ident_key; - int rxcon_client_key; - -+struct host *(hosttableptrs[h_MAXHOSTTABLES]); -+ - static struct rx_securityClass *sc = NULL; - static int h_quota_limit; - -diff --git a/src/viced/host.h b/src/viced/host.h -index fead948f6..272dcdbe7 100644 ---- a/src/viced/host.h -+++ b/src/viced/host.h -@@ -254,7 +254,7 @@ extern int h_RestoreState(void); - #define H_ENUMERATE_BAIL(flags) ((flags)|0x80000000) - #define H_ENUMERATE_ISSET_BAIL(flags) ((flags)&0x80000000) - --struct host *(hosttableptrs[h_MAXHOSTTABLES]); /* Used by h_itoh */ -+extern struct host *(hosttableptrs[h_MAXHOSTTABLES]); /* Used by h_itoh */ - #define h_htoi(host) ((host)->index) /* index isn't zeroed, no need to lock */ - #define h_itoh(hostindex) (hosttableptrs[(hostindex)>>h_HTSHIFT]+((hostindex)&(h_HTSPERBLOCK-1))) - -diff --git a/src/vol/fssync-server.c b/src/vol/fssync-server.c -index 2d7cd6011..69d902f1b 100644 ---- a/src/vol/fssync-server.c -+++ b/src/vol/fssync-server.c -@@ -79,9 +79,6 @@ - #endif /* USE_UNIX_SOCKETS */ - - #ifdef FSSYNC_BUILD_SERVER -- --int (*V_BreakVolumeCallbacks) (VolumeId volume); -- - #define MAXHANDLERS 4 /* Up to 4 clients; must be at least 2, so that - * move = dump+restore can run on single server */ - #define MAXOFFLINEVOLUMES 128 /* This needs to be as big as the maximum -diff --git a/src/vol/volume.c b/src/vol/volume.c -index f1ff10a7b..3d9e47ef3 100644 ---- a/src/vol/volume.c -+++ b/src/vol/volume.c -@@ -124,9 +124,6 @@ pthread_cond_t vol_vinit_cond; - int vol_attach_threads = 1; - #endif /* AFS_PTHREAD_ENV */ - --/* start-time configurable I/O parameters */ --ih_init_params vol_io_params; -- - #ifdef AFS_DEMAND_ATTACH_FS - pthread_mutex_t vol_salvsync_mutex; - -diff --git a/src/xstat/xstat_cm.c b/src/xstat/xstat_cm.c -index d8600c124..3f5bfc843 100644 ---- a/src/xstat/xstat_cm.c -+++ b/src/xstat/xstat_cm.c -@@ -32,9 +32,8 @@ - int xstat_cm_numServers; /*Num connected servers */ - struct xstat_cm_ConnectionInfo - *xstat_cm_ConnInfo; /*Ptr to connection array */ --int numCollections; /*Number of data collections */ - struct xstat_cm_ProbeResults xstat_cm_Results; /*Latest probe results */ --char terminationEvent; /*One-shot termination event */ -+char cm_terminationEvent; /*One-shot termination event */ - - afs_int32 xstat_cmData[AFSCB_MAX_XSTAT_LONGS]; /*Buffer for collected data */ - -@@ -315,8 +314,8 @@ xstat_cm_LWP(void *unused) - */ - if (xstat_cm_debug) - printf("[%s] Signalling main process at %" AFS_PTR_FMT "\n", rn, -- &terminationEvent); -- oneShotCode = LWP_SignalProcess(&terminationEvent); -+ &cm_terminationEvent); -+ oneShotCode = LWP_SignalProcess(&cm_terminationEvent); - if (oneShotCode) - fprintf(stderr, "[%s] Error %d from LWP_SignalProcess()", rn, - oneShotCode); -diff --git a/src/xstat/xstat_cm.h b/src/xstat/xstat_cm.h -index efbba531c..569011cc2 100644 ---- a/src/xstat/xstat_cm.h -+++ b/src/xstat/xstat_cm.h -@@ -86,10 +86,9 @@ struct xstat_cm_ProbeResults { - extern int xstat_cm_numServers; /*# connected servers */ - extern struct xstat_cm_ConnectionInfo - *xstat_cm_ConnInfo; /*Ptr to connections */ --extern int numCollections; /*Num data collections */ - extern struct xstat_cm_ProbeResults - xstat_cm_Results; /*Latest probe results */ --extern char terminationEvent; /*One-shot termination event */ -+extern char cm_terminationEvent; /*One-shot termination event */ - - /* - * ------------------------ Exported functions ------------------------ -diff --git a/src/xstat/xstat_cm_test.c b/src/xstat/xstat_cm_test.c -index b284237aa..7c5e56864 100644 ---- a/src/xstat/xstat_cm_test.c -+++ b/src/xstat/xstat_cm_test.c -@@ -881,8 +881,8 @@ RunTheTest(struct cmd_syndesc *a_s, void *arock) - */ - if (debugging_on) - printf("[%s] Calling LWP_WaitProcess() on event %" AFS_PTR_FMT -- "\n", rn, &terminationEvent); -- waitCode = LWP_WaitProcess(&terminationEvent); -+ "\n", rn, &cm_terminationEvent); -+ waitCode = LWP_WaitProcess(&cm_terminationEvent); - if (debugging_on) - printf("[%s] Returned from LWP_WaitProcess()\n", rn); - if (waitCode) { -diff --git a/src/xstat/xstat_fs.c b/src/xstat/xstat_fs.c -index 51dbe3847..dff930472 100644 ---- a/src/xstat/xstat_fs.c -+++ b/src/xstat/xstat_fs.c -@@ -33,9 +33,8 @@ - int xstat_fs_numServers; /*Num connected servers */ - struct xstat_fs_ConnectionInfo - *xstat_fs_ConnInfo; /*Ptr to connection array */ --int numCollections; /*Number of data collections */ - struct xstat_fs_ProbeResults xstat_fs_Results; /*Latest probe results */ --char terminationEvent; /*One-shot termination event */ -+char fs_terminationEvent; /*One-shot termination event */ - - afs_int32 xstat_fsData[AFS_MAX_XSTAT_LONGS]; /*Buffer for collected data */ - -@@ -334,8 +333,8 @@ xstat_fs_LWP(void *unused) - */ - if (xstat_fs_debug) - printf("[%s] Signalling main process at %" AFS_PTR_FMT "\n", rn, -- &terminationEvent); -- oneShotCode = LWP_SignalProcess(&terminationEvent); -+ &fs_terminationEvent); -+ oneShotCode = LWP_SignalProcess(&fs_terminationEvent); - if (oneShotCode) - fprintf(stderr, "[%s] Error %d from LWP_SignalProcess()", rn, - oneShotCode); -diff --git a/src/xstat/xstat_fs.h b/src/xstat/xstat_fs.h -index 6e2b77b85..a800ba679 100644 ---- a/src/xstat/xstat_fs.h -+++ b/src/xstat/xstat_fs.h -@@ -87,10 +87,9 @@ struct xstat_fs_ProbeResults { - extern int xstat_fs_numServers; /*# connected servers */ - extern struct xstat_fs_ConnectionInfo - *xstat_fs_ConnInfo; /*Ptr to connections */ --extern int numCollections; /*Num data collections */ - extern struct xstat_fs_ProbeResults - xstat_fs_Results; /*Latest probe results */ --extern char terminationEvent; /*One-shot termination event */ -+extern char fs_terminationEvent; /*One-shot termination event */ - - /* - * ------------------------ Exported functions ------------------------ -diff --git a/src/xstat/xstat_fs_test.c b/src/xstat/xstat_fs_test.c -index 853c2121e..d58ecf014 100644 ---- a/src/xstat/xstat_fs_test.c -+++ b/src/xstat/xstat_fs_test.c -@@ -778,8 +778,8 @@ RunTheTest(struct cmd_syndesc *a_s, void *dummy) - */ - if (debugging_on) - printf("[%s] Calling LWP_WaitProcess() on event %" AFS_PTR_FMT "\n", rn, -- &terminationEvent); -- waitCode = LWP_WaitProcess(&terminationEvent); -+ &fs_terminationEvent); -+ waitCode = LWP_WaitProcess(&fs_terminationEvent); - if (debugging_on) - printf("[%s] Returned from LWP_WaitProcess()\n", rn); - if (waitCode) { --- -2.30.0 - diff --git a/0001-afs-Make-afs_AllocDCache-static.patch b/0001-afs-Make-afs_AllocDCache-static.patch new file mode 100644 index 000000000000..ebbc523a5f38 --- /dev/null +++ b/0001-afs-Make-afs_AllocDCache-static.patch @@ -0,0 +1,35 @@ +From 78e644655a3858113f33f534d018220ab2eaabc0 Mon Sep 17 00:00:00 2001 +From: Andrew Deason <adeason@sinenomine.net> +Date: Thu, 28 Jun 2018 12:50:52 -0500 +Subject: [PATCH 01/29] afs: Make afs_AllocDCache static + +Nothing using afs_AllocDCache outside of afs_dcache.c. Declare the +function static, to ensure that nobody else uses it, and to maybe +allow for more compiler optimization. + +Reviewed-on: https://gerrit.openafs.org/13226 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 4ab70de9641807bd06056f0c1ac79550453b9574) + +Change-Id: I6fd9e31c4b2e862174402f731a77c91599893223 +--- + src/afs/afs_dcache.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c +index 3572f2f23..46d0bdba5 100644 +--- a/src/afs/afs_dcache.c ++++ b/src/afs/afs_dcache.c +@@ -1674,7 +1674,7 @@ afs_AllocDiscardDSlot(afs_int32 lock) + * + * \return The new dcache. + */ +-struct dcache * ++static struct dcache * + afs_AllocDCache(struct vcache *avc, afs_int32 chunk, afs_int32 lock, + struct VenusFid *ashFid) + { +-- +2.44.0 + diff --git a/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch b/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch deleted file mode 100644 index c4f60ce4c9ac..000000000000 --- a/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch +++ /dev/null @@ -1,159 +0,0 @@ -From 509169ed302741e2499fbb116ed08408c08d3999 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills <cwills@sinenomine.net> -Date: Fri, 3 Jul 2020 10:33:51 -0600 -Subject: [PATCH 2/5] LINUX 5.8: Replace kernel_setsockopt with new funcs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Linux 5.8-rc1 commit 'net: remove kernel_setsockopt' (5a892ff2facb) -retires the kernel_setsockopt function. In prior kernel commits new -functions (ip_sock_set_*) were added to replace the specific functions -performed by kernel_setsockopt. - -Define new config test 'HAVE_IP_SOCK_SET' if the 'ip_sock_set' functions -are available. The config define 'HAVE_KERNEL_SETSOCKOPT' is no longer -set in Linux 5.8. - -Create wrapper functions that replace the kernel_setsockopt calls with -calls to the appropriate Linux kernel function(s) (depending on what -functions the kernel supports). - -Remove the unused 'kernel_getsockopt' function (used for building with -pre 2.6.19 kernels). - -For reference - Linux 2.6.19 introduced kernel_setsockopt - Linux 5.8 removed kernel_setsockopt and replaced the functionality - with a set of new functions (ip_sock_set_*) - -Reviewed-on: https://gerrit.openafs.org/14247 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> -(cherry picked from commit c48072b9800759ef1682b91ff1e962f6904a2594) - -Change-Id: I2724fad06b1882149d2066d13eced55eff5ee695 -Reviewed-on: https://gerrit.openafs.org/14267 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de> -Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> ---- - src/afs/LINUX/osi_compat.h | 43 +++++++++++++++++++++++++------------ - src/cf/linux-kernel-func.m4 | 6 ++++++ - src/rx/LINUX/rx_knet.c | 11 +++------- - 3 files changed, 38 insertions(+), 22 deletions(-) - -diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h -index 4999b89b9..620b3730c 100644 ---- a/src/afs/LINUX/osi_compat.h -+++ b/src/afs/LINUX/osi_compat.h -@@ -314,9 +314,22 @@ zero_user_segment(struct page *pp, unsigned int from1, unsigned int to1) - } - #endif - --#ifndef HAVE_LINUX_KERNEL_SETSOCKOPT -+#if defined(HAVE_LINUX_IP_SOCK_SET) -+# include <net/ip.h> -+/* ip_sock_set_* introduced in linux 5.8 */ -+static inline void -+afs_linux_sock_set_mtu_discover(struct socket *sockp, int pmtu) -+{ -+ ip_sock_set_mtu_discover(sockp->sk, pmtu); -+} -+static inline void -+afs_linux_sock_set_recverr(struct socket *sockp) -+{ -+ ip_sock_set_recverr(sockp->sk); -+} -+#else -+# if !defined(HAVE_LINUX_KERNEL_SETSOCKOPT) - /* Available from 2.6.19 */ -- - static inline int - kernel_setsockopt(struct socket *sockp, int level, int name, char *val, - unsigned int len) { -@@ -329,20 +342,22 @@ kernel_setsockopt(struct socket *sockp, int level, int name, char *val, - - return ret; - } -+# endif /* !HAVE_LINUX_KERNEL_SETSOCKOPT */ - --static inline int --kernel_getsockopt(struct socket *sockp, int level, int name, char *val, -- int *len) { -- mm_segment_t old_fs = get_fs(); -- int ret; -- -- set_fs(get_ds()); -- ret = sockp->ops->getsockopt(sockp, level, name, val, len); -- set_fs(old_fs); -- -- return ret; -+static inline void -+afs_linux_sock_set_mtu_discover(struct socket *sockp, int pmtu) -+{ -+ kernel_setsockopt(sockp, SOL_IP, IP_MTU_DISCOVER, (char *)&pmtu, -+ sizeof(pmtu)); - } --#endif -+static inline void -+afs_linux_sock_set_recverr(struct socket *sockp) -+{ -+ int recverr = 1; -+ kernel_setsockopt(sockp, SOL_IP, IP_RECVERR, (char *)&recverr, -+ sizeof(recverr)); -+} -+#endif /* !HAVE_LINUX_IP_SOCK_SET */ - - #ifdef HAVE_TRY_TO_FREEZE - static inline int -diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 -index 07627db52..78ff48294 100644 ---- a/src/cf/linux-kernel-func.m4 -+++ b/src/cf/linux-kernel-func.m4 -@@ -151,6 +151,12 @@ AC_CHECK_LINUX_FUNC([lru_cache_add_file], - [#include <linux/swap.h>], - [lru_cache_add_file(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], -+ [#include <net/ip.h>], -+ [ip_sock_set_mtu_discover(NULL, 0);]) -+ - dnl Consequences - things which get set as a result of the - dnl above tests - AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"], -diff --git a/src/rx/LINUX/rx_knet.c b/src/rx/LINUX/rx_knet.c -index 9fbb563f3..50607c8f5 100644 ---- a/src/rx/LINUX/rx_knet.c -+++ b/src/rx/LINUX/rx_knet.c -@@ -34,7 +34,6 @@ - #include <linux/errqueue.h> - #include <linux/icmp.h> - #endif -- - #include "osi_compat.h" - - /* rxk_NewSocket -@@ -76,14 +75,10 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport) - return NULL; - } - -- kernel_setsockopt(sockp, SOL_IP, IP_MTU_DISCOVER, (char *)&pmtu, -- sizeof(pmtu)); -+ afs_linux_sock_set_mtu_discover(sockp, pmtu); -+ - #ifdef AFS_RXERRQ_ENV -- { -- int recverr = 1; -- kernel_setsockopt(sockp, SOL_IP, IP_RECVERR, (char *)&recverr, -- sizeof(recverr)); -- } -+ afs_linux_sock_set_recverr(sockp); - #endif - return (osi_socket *)sockp; - } --- -2.30.0 - diff --git a/0002-LINUX-Minor-osi_vfsop.c-cleanup.patch b/0002-LINUX-Minor-osi_vfsop.c-cleanup.patch new file mode 100644 index 000000000000..252cea0db5da --- /dev/null +++ b/0002-LINUX-Minor-osi_vfsop.c-cleanup.patch @@ -0,0 +1,80 @@ +From 2f5309a7fa3ee187c18a8930b96e89e4e31cf03e Mon Sep 17 00:00:00 2001 +From: Andrew Deason <adeason@sinenomine.net> +Date: Tue, 24 Jul 2018 23:22:01 -0500 +Subject: [PATCH 02/29] LINUX: Minor osi_vfsop.c cleanup + +- Fix the formatting on afs_mount/afs_get_sb definitions + +- Declare a couple of functions static that are not referenced outside + of this file + +Reviewed-on: https://gerrit.openafs.org/13282 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit fa15fbda0aa0c3810695d9b867d3258b60e76b7c) + +Change-Id: I8a32475bf2ddb9c7206aef679947021925697c5a +--- + src/afs/LINUX/osi_vfsops.c | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c +index b85ab3fdf..bb49a5ce2 100644 +--- a/src/afs/LINUX/osi_vfsops.c ++++ b/src/afs/LINUX/osi_vfsops.c +@@ -40,7 +40,7 @@ extern struct dentry_operations afs_dentry_operations; + + /* Forward declarations */ + static int afs_root(struct super_block *afsp); +-int afs_fill_super(struct super_block *sb, void *data, int silent); ++static int afs_fill_super(struct super_block *sb, void *data, int silent); + + + /* +@@ -52,19 +52,22 @@ int afs_fill_super(struct super_block *sb, void *data, int silent); + #if defined(STRUCT_FILE_SYSTEM_TYPE_HAS_MOUNT) + static struct dentry * + afs_mount(struct file_system_type *fs_type, int flags, +- const char *dev_name, void *data) { ++ const char *dev_name, void *data) ++{ + return mount_nodev(fs_type, flags, data, afs_fill_super); + } + #elif defined(GET_SB_HAS_STRUCT_VFSMOUNT) + static int + afs_get_sb(struct file_system_type *fs_type, int flags, +- const char *dev_name, void *data, struct vfsmount *mnt) { ++ const char *dev_name, void *data, struct vfsmount *mnt) ++{ + return get_sb_nodev(fs_type, flags, data, afs_fill_super, mnt); + } + #else + static struct super_block * + afs_get_sb(struct file_system_type *fs_type, int flags, +- const char *dev_name, void *data) { ++ const char *dev_name, void *data) ++{ + return get_sb_nodev(fs_type, flags, data, afs_fill_super); + } + #endif +@@ -83,7 +86,7 @@ struct file_system_type afs_fs_type = { + + struct backing_dev_info *afs_backing_dev_info; + +-int ++static int + afs_fill_super(struct super_block *sb, void *data, int silent) + { + int code = 0; +@@ -372,7 +375,7 @@ afs_put_super(struct super_block *sbp) + * statp is in user space, so we need to cobble together a statfs, then + * copy it. + */ +-int ++static int + #if defined(STATFS_TAKES_DENTRY) + afs_statfs(struct dentry *dentry, struct kstatfs *statp) + #else +-- +2.44.0 + diff --git a/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch b/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch deleted file mode 100644 index 8b8a9f342bf4..000000000000 --- a/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 2daa3a8f5771539203d9eb8c4e23b01ed7c65a16 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills <cwills@sinenomine.net> -Date: Fri, 3 Jul 2020 10:34:42 -0600 -Subject: [PATCH 3/5] LINUX 5.8: do not set name field in backing_dev_info -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Linux-5.8-rc1 commit 'bdi: remove the name field in struct -backing_dev_info' (1cd925d5838) - -Do not set the name field in the backing_dev_info structure if it is -not available. Uses an existing config test - 'STRUCT_BACKING_DEV_INFO_HAS_NAME' - -Note the name field in the backing_dev_info structure was added in -Linux-2.6.32 - -Reviewed-on: https://gerrit.openafs.org/14248 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> -(cherry picked from commit d8ec294534fcdee77a2ccd297b4b167dc4d5573d) - -Change-Id: I3d9e18092db998a4c4f26bd63ee3b75383a53d4c -Reviewed-on: https://gerrit.openafs.org/14268 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de> -Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> ---- - src/afs/LINUX/osi_vfsops.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c -index 8bbb5f225..ca1d5c83b 100644 ---- a/src/afs/LINUX/osi_vfsops.c -+++ b/src/afs/LINUX/osi_vfsops.c -@@ -121,7 +121,9 @@ afs_fill_super(struct super_block *sb, void *data, int silent) - code = super_setup_bdi(sb); - if (code) - goto out; -+# if defined(STRUCT_BACKING_DEV_INFO_HAS_NAME) - sb->s_bdi->name = "openafs"; -+# endif - sb->s_bdi->ra_pages = 32; - #else - /* used for inodes backing_dev_info field, also */ --- -2.30.0 - diff --git a/0003-afs-Remove-SRXAFSCB_GetDE.patch b/0003-afs-Remove-SRXAFSCB_GetDE.patch new file mode 100644 index 000000000000..873bc45ee037 --- /dev/null +++ b/0003-afs-Remove-SRXAFSCB_GetDE.patch @@ -0,0 +1,52 @@ +From fb336c461e9c212d450ce5e00890e8bbb2d9a4f7 Mon Sep 17 00:00:00 2001 +From: Andrew Deason <adeason@sinenomine.net> +Date: Sat, 9 Jan 2021 12:50:03 -0600 +Subject: [PATCH 03/29] afs: Remove SRXAFSCB_GetDE + +The GetDE RPC has been commented out from afscbint.xg effectively +since it was introduced, but we still define the SRXAFSCB_GetDE server +stub for it. + +This is useless, but also potentially dangerous, since the stub +routine just returns success, without populating the output arguments. +One of the output arguments is a string, and so if this RPC is +actually run, the rxgen-generated server code will try to xdr_string() +that string. Since we never set it to anything, this will result in +xdr_string trying to dereference a NULL pointer. + +None of this actually happens currently, since the GetDE RPC is +commented out. But to avoid the above situation if it's ever +uncommented, remove the useless SRXAFSCB_GetDE function. + +Reviewed-on: https://gerrit.openafs.org/14488 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 444a971edc47c34efbefed6e332ee6e843ae072b) + +Change-Id: I83846d79ce3143571923cb6023075620091f093d +--- + src/afs/afs_callback.c | 11 ----------- + 1 file changed, 11 deletions(-) + +diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c +index e7d8ab5d4..22edefb3f 100644 +--- a/src/afs/afs_callback.c ++++ b/src/afs/afs_callback.c +@@ -1636,14 +1636,3 @@ SRXAFSCB_TellMeAboutYourself(struct rx_call *a_call, + + return code; + } +- +- +-int +-SRXAFSCB_GetDE(struct rx_call *a_call, afs_int32 a_index, afs_int32 *addr, +- afs_int32 *inode, afs_int32 *flags, afs_int32 *time, +- char ** fileName) +-{ /*SRXAFSCB_GetDE*/ +- int code = 0; /*Return code*/ +- return(code); +- +-} /*SRXAFSCB_GetDE*/ +-- +2.44.0 + diff --git a/0004-LINUX-5.8-use-lru_cache_add.patch b/0004-LINUX-5.8-use-lru_cache_add.patch deleted file mode 100644 index 1388afd8eea3..000000000000 --- a/0004-LINUX-5.8-use-lru_cache_add.patch +++ /dev/null @@ -1,108 +0,0 @@ -From d1c503f83a2cf85c6fbf7aab24728a5f0787c54c Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills <cwills@sinenomine.net> -Date: Fri, 3 Jul 2020 10:35:06 -0600 -Subject: [PATCH 4/5] LINUX 5.8: use lru_cache_add -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -With Linux-5.8-rc1 commit 'mm: fold and remove lru_cache_add_anon() and -lru_cache_add_file()' (6058eaec), the lru_cache_add_file function is -removed since it was functionally equivalent to lru_cache_add. - -Replace lru_cache_add_file with lru_cache_add. - -Introduce a new autoconf test to determine if lru_cache_add is present - -For reference, the Linux changes associated with the lru caches: - - __pagevec_lru_add introduced before v2.6.12-rc2 - - lru_cache_add_file introduced in v2.6.28-rc1 - __pagevec_lru_add_file replaces __pagevec_lru_add in v2.6.28-rc1 - vmscan: split LRU lists into anon & file sets (4f98a2fee) - - __pagevec_lru_add removed in v5.7 with a note to use lru_cache_add_file - mm/swap.c: not necessary to export __pagevec_lru_add() (bde07cfc6) - - lru_cache_add_file removed in v5.8 - mm: fold and remove lru_cache_add_anon() and lru_cache_add_file() - (6058eaec) - lru_cache_add exported - mm: fold and remove lru_cache_add_anon() and lru_cache_add_file() - (6058eaec) - -Openafs will use: - lru_cache_add on 5.8 kernels - lru_cache_add_file from 2.6.28 through 5.7 kernels - __pagevec_lru_add/__pagevec_lru_add_file on pre 2.6.28 kernels - -Reviewed-on: https://gerrit.openafs.org/14249 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Andrew Deason <adeason@sinenomine.net> -Reviewed-by: Yadavendra Yadav <yadayada@in.ibm.com> -Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> -(cherry picked from commit 7d85ce221d6ccc19cf76ce7680c74311e4ed2632) - -Change-Id: Iba6ef4441687dbf60d227a708e2a032c2c0dc79f -Reviewed-on: https://gerrit.openafs.org/14269 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de> -Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> ---- - src/afs/LINUX/osi_vnodeops.c | 8 +++++++- - src/cf/linux-kernel-func.m4 | 7 +++++++ - 2 files changed, 14 insertions(+), 1 deletion(-) - -diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c -index 00995b27a..36a4f685e 100644 ---- a/src/afs/LINUX/osi_vnodeops.c -+++ b/src/afs/LINUX/osi_vnodeops.c -@@ -71,7 +71,7 @@ extern struct vcache *afs_globalVp; - - /* Handle interfacing with Linux's pagevec/lru facilities */ - --#if defined(HAVE_LINUX_LRU_CACHE_ADD_FILE) -+#if 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 -@@ -90,7 +90,13 @@ afs_lru_cache_init(struct afs_lru_pages *alrupages) - static inline void - afs_lru_cache_add(struct afs_lru_pages *alrupages, struct page *page) - { -+# if defined(HAVE_LINUX_LRU_CACHE_ADD) -+ lru_cache_add(page); -+# elif defined(HAVE_LINUX_LRU_CACHE_ADD_FILE) - lru_cache_add_file(page); -+# else -+# error need a kernel function to add a page to the kernel lru cache -+# endif - } - - static inline void -diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 -index 78ff48294..11d071806 100644 ---- a/src/cf/linux-kernel-func.m4 -+++ b/src/cf/linux-kernel-func.m4 -@@ -147,10 +147,17 @@ AC_CHECK_LINUX_FUNC([inode_lock], - [inode_lock(NULL);]) - - dnl lru_cache_add_file added to Linux 2.6.28. -+dnl removed in Linux 5.8 - AC_CHECK_LINUX_FUNC([lru_cache_add_file], - [#include <linux/swap.h>], - [lru_cache_add_file(NULL);]) - -+dnl lru_cache_add exported in Linux 5.8 -+dnl replaces lru_cache_add_file -+AC_CHECK_LINUX_FUNC([lru_cache_add], -+ [#include <linux/swap.h>], -+ [lru_cache_add(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], --- -2.30.0 - diff --git a/0004-afs-remove-dead-ICL-fstrace-code.patch b/0004-afs-remove-dead-ICL-fstrace-code.patch new file mode 100644 index 000000000000..f6e079895fb1 --- /dev/null +++ b/0004-afs-remove-dead-ICL-fstrace-code.patch @@ -0,0 +1,265 @@ +From 7d45e9f76541e2d0b57984b9ba272a86bbd9791b Mon Sep 17 00:00:00 2001 +From: Mark Vitale <mvitale@sinenomine.net> +Date: Thu, 11 Mar 2021 15:36:54 -0500 +Subject: [PATCH 04/29] afs: remove dead ICL (fstrace) code + +The ICL code (afs/afs_icl.c) which supports fstrace includes a number of +functions that have been dead code since the original IBM code import. +Some of these seem to have been intended to support fine-grained event +tracing, but the implementation was never completed. + +Remove the dead code. No functional change is incurred by this commit. + +Reviewed-on: https://gerrit.openafs.org/14555 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit ba58d9912cff07a6f2af7275017cf70115f1a88d) + +Change-Id: Ic0a6d5dac200e7e130fa8df66005bdaf291cf088 +--- + src/afs/afs_icl.c | 147 --------------------------------------- + src/afs/afs_prototypes.h | 19 ----- + 2 files changed, 166 deletions(-) + +diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c +index 8d09113dc..42b4a0ccb 100644 +--- a/src/afs/afs_icl.c ++++ b/src/afs/afs_icl.c +@@ -538,18 +538,6 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr) + #define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x)) + #endif + +-/* routine to tell whether we're dealing with the address or the +- * object itself +- */ +-int +-afs_icl_UseAddr(int type) +-{ +- if (type == ICL_TYPE_HYPER || type == ICL_TYPE_STRING +- || type == ICL_TYPE_FID || type == ICL_TYPE_INT64) +- return 1; +- else +- return 0; +-} + + void + afs_icl_AppendOne(struct afs_icl_log *logp, int type, long parm) +@@ -884,19 +872,6 @@ afs_icl_CopyOut(struct afs_icl_log *logp, afs_int32 * bufferp, + return code; + } + +-/* return basic parameter information about a log */ +-int +-afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 * maxSizep, +- afs_int32 * curSizep) +-{ +- ObtainReadLock(&logp->lock); +- *maxSizep = logp->logSize; +- *curSizep = logp->logElements; +- ReleaseReadLock(&logp->lock); +- return 0; +-} +- +- + /* hold and release logs */ + int + afs_icl_LogHold(struct afs_icl_log *logp) +@@ -907,14 +882,6 @@ afs_icl_LogHold(struct afs_icl_log *logp) + return 0; + } + +-/* hold and release logs, called with lock already held */ +-int +-afs_icl_LogHoldNL(struct afs_icl_log *logp) +-{ +- logp->refCount++; +- return 0; +-} +- + /* keep track of how many sets believe the log itself is allocated */ + int + afs_icl_LogUse(struct afs_icl_log *logp) +@@ -1070,32 +1037,6 @@ afs_icl_FindLog(char *name) + return tp; + } + +-int +-afs_icl_EnumerateLogs(int (*aproc) +- (char *name, char *arock, struct afs_icl_log * tp), +- char *arock) +-{ +- struct afs_icl_log *tp; +- afs_int32 code; +- +- code = 0; +- ObtainWriteLock(&afs_icl_lock, 195); +- for (tp = afs_icl_allLogs; tp; tp = tp->nextp) { +- tp->refCount++; /* hold this guy */ +- ReleaseWriteLock(&afs_icl_lock); +- ObtainReadLock(&tp->lock); +- code = (*aproc) (tp->name, arock, tp); +- ReleaseReadLock(&tp->lock); +- ObtainWriteLock(&afs_icl_lock, 196); +- if (--tp->refCount == 0) +- afs_icl_ZapLog(tp); +- if (code) +- break; +- } +- ReleaseWriteLock(&afs_icl_lock); +- return code; +-} +- + struct afs_icl_set *afs_icl_allSets = 0; + + int +@@ -1198,46 +1139,6 @@ afs_icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp, + return 0; + } + +-/* function to change event enabling information for a particular set */ +-int +-afs_icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID, int setValue) +-{ +- char *tp; +- +- ObtainWriteLock(&setp->lock, 200); +- if (!ICL_EVENTOK(setp, eventID)) { +- ReleaseWriteLock(&setp->lock); +- return -1; +- } +- tp = &setp->eventFlags[ICL_EVENTBYTE(eventID)]; +- if (setValue) +- *tp |= ICL_EVENTMASK(eventID); +- else +- *tp &= ~(ICL_EVENTMASK(eventID)); +- ReleaseWriteLock(&setp->lock); +- return 0; +-} +- +-/* return indication of whether a particular event ID is enabled +- * for tracing. If *getValuep is set to 0, the event is disabled, +- * otherwise it is enabled. All events start out enabled by default. +- */ +-int +-afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID, int *getValuep) +-{ +- ObtainReadLock(&setp->lock); +- if (!ICL_EVENTOK(setp, eventID)) { +- ReleaseWriteLock(&setp->lock); +- return -1; +- } +- if (setp->eventFlags[ICL_EVENTBYTE(eventID)] & ICL_EVENTMASK(eventID)) +- *getValuep = 1; +- else +- *getValuep = 0; +- ReleaseReadLock(&setp->lock); +- return 0; +-} +- + /* hold and release event sets */ + int + afs_icl_SetHold(struct afs_icl_set *setp) +@@ -1340,54 +1241,6 @@ afs_icl_ZeroSet(struct afs_icl_set *setp) + return code; + } + +-int +-afs_icl_EnumerateSets(int (*aproc) +- (char *name, char *arock, struct afs_icl_log * tp), +- char *arock) +-{ +- struct afs_icl_set *tp, *np; +- afs_int32 code; +- +- code = 0; +- ObtainWriteLock(&afs_icl_lock, 205); +- for (tp = afs_icl_allSets; tp; tp = np) { +- tp->refCount++; /* hold this guy */ +- ReleaseWriteLock(&afs_icl_lock); +- code = (*aproc) (tp->name, arock, (struct afs_icl_log *)tp); +- ObtainWriteLock(&afs_icl_lock, 206); +- np = tp->nextp; /* tp may disappear next, but not np */ +- if (--tp->refCount == 0 && (tp->states & ICL_SETF_DELETED)) +- afs_icl_ZapSet(tp); +- if (code) +- break; +- } +- ReleaseWriteLock(&afs_icl_lock); +- return code; +-} +- +-int +-afs_icl_AddLogToSet(struct afs_icl_set *setp, struct afs_icl_log *newlogp) +-{ +- int i; +- int code = -1; +- +- ObtainWriteLock(&setp->lock, 207); +- for (i = 0; i < ICL_LOGSPERSET; i++) { +- if (!setp->logs[i]) { +- setp->logs[i] = newlogp; +- code = i; +- afs_icl_LogHold(newlogp); +- if (!(setp->states & ICL_SETF_FREED)) { +- /* bump up the number of sets using the log */ +- afs_icl_LogUse(newlogp); +- } +- break; +- } +- } +- ReleaseWriteLock(&setp->lock); +- return code; +-} +- + int + afs_icl_SetSetStat(struct afs_icl_set *setp, int op) + { +diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h +index e9a655e65..ed43635aa 100644 +--- a/src/afs/afs_prototypes.h ++++ b/src/afs/afs_prototypes.h +@@ -364,10 +364,7 @@ extern int afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize, + extern int afs_icl_CopyOut(struct afs_icl_log *logp, + afs_int32 * bufferp, afs_int32 * bufSizep, + afs_uint32 * cookiep, afs_int32 * flagsp); +-extern int afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 * maxSizep, +- afs_int32 * curSizep); + extern int afs_icl_LogHold(struct afs_icl_log *logp); +-extern int afs_icl_LogHoldNL(struct afs_icl_log *logp); + extern int afs_icl_LogUse(struct afs_icl_log *logp); + extern int afs_icl_LogFreeUse(struct afs_icl_log *logp); + extern int afs_icl_LogSetSize(struct afs_icl_log *logp, +@@ -378,11 +375,6 @@ extern int afs_icl_LogReleNL(struct afs_icl_log *logp); + extern int afs_icl_ZeroLog(struct afs_icl_log *logp); + extern int afs_icl_LogFree(struct afs_icl_log *logp); + extern struct afs_icl_log *afs_icl_FindLog(char *name); +-extern int +- afs_icl_EnumerateLogs(int (*aproc) +- +- (char *name, char *arock, struct afs_icl_log * tp), +- char *arock); + extern int afs_icl_CreateSet(char *name, struct afs_icl_log *baseLogp, + struct afs_icl_log *fatalLogp, + struct afs_icl_set **outSetpp); +@@ -391,18 +383,7 @@ extern int afs_icl_CreateSetWithFlags(char *name, + struct afs_icl_log *fatalLogp, + afs_uint32 flags, + struct afs_icl_set **outSetpp); +-extern int afs_icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID, +- int setValue); +-extern int afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID, +- int *getValuep); + extern int afs_icl_ZeroSet(struct afs_icl_set *setp); +-extern int +- afs_icl_EnumerateSets(int (*aproc) +- +- (char *name, char *arock, struct afs_icl_log * tp), +- char *arock); +-extern int afs_icl_AddLogToSet(struct afs_icl_set *setp, +- struct afs_icl_log *newlogp); + extern int afs_icl_SetSetStat(struct afs_icl_set *setp, int op); + extern int afs_icl_SetHold(struct afs_icl_set *setp); + extern int afs_icl_ZapSet(struct afs_icl_set *setp); +-- +2.44.0 + diff --git a/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch b/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch deleted file mode 100644 index 0f2a5b8e3abe..000000000000 --- a/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch +++ /dev/null @@ -1,169 +0,0 @@ -From c3b7278663c0e88daa611e7c1cc250e63639a496 Mon Sep 17 00:00:00 2001 -From: Cheyenne Wills <cwills@sinenomine.net> -Date: Fri, 21 Aug 2020 10:37:51 -0600 -Subject: [PATCH 5/5] LINUX 5.9: Remove HAVE_UNLOCKED_IOCTL/COMPAT_IOCTL - -Linux-5.9-rc1 commit 'fs: remove the HAVE_UNLOCKED_IOCTL and -HAVE_COMPAT_IOCTL defines' (4e24566a) removed the two referenced macros -from the kernel. - -The support for unlocked_ioctl and compat_ioctl were introduced in -Linux 2.6.11. - -Remove references to HAVE_UNLOCKED_IOCTL and HAVE_COMPAT_IOCTL using -the assumption that they were always defined. - -Notes: - -With this change, building against kernels 2.6.10 and older will fail. -RHEL4 (EOL in March 2017) used a 2.6.9 kernel. RHEL5 uses a 2.6.18 -kernel. - -In linux-2.6.33-rc1 the commit messages for "staging: comedi: -Remove check for HAVE_UNLOCKED_IOCTL" (00a1855c) and "Staging: comedi: -remove check for HAVE_COMPAT_IOCTL" (5d7ae225) both state that all new -kernels have support for unlocked_ioctl/compat_ioctl so the checks can -be removed along with removing support for older kernels. - -Reviewed-on: https://gerrit.openafs.org/14300 -Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> -Tested-by: Benjamin Kaduk <kaduk@mit.edu> -(cherry picked from commit 13a49aaf0d5c43bce08135edaabb65587e1a8031) - -Change-Id: I6dc5ae5b32031641f4a021a31630390a91d834fe -Reviewed-on: https://gerrit.openafs.org/14315 -Tested-by: BuildBot <buildbot@rampaginggeek.com> -Reviewed-by: Andrew Deason <adeason@sinenomine.net> -Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de> ---- - src/afs/LINUX/osi_ioctl.c | 25 ++----------------------- - src/afs/LINUX/osi_vnodeops.c | 14 -------------- - 2 files changed, 2 insertions(+), 37 deletions(-) - -diff --git a/src/afs/LINUX/osi_ioctl.c b/src/afs/LINUX/osi_ioctl.c -index 1646a1518..9ba076a1b 100644 ---- a/src/afs/LINUX/osi_ioctl.c -+++ b/src/afs/LINUX/osi_ioctl.c -@@ -25,10 +25,6 @@ - #include <asm/ia32_unistd.h> - #endif - --#if defined(AFS_SPARC64_LINUX26_ENV) && defined(NEED_IOCTL32) && !defined(HAVE_COMPAT_IOCTL) --#include <linux/ioctl32.h> --#endif -- - #include <linux/slab.h> - #include <linux/init.h> - #include <linux/sched.h> -@@ -37,9 +33,6 @@ - #include "osi_compat.h" - - extern struct proc_dir_entry *openafs_procfs; --#if defined(NEED_IOCTL32) && !defined(HAVE_COMPAT_IOCTL) --static int ioctl32_done; --#endif - - extern asmlinkage long - afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4); -@@ -85,12 +78,11 @@ afs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, - } - } - --#if defined(HAVE_UNLOCKED_IOCTL) || defined(HAVE_COMPAT_IOCTL) - static long afs_unlocked_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) { - return afs_ioctl(FILE_INODE(file), file, cmd, arg); - } --#endif -+ - #if defined(HAVE_LINUX_STRUCT_PROC_OPS) - static struct proc_ops afs_syscall_ops = { - .proc_ioctl = afs_unlocked_ioctl, -@@ -100,16 +92,11 @@ static struct proc_ops afs_syscall_ops = { - }; - #else - static struct file_operations afs_syscall_ops = { --# ifdef HAVE_UNLOCKED_IOCTL - .unlocked_ioctl = afs_unlocked_ioctl, --# else -- .ioctl = afs_ioctl, --# endif --# ifdef HAVE_COMPAT_IOCTL - .compat_ioctl = afs_unlocked_ioctl, --# endif - }; - #endif /* HAVE_LINUX_STRUCT_PROC_OPS */ -+ - void - osi_ioctl_init(void) - { -@@ -121,18 +108,10 @@ osi_ioctl_init(void) - entry->owner = THIS_MODULE; - #endif - --#if defined(NEED_IOCTL32) && !defined(HAVE_COMPAT_IOCTL) -- if (register_ioctl32_conversion(VIOC_SYSCALL32, NULL) == 0) -- ioctl32_done = 1; --#endif - } - - void - osi_ioctl_clean(void) - { - remove_proc_entry(PROC_SYSCALL_NAME, openafs_procfs); --#if defined(NEED_IOCTL32) && !defined(HAVE_COMPAT_IOCTL) -- if (ioctl32_done) -- unregister_ioctl32_conversion(VIOC_SYSCALL32); --#endif - } -diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c -index 36a4f685e..ba4f1e6af 100644 ---- a/src/afs/LINUX/osi_vnodeops.c -+++ b/src/afs/LINUX/osi_vnodeops.c -@@ -589,13 +589,11 @@ out1: - extern int afs_xioctl(struct inode *ip, struct file *fp, unsigned int com, - unsigned long arg); - --#if defined(HAVE_UNLOCKED_IOCTL) || defined(HAVE_COMPAT_IOCTL) - static long afs_unlocked_xioctl(struct file *fp, unsigned int com, - unsigned long arg) { - return afs_xioctl(FILE_INODE(fp), fp, com, arg); - - } --#endif - - - static int -@@ -891,14 +889,8 @@ struct file_operations afs_dir_fops = { - #else - .readdir = afs_linux_readdir, - #endif --#ifdef HAVE_UNLOCKED_IOCTL - .unlocked_ioctl = afs_unlocked_xioctl, --#else -- .ioctl = afs_xioctl, --#endif --#ifdef HAVE_COMPAT_IOCTL - .compat_ioctl = afs_unlocked_xioctl, --#endif - .open = afs_linux_open, - .release = afs_linux_release, - .llseek = default_llseek, -@@ -926,14 +918,8 @@ struct file_operations afs_file_fops = { - .read = afs_linux_read, - .write = afs_linux_write, - #endif --#ifdef HAVE_UNLOCKED_IOCTL - .unlocked_ioctl = afs_unlocked_xioctl, --#else -- .ioctl = afs_xioctl, --#endif --#ifdef HAVE_COMPAT_IOCTL - .compat_ioctl = afs_unlocked_xioctl, --#endif - .mmap = afs_linux_mmap, - .open = afs_linux_open, - .flush = afs_linux_flush, --- -2.30.0 - diff --git a/0005-cf-Add-function-prototypes-for-linux-conftest.patch b/0005-cf-Add-function-prototypes-for-linux-conftest.patch new file mode 100644 index 000000000000..75f365179b57 --- /dev/null +++ b/0005-cf-Add-function-prototypes-for-linux-conftest.patch @@ -0,0 +1,108 @@ +From 55e30ae5560063b8141b3696b0c67f355dcefc54 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Wed, 7 Feb 2024 14:51:23 -0700 +Subject: [PATCH 05/29] cf: Add function prototypes for linux conftest + +The Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f) + +added the compiler flags -Wmissing-declarations and -Wmissing-prototypes +as defaults for all kernel modules builds. This change causes configure +to fail for various Linux kernel tests. + +Update the template used to create the conftest.c file to provide a +function declaration for conftest(). + +Use a 'static' attribute when defining functions used within tests. + +Note: 2 configure tests (LINUX_INIT_WORK_AS_DATA and +LINUX_IOP_CREATE_TAKES_MODE_T) defined nested functions. Relocate the +nested functions to outside the body of conftest() to avoid compiler +errors due to nested function definitions. + +Reviewed-on: https://gerrit.openafs.org/15614 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 1440843b80e28db908bd8c264b8adbfb2c95b4d9) + +Change-Id: I38acb7b0cb08dec8e9bca5f3792fbf981884a74c +--- + src/cf/linux-test1.m4 | 4 ++-- + src/cf/linux-test4.m4 | 16 ++++++++-------- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 +index 7bb5a677c..010a4464f 100644 +--- a/src/cf/linux-test1.m4 ++++ b/src/cf/linux-test1.m4 +@@ -16,7 +16,7 @@ _ACEOF + /* end confdefs.h */ + #include <linux/module.h> + $1 +- ++void conftest(void); + void conftest(void) + { + $2 +@@ -201,7 +201,7 @@ AC_DEFUN([AC_CHECK_LINUX_OPERATION], + CPPFLAGS="$CPPFLAGS -Werror" + AC_TRY_KBUILD( + [$4 +- $5 op($6) { return ($5)0; };], ++ static $5 op($6) { return ($5)0; };], + [static struct $1 ops; ops.$2 = op;], + AS_VAR_SET([ac_linux_operation], [yes]), + AS_VAR_SET([ac_linux_operation], [no])) +diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 +index 3596b6aad..7889c904a 100644 +--- a/src/cf/linux-test4.m4 ++++ b/src/cf/linux-test4.m4 +@@ -400,9 +400,9 @@ AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [ + AC_CHECK_LINUX_BUILD([whether INIT_WORK has a _data argument], + [ac_cv_linux_init_work_has_data], + [#include <linux/kernel.h> +-#include <linux/workqueue.h>], +-[ +-void f(struct work_struct *w) {} ++#include <linux/workqueue.h> ++static void f(struct work_struct *w) {}], ++[ + struct work_struct *w; + int *i; + INIT_WORK(w,f,i);], +@@ -493,7 +493,7 @@ AC_DEFUN([LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID],[ + AC_CHECK_LINUX_BUILD([whether kmem_cache_create constructor takes a void pointer], + [ac_cv_linux_kmem_cache_create_ctor_takes_void], + [#include <linux/slab.h> +- void _ctor(void *v) { };], ++ static void _ctor(void *v) { };], + [kmem_cache_create(NULL, 0, 0, 0, _ctor);], + [KMEM_CACHE_CTOR_TAKES_VOID], + [define if kmem_cache_create constructor takes a single void ptr], +@@ -667,7 +667,7 @@ AC_DEFUN([LINUX_IOP_GETATTR_TAKES_PATH_STRUCT], [ + AC_CHECK_LINUX_BUILD([whether 4.11+ inode.i_op->getattr takes a struct path argument], + [ac_cv_linux_iop_getattr_takes_path_struct], + [#include <linux/fs.h> +- int _getattr(const struct path *path, struct kstat *stat, u32 request_mask, ++ static int _getattr(const struct path *path, struct kstat *stat, u32 request_mask, + unsigned int sync_mode) {return 0;}; + struct inode_operations _i_ops;], + [_i_ops.getattr = _getattr;], +@@ -692,10 +692,10 @@ AC_DEFUN([LINUX_IOP_MKDIR_TAKES_UMODE_T], [ + AC_DEFUN([LINUX_IOP_CREATE_TAKES_UMODE_T], [ + AC_CHECK_LINUX_BUILD([whether inode.i_op->create takes a umode_t argument], + [ac_cv_linux_iop_create_takes_umode_t], +- [#include <linux/fs.h>], ++ [#include <linux/fs.h> ++ static int _create(struct inode *i, struct dentry *d, umode_t m, struct nameidata *n) ++ {return 0;};], + [static struct inode_operations _i_ops; +- int _create(struct inode *i, struct dentry *d, umode_t m, struct nameidata *n) +- {return 0;}; + _i_ops.create = _create;], + [IOP_CREATE_TAKES_UMODE_T], + [define if inode.i_op->create takes a umode_t argument], +-- +2.44.0 + diff --git a/0006-afs-Remove-DFlushDCache.patch b/0006-afs-Remove-DFlushDCache.patch new file mode 100644 index 000000000000..b49f122e542a --- /dev/null +++ b/0006-afs-Remove-DFlushDCache.patch @@ -0,0 +1,72 @@ +From 177c84e86d65936636a4db5548f4424f04a1b33c Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Fri, 12 Jan 2024 08:56:31 -0700 +Subject: [PATCH 06/29] afs: Remove DFlushDCache() + +The function DFlushDcache() is not referenced anywhere within the +source tree. + +Remove the function DFlushDCache(). + +The commit: 'disconnected-shadow-directory-fixes-20090121' (4045f3d535) +removed the code reference to DFlushDCache() and the commit: +"dir: Prototype and function name cleanup" (5ad1e6cb90) removed the +function prototype. The function was introduced in the commit: +"disconnected-flush-before-shadowing-20090119" (e1cc987ea5). + +This function is flagged due to a missing prototype when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + "Makefile.extrawarn: turn on missing-prototypes globally" (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Reviewed-on: https://gerrit.openafs.org/15615 +Tested-by: Benjamin Kaduk <kaduk@mit.edu> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 432ac5810e51bb5bb2cf1df0bfebc64d1c4d7a39) + +Change-Id: Ib8ab79c76c633632215e02235f47fdb1d744e721 +--- + src/afs/afs_buffer.c | 25 ------------------------- + 1 file changed, 25 deletions(-) + +diff --git a/src/afs/afs_buffer.c b/src/afs/afs_buffer.c +index 5552d1c21..9538c6806 100644 +--- a/src/afs/afs_buffer.c ++++ b/src/afs/afs_buffer.c +@@ -516,31 +516,6 @@ DFlushBuffer(struct buffer *ab) + afs_CFileClose(tfile); + } + +-void +-DFlushDCache(struct dcache *adc) +-{ +- int i; +- struct buffer *tb; +- +- ObtainReadLock(&afs_bufferLock); +- +- for (i = 0; i <= PHPAGEMASK; i++) +- for (tb = phTable[pHash(adc->index, i)]; tb; tb = tb->hashNext) +- if (tb->fid == adc->index) { +- ObtainWriteLock(&tb->lock, 701); +- tb->lockers++; +- ReleaseReadLock(&afs_bufferLock); +- if (tb->dirty) { +- DFlushBuffer(tb); +- } +- tb->lockers--; +- ReleaseWriteLock(&tb->lock); +- ObtainReadLock(&afs_bufferLock); +- } +- +- ReleaseReadLock(&afs_bufferLock); +-} +- + int + DFlush(void) + { +-- +2.44.0 + diff --git a/0007-afs-Remove-afs_MemExtendEntry.patch b/0007-afs-Remove-afs_MemExtendEntry.patch new file mode 100644 index 000000000000..2936ed094d7c --- /dev/null +++ b/0007-afs-Remove-afs_MemExtendEntry.patch @@ -0,0 +1,58 @@ +From ca64798e8baf3378e3cc7a619b9e02a715a39ddc Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Fri, 12 Jan 2024 09:09:39 -0700 +Subject: [PATCH 07/29] afs: Remove afs_MemExtendEntry() + +The function afs_MemExtendEntry() is not referenced anywhere within +the source tree. + +Remove the function afs_MemExtendEntry(). + +The commit: 'memcache: add extend-entry function' (f821c7e5c8) +introduced the function, but afs_MemExtendEntry() has never been +referenced or defined within a header file. + +This function is flagged due to a missing prototype when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Note, afsMemExtendedEntry() was a wrapper for the function +_afs_MemExtendedEntry(), which is still used. + +Reviewed-on: https://gerrit.openafs.org/15616 +Tested-by: Benjamin Kaduk <kaduk@mit.edu> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit eab2a4ae758876bb7547d289f936f9cfc4227cf5) + +Change-Id: I37f241a6df33ab15249c6708d5ca820353c8b413 +--- + src/afs/afs_memcache.c | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/src/afs/afs_memcache.c b/src/afs/afs_memcache.c +index 936cbe927..419083da2 100644 +--- a/src/afs/afs_memcache.c ++++ b/src/afs/afs_memcache.c +@@ -302,16 +302,6 @@ afs_MemCacheTruncate(struct osi_file *fP, int size) + return 0; + } + +-int +-afs_MemExtendEntry(struct memCacheEntry *mceP, afs_uint32 size) +-{ +- int code = 0; +- ObtainWriteLock(&mceP->afs_memLock, 560); +- code = _afs_MemExtendEntry(mceP, size); +- ReleaseWriteLock(&mceP->afs_memLock); +- return code; +-} +- + void + shutdown_memcache(void) + { +-- +2.44.0 + diff --git a/0008-afs-Remove-afs_osi_UnmaskUserLoop.patch b/0008-afs-Remove-afs_osi_UnmaskUserLoop.patch new file mode 100644 index 000000000000..635f1ac7aadf --- /dev/null +++ b/0008-afs-Remove-afs_osi_UnmaskUserLoop.patch @@ -0,0 +1,54 @@ +From fb3a69c84ced6db6aa9aeb506bfb64ac18745a92 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Fri, 12 Jan 2024 09:13:27 -0700 +Subject: [PATCH 08/29] afs: Remove afs_osi_UnmaskUserLoop() + +The function afs_osi_UnmaskUserLoop() is not referenced anywhere within +the source tree. + +Remove the function afs_osi_UnmaskUserLoop(). + +The commit: 'darwin-afsdb-handler-signal-mask-20040728' (9728182c00) +introduced the function, but afs_osi_UnmaskUserLoop() has never been +referenced or defined within a header file. + +This function is flagged due to a missing prototype when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Reviewed-on: https://gerrit.openafs.org/15617 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 587cfce29cb4e014e5b8d96e0433c5e7d2c6729a) + +Change-Id: I0fe91a41e8f00773cb1d5976a8c3e39e4415f6bc +--- + src/afs/afs_osi.c | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c +index 18732d1a3..6f54c63c7 100644 +--- a/src/afs/afs_osi.c ++++ b/src/afs/afs_osi.c +@@ -152,14 +152,6 @@ afs_osi_MaskUserLoop(void) + #endif + } + +-void +-afs_osi_UnmaskUserLoop(void) +-{ +-#ifdef AFS_DARWIN_ENV +- afs_osi_fullSigRestore(); +-#endif +-} +- + /* register rxk listener proc info */ + void + afs_osi_RxkRegister(void) +-- +2.44.0 + diff --git a/0009-afs-Remove-dummy_PSetAcl.patch b/0009-afs-Remove-dummy_PSetAcl.patch new file mode 100644 index 000000000000..647734c08ca2 --- /dev/null +++ b/0009-afs-Remove-dummy_PSetAcl.patch @@ -0,0 +1,51 @@ +From bc446c8fa62df6ce9ab4be50b8b1da54901863ad Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Fri, 12 Jan 2024 09:28:02 -0700 +Subject: [PATCH 09/29] afs: Remove dummy_PSetAcl() + +The function dummy_PSetAcl() is not referenced anywhere within the +source tree. + +Remove the function dummy_PSetAcl(). + +The commit: 'doxygen-comments-20081010' (4b72f8765c) +introduced the function, but dummy_PSetAcl() has never been referenced +or defined within a header file. + +This function is flagged due to a missing prototype when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Reviewed-on: https://gerrit.openafs.org/15618 +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +Tested-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 05ca98687d882c72915e91430e29a4f2a36c502c) + +Change-Id: Ie4420a365e07d2d8564530e004df75330e86bea5 +--- + src/afs/afs_pioctl.c | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/src/afs/afs_pioctl.c b/src/afs/afs_pioctl.c +index 9182a4b52..7ddb5add2 100644 +--- a/src/afs/afs_pioctl.c ++++ b/src/afs/afs_pioctl.c +@@ -1426,12 +1426,6 @@ DECL_PIOCTL(PGetFID) + * + * \post Changed ACL, via direct writing to the wire + */ +-int +-dummy_PSetAcl(char *ain, char *aout) +-{ +- return 0; +-} +- + DECL_PIOCTL(PSetAcl) + { + afs_int32 code; +-- +2.44.0 + diff --git a/0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch b/0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch new file mode 100644 index 000000000000..765c8256492b --- /dev/null +++ b/0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch @@ -0,0 +1,132 @@ +From 2501655e438f65523f5250b26a2074bdbd56bc16 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Thu, 8 Feb 2024 12:22:13 -0700 +Subject: [PATCH 10/29] afs: Remove SRXAFSCB_FetchData/StoreData + +Commit 'client-64bit-file-size-support-20011031' (971b18bc42) introduced +the RPC functions SRXAFSCB_FetchData() and SRXAFSCB_StoreData with RPC +numbers of 65536 and 65537 respectively. + +Commit 'more-64bit-file-size-support-20011031' (c5b1a3775f) removed the +references from afscbint.xg, but did not remove the actual code. The +65536 RPC number was reassigned to SRXAFSCB_GetCE64, and the commit: +'This is mostly a rewrite of src/afs/afs_cell.c, and associated changes' +(629d08065) assigned the 65537 RPC to SRXAFSCB_GetCellByNum. + +Remove the 2 functions since there are no references other than the +prototype in afs_prototypes.h. + +This function is flagged due to a missing prototype when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +Reviewed-on: https://gerrit.openafs.org/15639 +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 379f7fc51d411990189ec28e48c91edc87d76120) + +Change-Id: I1a3539227d22e6df89d78245634dfeb14943035a +--- + src/afs/afs_callback.c | 65 ---------------------------------------- + src/afs/afs_prototypes.h | 7 ----- + 2 files changed, 72 deletions(-) + +diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c +index 22edefb3f..56e8cd2cc 100644 +--- a/src/afs/afs_callback.c ++++ b/src/afs/afs_callback.c +@@ -1472,71 +1472,6 @@ SRXAFSCB_GetCacheConfig(struct rx_call *a_call, afs_uint32 callerVersion, + return 0; + } + +-/*------------------------------------------------------------------------ +- * EXPORTED SRXAFSCB_FetchData +- * +- * Description: +- * Routine to do third party move from a remioserver to the original +- * issuer of an ArchiveData request. Presently supported only by the +- * "fs" command, not by the AFS client. +- * +- * Arguments: +- * rxcall: Ptr to Rx call on which this request came in. +- * Fid: pointer to AFSFid structure. +- * Fd: File descriptor inside fs command. +- * Position: Offset in the file. +- * Length: Data length to transfer. +- * TotalLength: Pointer to total file length field +- * +- * Returns: +- * 0 on success +- * +- * Environment: +- * Nothing interesting. +- * +- * Side Effects: +- *------------------------------------------------------------------------*/ +-int +-SRXAFSCB_FetchData(struct rx_call *rxcall, struct AFSFid *Fid, afs_int32 Fd, +- afs_int64 Position, afs_int64 Length, +- afs_int64 * TotalLength) +-{ +- return ENOSYS; +-} +- +-/*------------------------------------------------------------------------ +- * EXPORTED SRXAFSCB_StoreData +- * +- * Description: +- * Routine to do third party move from a remioserver to the original +- * issuer of a RetrieveData request. Presently supported only by the +- * "fs" command, not by the AFS client. +- * +- * Arguments: +- * rxcall: Ptr to Rx call on which this request came in. +- * Fid: pointer to AFSFid structure. +- * Fd: File descriptor inside fs command. +- * Position: Offset in the file. +- * Length: Data length to transfer. +- * TotalLength: Pointer to total file length field +- * +- * Returns: +- * 0 on success +- * +- * Environment: +- * Nothing interesting. +- * +- * Side Effects: +- * As advertised. +- *------------------------------------------------------------------------*/ +-int +-SRXAFSCB_StoreData(struct rx_call *rxcall, struct AFSFid *Fid, afs_int32 Fd, +- afs_int64 Position, afs_int64 Length, +- afs_int64 * TotalLength) +-{ +- return ENOSYS; +-} +- + /*------------------------------------------------------------------------ + * EXPORTED SRXAFSCB_GetCellByNum + * +diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h +index ed43635aa..208bd0338 100644 +--- a/src/afs/afs_prototypes.h ++++ b/src/afs/afs_prototypes.h +@@ -103,13 +103,6 @@ extern int SRXAFSCB_GetCacheConfig(struct rx_call *a_call, + afs_uint32 * serverVersion, + afs_uint32 * configCount, + cacheConfig * config); +-extern int SRXAFSCB_FetchData(struct rx_call *rxcall, struct AFSFid *Fid, +- afs_int32 Fd, afs_int64 Position, +- afs_int64 Length, afs_int64 * TotalLength); +-extern int SRXAFSCB_StoreData(struct rx_call *rxcall, struct AFSFid *Fid, +- afs_int32 Fd, afs_int64 Position, +- afs_int64 Length, afs_int64 * TotalLength); +- + + /* afs_cbqueue.c */ + extern afs_rwlock_t afs_xcbhash; +-- +2.44.0 + diff --git a/0011-afs-Remove-afs_DbgDisconFiles.patch b/0011-afs-Remove-afs_DbgDisconFiles.patch new file mode 100644 index 000000000000..ca60249b0327 --- /dev/null +++ b/0011-afs-Remove-afs_DbgDisconFiles.patch @@ -0,0 +1,76 @@ +From 3479efd57fb4ca488061301f2770905fd5c1d90f Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Thu, 8 Feb 2024 16:10:57 -0700 +Subject: [PATCH 11/29] afs: Remove afs_DbgDisconFiles() + +The function afs_DbgDisconFiles() is not referenced anywhere within the +source tree. + +Remove the function afs_DbgDisconFiles(). + +The commit: 'disconnected-rw-20080922' (433afd4779) introduced +afs_DbgDisconFiles(), but the function was never used. + +This function is flagged due to a missing prototype when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Reviewed-on: https://gerrit.openafs.org/15640 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 32bb90047782f41df521bba5ab4aba8b4ed34203) + +Change-Id: I61d06515845dbb18a370f7856285596514242e99 +--- + src/afs/afs_disconnected.c | 31 ------------------------------- + 1 file changed, 31 deletions(-) + +diff --git a/src/afs/afs_disconnected.c b/src/afs/afs_disconnected.c +index 3b8858539..1aaabd905 100644 +--- a/src/afs/afs_disconnected.c ++++ b/src/afs/afs_disconnected.c +@@ -1334,37 +1334,6 @@ afs_DisconDiscardAll(afs_ucred_t *acred) + ReleaseWriteLock(&afs_disconDirtyLock); + } + +-/*! +- * Print list of disconnected files. +- * +- * \note Call with afs_DDirtyVCListLock read locked. +- */ +-void +-afs_DbgDisconFiles(void) +-{ +- struct vcache *tvc; +- struct afs_q *q; +- int i = 0; +- +- afs_warn("List of dirty files: \n"); +- +- ObtainReadLock(&afs_disconDirtyLock); +- for (q = QPrev(&afs_disconDirty); q != &afs_disconDirty; q = QPrev(q)) { +- tvc = QEntry(q, struct vcache, dirtyq); +- +- afs_warn("Cell=%u Volume=%u VNode=%u Unique=%u\n", +- tvc->f.fid.Cell, +- tvc->f.fid.Fid.Volume, +- tvc->f.fid.Fid.Vnode, +- tvc->f.fid.Fid.Unique); +- +- i++; +- if (i >= 30) +- osi_Panic("afs_DbgDisconFiles: loop in dirty list\n"); +- } +- ReleaseReadLock(&afs_disconDirtyLock); +-} +- + /*! + * Generate a fake fid for a disconnected shadow dir. + * Similar to afs_GenFakeFid, only that it uses the dhash +-- +2.44.0 + diff --git a/0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch b/0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch new file mode 100644 index 000000000000..e203a16db82a --- /dev/null +++ b/0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch @@ -0,0 +1,48 @@ +From ae193277f1e2af7137e86ab5e96673c6d9fae217 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Fri, 12 Jan 2024 15:52:57 -0700 +Subject: [PATCH 12/29] afs: Add declaration for RXAFS_ResidencyCmd() + +The function RXAFS_ResidencyCmd() is 'manually' defined within the +afsint.xg, so a prototype for the function is not defined. + +This function is flagged due to a missing prototype when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Add a prototype for RXAFS_ResidencyCmd + +There are no functional changes with this commit + +The function RXAFS_ResidencyCmd() was introduced with commit: +'rename-residency-from-mrafs-to-osd-20090427' (8655541d1e) + +Reviewed-on: https://gerrit.openafs.org/15619 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 1d6cfbc5f627abf3808aae97afb72662301483b5) + +Change-Id: I42d0868b83e119b0c3348a3af8aaf5961c040bb2 +--- + src/fsint/afsint.xg | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/fsint/afsint.xg b/src/fsint/afsint.xg +index 9fe4980c6..cdcd07a29 100644 +--- a/src/fsint/afsint.xg ++++ b/src/fsint/afsint.xg +@@ -664,6 +664,7 @@ FsCmd( + ) = 220; + + #ifdef RPC_CLIENT ++%int RXAFS_ResidencyCmd(struct rx_connection *z_conn, AFSFid *Fid, struct FsCmdInputs *Inputs, struct FsCmdOutputs *Outputs); + %int RXAFS_ResidencyCmd(struct rx_connection *z_conn, AFSFid *Fid, struct FsCmdInputs *Inputs, struct FsCmdOutputs *Outputs) + %{ + % return RXAFS_FsCmd(z_conn, Fid, Inputs, Outputs); +-- +2.44.0 + diff --git a/0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch b/0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch new file mode 100644 index 000000000000..40a1c0609fca --- /dev/null +++ b/0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch @@ -0,0 +1,95 @@ +From e5d980ec4a4d41f965fcfe968a2cf00e0b99a3e1 Mon Sep 17 00:00:00 2001 +From: Andrew Deason <adeason@sinenomine.net> +Date: Tue, 30 Jan 2024 20:44:48 -0600 +Subject: [PATCH 13/29] roken: Declare ct_memcmp in hcrypto kernel roken.h + +Currently, we build roken's ct.c for our kernel module to provide +ct_memcmp(). We declare a prototype for ct_memcmp() in krb5_locl.h, +and all of our kernel callers of ct_memcmp() include krb5_locl.h, so +all callers get a prototype and avoid "implicit declaration" compiler +warnings. + +However, roken's ct.c itself does not include krb5_locl.h, so it +doesn't get a prototype for ct_memcmp(). This is dangerous, since if +the prototype ever slightly differs from the implementation for any +reason, it could cause a variety of issues. + +This also causes warnings when building against a Linux 6.8 kernel +(which sets the -Wmissing-declarations and -Wmissing-prototypes +compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +We cannot change ct.c, since it is an external source file. To fix +this, instead move the prototype of ct_memcmp() to our stub +kernel-only roken.h header, which is included by ct.c. Make +krb5_locl.h also include roken.h when building kernel code, so all of +the ct_memcmp() callers also get the prototype. + +While we're here, add some informative comments and an include guard +to our previously-blank roken.h stub. + +Written in collaboration with cwills@sinenomine.net. + +Reviewed-on: https://gerrit.openafs.org/15620 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit be236069e9d26339ed5f9939965bca0dd3f8bf4e) + +Change-Id: I1112881938b0585263871f8f83d63b8909b12f0d +--- + src/crypto/hcrypto/kernel/roken.h | 17 +++++++++++++++++ + src/crypto/rfc3961/krb5_locl.h | 6 +----- + 2 files changed, 18 insertions(+), 5 deletions(-) + +diff --git a/src/crypto/hcrypto/kernel/roken.h b/src/crypto/hcrypto/kernel/roken.h +index e69de29bb..f8c233468 100644 +--- a/src/crypto/hcrypto/kernel/roken.h ++++ b/src/crypto/hcrypto/kernel/roken.h +@@ -0,0 +1,17 @@ ++#ifndef OPENAFS_HCRYPTO_KERNEL_ROKEN_H ++#define OPENAFS_HCRYPTO_KERNEL_ROKEN_H ++ ++/* ++ * This is a stub roken.h used for building roken code (or roken-using code) in ++ * the kernel. For userspace code, use a real roken.h. This just contains a few ++ * prototypes of roken functions we actually use in kernel code. ++ */ ++ ++#ifndef KERNEL ++# error "This header is for kernel code only" ++#endif ++ ++/* ct.c */ ++int ct_memcmp(const void *p1, const void *p2, size_t len); ++ ++#endif /* OPENAFS_HCRYPTO_KERNEL_ROKEN_H */ +diff --git a/src/crypto/rfc3961/krb5_locl.h b/src/crypto/rfc3961/krb5_locl.h +index eb279a95f..6e706737c 100644 +--- a/src/crypto/rfc3961/krb5_locl.h ++++ b/src/crypto/rfc3961/krb5_locl.h +@@ -5,6 +5,7 @@ + #ifdef KERNEL + + #include "config.h" ++#include <roken.h> + + #else + #include <afsconfig.h> +@@ -285,11 +286,6 @@ int copy_EncryptionKey(const krb5_keyblock *, krb5_keyblock *); + krb5_error_code krb5_enctype_to_string(krb5_context context, + krb5_enctype etype, + char **string); +-#ifdef KERNEL +-/* Roken provides this in userspace, but we're on our own in the kernel. */ +-int ct_memcmp(const void *p1, const void *p2, size_t len); +-#endif +- + + #include "crypto.h" + +-- +2.44.0 + diff --git a/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch b/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch new file mode 100644 index 000000000000..b43c366dcd0d --- /dev/null +++ b/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch @@ -0,0 +1,182 @@ +From e8e23ccf9d81e5c7df49d4e28441d7c986e47886 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Wed, 7 Feb 2024 15:25:10 -0700 +Subject: [PATCH 14/29] Linux 6.8: Add function prototypes for krb5 + +The external files for heimdal/krb5 do not provide function prototypes +in a header file that is used when building files that we use from +heimdal/krb5 (e.g. crypto.c). + +These functions are flagged due to missing prototypes when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +We cannot modify the external source files, however there is the local +OpenAFS include file, krb5_locl.h, that does contain OpenAFS specific +changes. + +Add declarations to krb5_locl.h for the functions defined in the +heimdal/krb5 source. + +There are no functional changes with this commit. + +Reviewed-on: https://gerrit.openafs.org/15621 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 612927dd1dd44bbd08eda790de12b24213583156) + +Change-Id: Iaae28186a24c3c5ca4407de9563c8cfed9644921 +--- + src/crypto/rfc3961/krb5_locl.h | 132 +++++++++++++++++++++++++++++++++ + 1 file changed, 132 insertions(+) + +diff --git a/src/crypto/rfc3961/krb5_locl.h b/src/crypto/rfc3961/krb5_locl.h +index 6e706737c..04292eefa 100644 +--- a/src/crypto/rfc3961/krb5_locl.h ++++ b/src/crypto/rfc3961/krb5_locl.h +@@ -287,6 +287,138 @@ krb5_error_code krb5_enctype_to_string(krb5_context context, + krb5_enctype etype, + char **string); + ++/* ++ * Unused prototypes from heimdal/krb5. These are functions that are not used ++ * outside of their compilation unit at all, but we may need to declare them to ++ * avoid compiler warnings. ++ */ ++struct _krb5_key_data; ++struct _krb5_encryption_type; ++/* heimdal/krb5/crypto.c */ ++KRB5_LIB_FUNCTION krb5_error_code _krb5_derive_key(krb5_context context, ++ struct _krb5_encryption_type *et, ++ struct _krb5_key_data *key, ++ const void *constant, ++ size_t len); ++KRB5_LIB_FUNCTION krb5_error_code krb5_allow_weak_crypto(krb5_context context, ++ krb5_boolean enable); ++KRB5_LIB_FUNCTION krb5_error_code krb5_checksum_disable(krb5_context context, ++ krb5_cksumtype type); ++KRB5_LIB_FUNCTION krb5_boolean krb5_checksum_is_keyed(krb5_context context, ++ krb5_cksumtype type); ++KRB5_LIB_FUNCTION krb5_error_code krb5_cksumtype_valid(krb5_context context, ++ krb5_cksumtype ctype); ++KRB5_LIB_FUNCTION krb5_error_code krb5_create_checksum_iov(krb5_context context, ++ krb5_crypto crypto, ++ unsigned usage, ++ krb5_crypto_iov *data, ++ unsigned int num_data, ++ krb5_cksumtype *type); ++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getblocksize(krb5_context context, ++ krb5_crypto crypto, ++ size_t *blocksize); ++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getenctype(krb5_context context, ++ krb5_crypto crypto, ++ krb5_enctype *enctype); ++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getpadsize(krb5_context context, ++ krb5_crypto crypto, ++ size_t *padsize); ++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_length(krb5_context context, ++ krb5_crypto crypto, ++ int type, ++ size_t *len); ++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_length_iov(krb5_context context, ++ krb5_crypto crypto, ++ krb5_crypto_iov *data, ++ unsigned int num_data); ++KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_iov_ivec(krb5_context context, ++ krb5_crypto crypto, ++ unsigned usage, ++ krb5_crypto_iov *data, ++ unsigned int num_data, ++ void *ivec); ++KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_ivec(krb5_context context, ++ krb5_crypto crypto, ++ unsigned usage, ++ void *data, ++ size_t len, ++ krb5_data *result, ++ void *ivec); ++KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_iov_ivec(krb5_context context, ++ krb5_crypto crypto, ++ unsigned usage, ++ krb5_crypto_iov *data, ++ int num_data, ++ void *ivec); ++KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_ivec(krb5_context context, ++ krb5_crypto crypto, ++ unsigned usage, ++ const void *data, ++ size_t len, ++ krb5_data *result, ++ void *ivec); ++KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_disable(krb5_context context, ++ krb5_enctype enctype); ++KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_enable(krb5_context context, ++ krb5_enctype enctype); ++KRB5_LIB_FUNCTION krb5_error_code krb5_enctype_to_keytype(krb5_context context, ++ krb5_enctype etype, ++ krb5_keytype *keytype); ++KRB5_LIB_FUNCTION size_t krb5_get_wrapped_length (krb5_context context, ++ krb5_crypto crypto, ++ size_t data_len); ++KRB5_LIB_FUNCTION krb5_error_code krb5_hmac(krb5_context context, ++ krb5_cksumtype cktype, ++ const void *data, ++ size_t len, ++ unsigned usage, ++ krb5_keyblock *key, ++ Checksum *result); ++KRB5_LIB_FUNCTION krb5_boolean krb5_is_enctype_weak(krb5_context context, ++ krb5_enctype enctype); ++KRB5_LIB_FUNCTION krb5_error_code krb5_string_to_enctype(krb5_context context, ++ const char *string, ++ krb5_enctype *etype); ++KRB5_LIB_FUNCTION krb5_error_code krb5_verify_checksum_iov(krb5_context context, ++ krb5_crypto crypto, ++ unsigned usage, ++ krb5_crypto_iov *data, ++ unsigned int num_data, ++ krb5_cksumtype *type); ++KRB5_LIB_FUNCTION krb5_error_code krb5_generate_random_keyblock(krb5_context context, ++ krb5_enctype type, ++ krb5_keyblock *key); ++KRB5_LIB_FUNCTION krb5_boolean krb5_checksum_is_collision_proof(krb5_context context, ++ krb5_cksumtype type); ++ ++KRB5_LIB_FUNCTION krb5_error_code krb5_cksumtype_to_enctype(krb5_context context, ++ krb5_cksumtype ctype, ++ krb5_enctype *etype); ++KRB5_LIB_FUNCTION krb5_error_code krb5_encrypt_EncryptedData(krb5_context context, ++ krb5_crypto crypto, ++ unsigned usage, ++ void *data, ++ size_t len, ++ int kvno, ++ EncryptedData *result); ++KRB5_LIB_FUNCTION krb5_error_code krb5_crypto_getconfoundersize(krb5_context context, ++ krb5_crypto crypto, ++ size_t *confoundersize); ++ ++KRB5_LIB_FUNCTION krb5_error_code krb5_decrypt_EncryptedData(krb5_context context, ++ krb5_crypto crypto, ++ unsigned usage, ++ const EncryptedData *e, ++ krb5_data *result); ++/* heimdal/krb5/data.c */ ++KRB5_LIB_FUNCTION krb5_error_code krb5_data_realloc(krb5_data *p, int len); ++KRB5_LIB_FUNCTION krb5_error_code krb5_copy_data(krb5_context context, ++ const krb5_data *indata, ++ krb5_data **outdata); ++KRB5_LIB_FUNCTION int krb5_data_cmp(const krb5_data *data1, const krb5_data *data2); ++/* heimdal/krb5/store-int.c */ ++KRB5_LIB_FUNCTION krb5_ssize_t _krb5_get_int(void *buffer, unsigned long *value, size_t size); ++ + #include "crypto.h" + + struct _krb5_checksum_type * _krb5_find_checksum (krb5_cksumtype); +-- +2.44.0 + diff --git a/0015-afs-Declare-init_hckernel_mutex.patch b/0015-afs-Declare-init_hckernel_mutex.patch new file mode 100644 index 000000000000..db31b6cc0a48 --- /dev/null +++ b/0015-afs-Declare-init_hckernel_mutex.patch @@ -0,0 +1,63 @@ +From c3f5353b03396d89b2a1595ca3a38d4312cb62cf Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Thu, 8 Feb 2024 11:50:16 -0700 +Subject: [PATCH 15/29] afs: Declare init_hckernel_mutex() + +The function init_hckernel_mutex() (in rand.c) is flagged due to a +missing prototype when building against a Linux 6.8 kernel (which sets +the -Wmissing-declarations and -Wmissing-prototypes compiler flags as +default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Add a function prototype for init_hckernel_mutex() to afs_osi.h and +remove the prototype from afs_osi.c + +There are no functional changes with this commit. + +Reviewed-on: https://gerrit.openafs.org/15622 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit ccc2af429710104793fb4659b10697cceab182b3) + +Change-Id: Ic5eb4584a980657a01a1cb4411c0c1f03b1f3560 +--- + src/afs/afs_osi.c | 5 ----- + src/afs/afs_osi.h | 5 +++++ + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c +index 6f54c63c7..e8f852e2e 100644 +--- a/src/afs/afs_osi.c ++++ b/src/afs/afs_osi.c +@@ -25,11 +25,6 @@ + * -- On HP called from afsc_link. + * -- On SGI called from afs_init. */ + +-/* No hckernel-specific header for this prototype. */ +-#ifndef UKERNEL +-extern void init_hckernel_mutex(void); +-#endif +- + afs_lock_t afs_ftf; /* flush text lock */ + + #ifdef AFS_SGI_ENV +diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h +index 79c44a985..e3f0e0ccb 100644 +--- a/src/afs/afs_osi.h ++++ b/src/afs/afs_osi.h +@@ -458,4 +458,9 @@ extern int osi_ShouldDeferRemunlink(struct vcache *avc); + # define osi_ShouldDeferRemunlink(avc) 0 + #endif + ++/* No hckernel-specific header for this prototype. */ ++#ifndef UKERNEL ++extern void init_hckernel_mutex(void); ++#endif ++ + #endif /* _AFS_OSI_ */ +-- +2.44.0 + diff --git a/0016-afs-Add-includes-to-pick-up-function-prototypes.patch b/0016-afs-Add-includes-to-pick-up-function-prototypes.patch new file mode 100644 index 000000000000..f8cce55804f2 --- /dev/null +++ b/0016-afs-Add-includes-to-pick-up-function-prototypes.patch @@ -0,0 +1,120 @@ +From 5e3f30520ee000690b7097bdea7d3f35fe0fcfd3 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Mon, 12 Feb 2024 08:25:47 -0700 +Subject: [PATCH 16/29] afs: Add includes to pick up function prototypes + +The functions defined in LINUX/osi_crypto.c, osi_pagecopy.c, +osi_probe.c, and osi_syscall.c have function prototypes defined in +existing header files, however either due to missing includes or +preprocessor conditionals that skip the includes, these function +prototypes are not being pulled in. + +These functions are flagged due to missing prototypes when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Add the necessary includes to osi_crypto.c and osi_pagecopy.c and +re-arrange the includes in osi_probe.c and osi_syscall.c to ensure that +the function prototypes are present when building the Linux kernel +module. + +Reviewed-on: https://gerrit.openafs.org/15641 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 3683f15278e34e13d7272928eaf666f0acc4e1e9) + +Change-Id: Iac704fc98d0d685358224049f383d68aa7a105f8 +--- + src/afs/LINUX/osi_crypto.c | 3 +++ + src/afs/LINUX/osi_pagecopy.c | 1 + + src/afs/LINUX/osi_probe.c | 8 ++++---- + src/afs/LINUX/osi_syscall.c | 7 ++++--- + 4 files changed, 12 insertions(+), 7 deletions(-) + +diff --git a/src/afs/LINUX/osi_crypto.c b/src/afs/LINUX/osi_crypto.c +index ead19161c..7f8435c65 100644 +--- a/src/afs/LINUX/osi_crypto.c ++++ b/src/afs/LINUX/osi_crypto.c +@@ -25,6 +25,9 @@ + #include <afsconfig.h> + #include "afs/param.h" + ++#include "afs/sysincludes.h" ++#include "afsincludes.h" ++ + #include <linux/random.h> + + int +diff --git a/src/afs/LINUX/osi_pagecopy.c b/src/afs/LINUX/osi_pagecopy.c +index 7142a1b06..42f5e38e0 100644 +--- a/src/afs/LINUX/osi_pagecopy.c ++++ b/src/afs/LINUX/osi_pagecopy.c +@@ -61,6 +61,7 @@ + #include <linux/wait.h> + #include <linux/workqueue.h> + #include <linux/slab.h> ++#include "osi_pagecopy.h" + + static DECLARE_WAIT_QUEUE_HEAD (afs_pagecopy_wq); + static spinlock_t afs_pagecopy_lock; +diff --git a/src/afs/LINUX/osi_probe.c b/src/afs/LINUX/osi_probe.c +index 9b06fa7b1..be42ecf85 100644 +--- a/src/afs/LINUX/osi_probe.c ++++ b/src/afs/LINUX/osi_probe.c +@@ -48,9 +48,13 @@ + #ifdef OSI_PROBE_STANDALONE + # define OSI_PROBE_DEBUG + #endif ++ + #ifndef OSI_PROBE_STANDALONE + # include <afsconfig.h> + # include "afs/param.h" ++ ++# include "afs/sysincludes.h" ++# include "afsincludes.h" + #endif + + #include <linux/version.h> +@@ -61,10 +65,6 @@ + /* Slightly kludgy, but too bad */ + #define scsi_command_size scsi_command_size_tbl + #endif +-#ifndef OSI_PROBE_STANDALONE +-# include "afs/sysincludes.h" +-# include "afsincludes.h" +-#endif + #include <linux/sched.h> + #ifdef HAVE_LINUX_CONFIG_H + # include <linux/config.h> +diff --git a/src/afs/LINUX/osi_syscall.c b/src/afs/LINUX/osi_syscall.c +index 836491c29..5e9e5194a 100644 +--- a/src/afs/LINUX/osi_syscall.c ++++ b/src/afs/LINUX/osi_syscall.c +@@ -14,6 +14,10 @@ + #include <afsconfig.h> + #include "afs/param.h" + ++#include <linux/module.h> /* early to avoid printf->printk mapping */ ++#include "afs/sysincludes.h" ++#include "afsincludes.h" ++ + #ifdef LINUX_KEYRING_SUPPORT + /* The syscall probing stuff is unnecessary (and is never called) if we have + * keyrings support; we rely on keyrings instead of group ids to track PAGs. +@@ -31,9 +35,6 @@ osi_syscall_clean(void) + + #else /* LINUX_KEYRING_SUPPORT */ + +-#include <linux/module.h> /* early to avoid printf->printk mapping */ +-#include "afs/sysincludes.h" +-#include "afsincludes.h" + #include <linux/unistd.h> /* For syscall numbers. */ + #include <linux/mm.h> + +-- +2.44.0 + diff --git a/0017-afs-Move-function-prototypes-into-headers.patch b/0017-afs-Move-function-prototypes-into-headers.patch new file mode 100644 index 000000000000..81d2767af097 --- /dev/null +++ b/0017-afs-Move-function-prototypes-into-headers.patch @@ -0,0 +1,144 @@ +From 1505e0d19cba9b66d0e357f6eafdde15f638eb2e Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Thu, 15 Feb 2024 09:00:05 -0700 +Subject: [PATCH 17/29] afs: Move function prototypes into headers + +Several .c files contain external function prototypes, while the +implementing files do not have these prototypes. + +Move these prototypes into header files so that the prototypes are +available to both the caller and the implementation. + +Because the file holding the implementation does not have prototypes, +these functions are flagged when building against a Linux 6.8 kernel +(which sets the -Wmissing-declarations and -Wmissing-prototypes compiler +flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Add the prototypes for the following to afs_prototypes.h: + exporter_add + afs_syscall (AFS_LINUX_ENV) + BlobScan + +Remove the prototypes from the .c files where they are referenced. + +Reviewed-on: https://gerrit.openafs.org/15642 +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 85781d7e83ae4501d8ab267bf55ef63f90f63101) + +Change-Id: I74333e99e08af88bebdcbff4767d79397acac358 +--- + src/afs/LINUX/osi_ioctl.c | 3 --- + src/afs/LINUX/osi_syscall.c | 3 --- + src/afs/LINUX/osi_vnodeops.c | 2 -- + src/afs/VNOPS/afs_vnop_lookup.c | 2 -- + src/afs/afs_nfsclnt.c | 1 - + src/afs/afs_prototypes.h | 7 +++++++ + 6 files changed, 7 insertions(+), 11 deletions(-) + +diff --git a/src/afs/LINUX/osi_ioctl.c b/src/afs/LINUX/osi_ioctl.c +index fbdee29cb..3e797745c 100644 +--- a/src/afs/LINUX/osi_ioctl.c ++++ b/src/afs/LINUX/osi_ioctl.c +@@ -34,9 +34,6 @@ + + extern struct proc_dir_entry *openafs_procfs; + +-extern asmlinkage long +-afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4); +- + static int + afs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +diff --git a/src/afs/LINUX/osi_syscall.c b/src/afs/LINUX/osi_syscall.c +index 5e9e5194a..dc78da874 100644 +--- a/src/afs/LINUX/osi_syscall.c ++++ b/src/afs/LINUX/osi_syscall.c +@@ -91,9 +91,6 @@ osi_syscall_clean(void) + + + /***** ALL PLATFORMS *****/ +-extern asmlinkage long +-afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4); +- + static SYSCALLTYPE *afs_sys_call_table; + static SYSCALLTYPE afs_ni_syscall = 0; + +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index 7e85aa552..08fccb1b2 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -407,8 +407,6 @@ afs_linux_write(struct file *fp, const char *buf, size_t count, loff_t * offp) + } + #endif + +-extern int BlobScan(struct dcache * afile, afs_int32 ablob, afs_int32 *ablobOut); +- + /* This is a complete rewrite of afs_readdir, since we can make use of + * filldir instead of afs_readdir_move. Note that changes to vcache/dcache + * handling and use of bulkstats will need to be reflected here as well. +diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c +index e1796c54f..0fbe4e8f9 100644 +--- a/src/afs/VNOPS/afs_vnop_lookup.c ++++ b/src/afs/VNOPS/afs_vnop_lookup.c +@@ -667,8 +667,6 @@ afs_CheckBulkStatus(struct afs_conn *tc, int nFids, AFSBulkStats *statParm, + return 0; + } + +-extern int BlobScan(struct dcache * afile, afs_int32 ablob, afs_int32 *ablobOut); +- + /* called with an unlocked directory and directory cookie. Areqp + * describes who is making the call. + * Scans the next N (about 30, typically) directory entries, and does +diff --git a/src/afs/afs_nfsclnt.c b/src/afs/afs_nfsclnt.c +index fbb5006ce..4c7806d24 100644 +--- a/src/afs/afs_nfsclnt.c ++++ b/src/afs/afs_nfsclnt.c +@@ -160,7 +160,6 @@ afs_nfsclient_init(void) + osi_Assert(ISAFS_GLOCK()); + #endif + if (!init_nfsexporter) { +- extern struct afs_exporter *exporter_add(); + + init_nfsexporter = 1; + LOCK_INIT(&afs_xnfspag, "afs_xnfspag"); +diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h +index 208bd0338..9b3b1afec 100644 +--- a/src/afs/afs_prototypes.h ++++ b/src/afs/afs_prototypes.h +@@ -331,6 +331,8 @@ extern void init_sys_error_to_et(void); + + /* afs_exporter.c */ + extern struct afs_exporter *root_exported; ++extern struct afs_exporter * exporter_add(afs_int32 size, struct exporterops *ops, ++ afs_int32 state, afs_int32 type, char *data); + extern struct afs_exporter *exporter_find(int type); + extern void shutdown_exporter(void); + +@@ -923,6 +925,10 @@ extern int afs3_syscall(afs_proc_t *p, void *args, long *retval); + extern int Afs_syscall(void); + #endif + ++#if defined(AFS_LINUX_ENV) ++extern asmlinkage long afs_syscall(long syscall, long parm1, long parm2, long parm3, long parm4); ++#endif ++ + /* afs_tokens.c */ + struct ktc_tokenUnion; + struct ktc_setTokenData; +@@ -1292,6 +1298,7 @@ extern void afs_PrefetchChunk(struct vcache *avc, struct dcache *adc, + + /* VNOPS/afs_vnop_readdir.c */ + extern int afs_rd_stash_i; ++extern int BlobScan(struct dcache * afile, afs_int32 ablob, int *ablobOut); + #if defined(AFS_SUN5_ENV) || defined(AFS_SGI_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV) + extern int afs_readdir(OSI_VC_DECL(avc), struct uio *auio, + afs_ucred_t *acred, int *eofp); +-- +2.44.0 + diff --git a/0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch b/0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch new file mode 100644 index 000000000000..e6849d8433bf --- /dev/null +++ b/0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch @@ -0,0 +1,162 @@ +From 3c7e96e5c163597ec65d238d3357881346ab2dd3 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Mon, 12 Feb 2024 08:59:32 -0700 +Subject: [PATCH 18/29] afs: Add afs_xioctl prototyes to afs_prototypes.h + +Several .c files have external function prototypes for the afs_xioctl +function, while the implementing files do not have the prototype. + +Move these prototypes into afs_prototypes.h so that the prototypes are +available to both the caller and the implementation. + +Because the file holding the implementation does not have a prototypes, +afs_xioctl() is being flagged when building against a Linux 6.8 kernel +(which sets the -Wmissing-declarations and -Wmissing-prototypes compiler +flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a Linux kernel with CONFIG_WERROR=y, the build +fails. + +Note that the function afs_xioctl() has platform specific +implementations. + +Reviewed-on: https://gerrit.openafs.org/15643 +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 575d986aa6c18ac27ea42fb66ae8b8cb0e27fe6c) + +Change-Id: If746111fdcf6a00459f524711623d322d5fc7942 +--- + src/afs/FBSD/osi_vfsops.c | 1 - + src/afs/HPUX/osi_vfsops.c | 2 +- + src/afs/LINUX/osi_vnodeops.c | 4 ---- + src/afs/NBSD/osi_kmod.c | 1 - + src/afs/NBSD/osi_vfsops.c | 1 - + src/afs/OBSD/osi_vfsops.c | 2 +- + src/afs/SOLARIS/osi_vfsops.c | 1 - + src/afs/afs_prototypes.h | 17 +++++++++++++++++ + 8 files changed, 19 insertions(+), 10 deletions(-) + +diff --git a/src/afs/FBSD/osi_vfsops.c b/src/afs/FBSD/osi_vfsops.c +index 6044bbed1..8a979db6d 100644 +--- a/src/afs/FBSD/osi_vfsops.c ++++ b/src/afs/FBSD/osi_vfsops.c +@@ -18,7 +18,6 @@ struct mount *afs_globalVFS = NULL; + int afs_pbuf_freecnt = -1; + + extern int Afs_xsetgroups(); +-extern int afs_xioctl(); + + static struct syscall_helper_data afs_syscalls[] = { + { +diff --git a/src/afs/HPUX/osi_vfsops.c b/src/afs/HPUX/osi_vfsops.c +index 0ddc227c7..46faca743 100644 +--- a/src/afs/HPUX/osi_vfsops.c ++++ b/src/afs/HPUX/osi_vfsops.c +@@ -290,7 +290,7 @@ int afs_vfs_slot = -1; + + afsc_link() + { +- extern int Afs_syscall(), afs_xioctl(), Afs_xsetgroups(); ++ extern int Afs_syscall(), Afs_xsetgroups(); + + /* For now nothing special is required during AFS initialization. */ + AFS_STATCNT(afsc_link); +diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c +index 08fccb1b2..8aeeafa9b 100644 +--- a/src/afs/LINUX/osi_vnodeops.c ++++ b/src/afs/LINUX/osi_vnodeops.c +@@ -613,10 +613,6 @@ out1: + } + + +-/* in afs_pioctl.c */ +-extern int afs_xioctl(struct inode *ip, struct file *fp, unsigned int com, +- unsigned long arg); +- + static long afs_unlocked_xioctl(struct file *fp, unsigned int com, + unsigned long arg) { + return afs_xioctl(FILE_INODE(fp), fp, com, arg); +diff --git a/src/afs/NBSD/osi_kmod.c b/src/afs/NBSD/osi_kmod.c +index f6585651e..eefaf5617 100644 +--- a/src/afs/NBSD/osi_kmod.c ++++ b/src/afs/NBSD/osi_kmod.c +@@ -44,7 +44,6 @@ + #include "afs/afsincludes.h" /* Afs-based standard headers */ + + extern int afs3_syscall(struct lwp *, const void *, register_t *); +-extern int afs_xioctl(struct lwp *, const void *, register_t *); + extern int Afs_xsetgroups(struct lwp *, const void *, register_t *); + + #if !defined(AFS_NBSD60_ENV) +diff --git a/src/afs/NBSD/osi_vfsops.c b/src/afs/NBSD/osi_vfsops.c +index 7679ff169..5032a1dd9 100644 +--- a/src/afs/NBSD/osi_vfsops.c ++++ b/src/afs/NBSD/osi_vfsops.c +@@ -110,7 +110,6 @@ VFS_PROTOS(afs); + #ifndef AFS_NBSD60_ENV + extern int sys_lkmnosys(struct lwp *, const void *, register_t *); + extern int afs3_syscall(struct lwp *, const void *, register_t *); +-extern int afs_xioctl(struct lwp *, const void *, register_t *); + extern int Afs_xsetgroups(struct lwp *, const void *, register_t *); + static int afs_badcall(struct lwp *, const void *, register_t *); + +diff --git a/src/afs/OBSD/osi_vfsops.c b/src/afs/OBSD/osi_vfsops.c +index 830906cc3..e7729261e 100644 +--- a/src/afs/OBSD/osi_vfsops.c ++++ b/src/afs/OBSD/osi_vfsops.c +@@ -108,7 +108,7 @@ NONINFRINGEMENT. + /* from /usr/src/sys/kern/vfs_subr.c */ + extern void insmntque(struct vnode *, struct mount *); + +-extern int sys_lkmnosys(), afs_xioctl(), Afs_xsetgroups(); ++extern int sys_lkmnosys(), Afs_xsetgroups(); + + static int lkmid = -1; + static int afs_badcall(struct proc *p, void *xx, register_t * yy); +diff --git a/src/afs/SOLARIS/osi_vfsops.c b/src/afs/SOLARIS/osi_vfsops.c +index c6c9ddf56..f3f9bd33c 100644 +--- a/src/afs/SOLARIS/osi_vfsops.c ++++ b/src/afs/SOLARIS/osi_vfsops.c +@@ -389,7 +389,6 @@ afsinit(int fstype, char *dummy) + afsinit(struct vfssw *vfsswp, int fstype) + #endif + { +- extern int afs_xioctl(); + extern int afs_xsetgroups(); + + AFS_STATCNT(afsinit); +diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h +index 9b3b1afec..d7894dd67 100644 +--- a/src/afs/afs_prototypes.h ++++ b/src/afs/afs_prototypes.h +@@ -812,6 +812,23 @@ extern int afs_syscall_pioctl(char *path, unsigned int com, caddr_t cmarg, + extern int HandleIoctl(struct vcache *avc, afs_int32 acom, + struct afs_ioctl *adata); + ++#if defined(AFS_SUN5_ENV) ++struct afs_ioctl_sys; ++extern int afs_xioctl(struct afs_ioctl_sys *uap, rval_t *rvp); ++#elif defined(AFS_LINUX_ENV) ++extern int afs_xioctl(struct inode *ip, struct file *fp, unsigned int com, unsigned long arg); ++#elif defined(AFS_DAWRIN_ENV) & !defined(AFS_DARWIN80) ++extern int afs_xioctl(afs_proc_t *p, struct ioctl_args *uap, register_t *retval); ++#elif defined(AFS_FBSD_ENV) ++extern int afs_xioctl(struct thread *td, struct ioctl_args *uap, register_t *retval); ++#elif defined(AFS_NBSD_ENV) ++extern int afs_xioctl(afs_proc_t *p, const struct sys_ioctl_args *uap, register_t *retval); ++#elif defined(AFS_XBSD_ENV) ++extern int afs_xioctl(afs_proc_t *p, const struct ioctl_args *uap, register_t *retval); ++#elif defined(UKERNEL) ++extern int afs_xioctl(void); ++#endif ++ + + /* afs_segments.c */ + extern int afs_StoreAllSegments(struct vcache *avc, +-- +2.44.0 + diff --git a/0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch b/0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch new file mode 100644 index 000000000000..ef297f01673e --- /dev/null +++ b/0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch @@ -0,0 +1,106 @@ +From 93669f535752e759b820a21883a6a8c6fba4e73e Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Mon, 12 Feb 2024 09:43:29 -0700 +Subject: [PATCH 19/29] afs: Remove SRXAFSCB* protos from afs_prototypes.h + +The prototypes for the afscbint RPC functions (SRXAFSCB_*) implemented +in afs_callback.c are defined in 2 locations, afs_protypes.h and +afscbint.h (which is generated by rxgen). + +Remove the protoypes for the SRXAFSCB_* functions from afs_prototypes.h +as they are redundant and are currently out of sync (the prototypes +for SRXAFSCB_GetCellByNum() and SRXAFSCB_TellMeAboutYourself() are +not present in afs_prototypes.h). Also remove a redundant prototype for +afs_RXCallBackServer() which was prototyped both before and in the +middle of the SRXAFSCB* prototypes. + +Since afs_callback.c only pulled in afs_prototypes.h and not afscbint.h, +add an include for afscbint.h to ensure that the all the prototypes for +the SRXAFSCB_* functions are present. + +The 2 functions listed above are flagged due to missing prototypes when +building against a Linux 6.8 kernel (which sets the +-Wmissing-declarations and -Wmissing-prototypes compiler flags as +default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +Reviewed-on: https://gerrit.openafs.org/15644 +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Tested-by: Benjamin Kaduk <kaduk@mit.edu> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit fae4003b403420d0b548920c7837a2d2b6e432ae) + +Change-Id: I7d435455fc60cc10200ee91d0d76534367ab5883 +--- + src/afs/afs_callback.c | 2 ++ + src/afs/afs_prototypes.h | 37 ------------------------------------- + 2 files changed, 2 insertions(+), 37 deletions(-) + +diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c +index 56e8cd2cc..1fe990edf 100644 +--- a/src/afs/afs_callback.c ++++ b/src/afs/afs_callback.c +@@ -19,6 +19,8 @@ + + #include "afs/sysincludes.h" /*Standard vendor system headers */ + #include "afsincludes.h" /*AFS-based standard headers */ ++#define FSINT_COMMON_XG ++#include "afs/afscbint.h" + #include "afs/afs_stats.h" /*Cache Manager stats */ + #include "afs/opr.h" + #include "afs/afs_args.h" +diff --git a/src/afs/afs_prototypes.h b/src/afs/afs_prototypes.h +index d7894dd67..b9811f892 100644 +--- a/src/afs/afs_prototypes.h ++++ b/src/afs/afs_prototypes.h +@@ -64,45 +64,8 @@ extern unsigned int lastCallBack_dv; + extern osi_timeval32_t lastCallBack_time; + extern struct interfaceAddr afs_cb_interface; + +-extern int afs_RXCallBackServer(void); +-extern int SRXAFSCB_GetCE(struct rx_call *a_call, afs_int32 a_index, +- struct AFSDBCacheEntry *a_result); +-extern int SRXAFSCB_GetCE64(struct rx_call *a_call, afs_int32 a_index, +- struct AFSDBCacheEntry64 *a_result); +-extern int SRXAFSCB_GetLock(struct rx_call *a_call, afs_int32 a_index, +- struct AFSDBLock *a_result); +-extern int SRXAFSCB_CallBack(struct rx_call *a_call, +- struct AFSCBFids *a_fids, +- struct AFSCBs *a_callbacks); +-extern int SRXAFSCB_Probe(struct rx_call *a_call); +-extern int SRXAFSCB_InitCallBackState(struct rx_call *a_call); +-extern int SRXAFSCB_XStatsVersion(struct rx_call *a_call, +- afs_int32 * a_versionP); +-extern int SRXAFSCB_GetXStats(struct rx_call *a_call, +- afs_int32 a_clientVersionNum, +- afs_int32 a_collectionNumber, +- afs_int32 * a_srvVersionNumP, +- afs_int32 * a_timeP, AFSCB_CollData * a_dataP); + extern int afs_RXCallBackServer(void); + extern int shutdown_CB(void); +-extern int SRXAFSCB_InitCallBackState2(struct rx_call *a_call, +- struct interfaceAddr *addr); +-extern int SRXAFSCB_WhoAreYou(struct rx_call *a_call, +- struct interfaceAddr *addr); +-extern int SRXAFSCB_InitCallBackState3(struct rx_call *a_call, +- afsUUID * a_uuid); +-extern int SRXAFSCB_ProbeUuid(struct rx_call *a_call, afsUUID * a_uuid); +-extern int SRXAFSCB_GetServerPrefs(struct rx_call *a_call, afs_int32 a_index, +- afs_int32 * a_srvr_addr, +- afs_int32 * a_srvr_rank); +-extern int SRXAFSCB_GetCellServDB(struct rx_call *a_call, afs_int32 a_index, +- char **a_name, serverList * a_hosts); +-extern int SRXAFSCB_GetLocalCell(struct rx_call *a_call, char **a_name); +-extern int SRXAFSCB_GetCacheConfig(struct rx_call *a_call, +- afs_uint32 callerVersion, +- afs_uint32 * serverVersion, +- afs_uint32 * configCount, +- cacheConfig * config); + + /* afs_cbqueue.c */ + extern afs_rwlock_t afs_xcbhash; +-- +2.44.0 + diff --git a/0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch b/0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch new file mode 100644 index 000000000000..1d2b2f656e12 --- /dev/null +++ b/0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch @@ -0,0 +1,84 @@ +From 46608e2f629b8742d31752cc0b021420231e6f45 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Wed, 7 Feb 2024 19:34:29 -0700 +Subject: [PATCH 20/29] rx: Add function prototypes to rx_prototypes.h + +The prototype for rxk_NewSocketHost() is not in a header file, but is +defined in the referencing .c file. The ARCH/rx_knet.c files that +implement rxk_NewSocketHost() do not have a prototype (but when the +rx_kcommon.c implementation is used it does have a prototype, since +rx_kcommon.c is the "referencing .c file"). + +Add the prototype for rxk_NewSocketHost() to rx_prototypes.h and +remove the prototype from rx_kcommon.c + +The prototypes for the functions rx_DebugOnOff() and rx_StatsOnOff() +are defined within rx_prototypes.h, but are within a preprocessor +conditional for AFS_NT40_ENV, however the implementation for these +2 functions do not have the preprocessor conditional. + +Rearrange the prototypes for rx_DebugOnOff() and rx_StatsOnOff() so they +are outside the AFS_NT40_ENV preprocessor conditional. + +These functions are flagged due to missing prototypes when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +There are no functional changes in this commit. + +Reviewed-on: https://gerrit.openafs.org/15624 +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> +Tested-by: Benjamin Kaduk <kaduk@mit.edu> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 8528c36b96fe2935f42188caabf4feed0d5dbcbd) + +Change-Id: Ieae8be7f89f5c675c6580d8cfb02ea77ce4088f7 +--- + src/rx/rx_kcommon.c | 1 - + src/rx/rx_prototypes.h | 5 ++++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c +index b6a069c1d..c90df3d36 100644 +--- a/src/rx/rx_kcommon.c ++++ b/src/rx/rx_kcommon.c +@@ -33,7 +33,6 @@ int (*rxk_PacketArrivalProc) (struct rx_packet * ahandle, struct sockaddr_in * a + int (*rxk_GetPacketProc) (struct rx_packet **ahandle, int asize); + #endif + +-osi_socket *rxk_NewSocketHost(afs_uint32 ahost, short aport); + extern struct interfaceAddr afs_cb_interface; + + rxk_ports_t rxk_ports; +diff --git a/src/rx/rx_prototypes.h b/src/rx/rx_prototypes.h +index 87a1049f7..6e1ae566c 100644 +--- a/src/rx/rx_prototypes.h ++++ b/src/rx/rx_prototypes.h +@@ -24,9 +24,10 @@ extern void rx_rto_setPeerTimeoutSecs(struct rx_peer *, int secs); + + extern int rx_Init(u_int port); + extern int rx_InitHost(u_int host, u_int port); +-#ifdef AFS_NT40_ENV ++ + extern void rx_DebugOnOff(int on); + extern void rx_StatsOnOff(int on); ++#ifdef AFS_NT40_ENV + extern void rx_StartClientThread(void); + #endif + extern void rx_StartServer(int donateMe); +@@ -332,6 +333,8 @@ extern void rxi_ListenerProc(osi_socket usockp, int *tnop, + extern void rxk_init(void); + # endif + ++extern osi_socket *rxk_NewSocketHost(afs_uint32 ahost, short aport); ++ + /* UKERNEL/rx_knet.c */ + # ifdef UKERNEL + extern void afs_rxevent_daemon(void); +-- +2.44.0 + diff --git a/0021-afs-fix-ops-variable-may-be-used-uninitialized.patch b/0021-afs-fix-ops-variable-may-be-used-uninitialized.patch new file mode 100644 index 000000000000..e62db4e1379c --- /dev/null +++ b/0021-afs-fix-ops-variable-may-be-used-uninitialized.patch @@ -0,0 +1,80 @@ +From 216078c99ab6d65ba607d5d7522fdb154048ea59 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Fri, 9 Feb 2024 09:01:33 -0700 +Subject: [PATCH 21/29] afs: fix 'ops' variable may be used uninitialized + +When the function rxfs_storeInit() has the static attribute, gcc flags +the variable 'ops' as possibly uninitialized. + +In function 'afs_CacheStoreDCaches', + inlined from 'afs_CacheStoreVCache' at + .../src/afs/afs_fetchstore.c:630:14: + .../afs/afs_fetchstore.c:535:17: error: 'ops' may be used + uninitialized [-Werror=maybe-uninitialized] + 535 | code = (*ops->destroy)(&rock, code); + | ~^~~~~~~~~~~~~~ + ...src/afs/afs_fetchstore.c: In function 'afs_CacheStoreVCache': + ...src/afs/afs_fetchstore.c:567:22: note: 'ops' was declared here + 567 | struct storeOps *ops; + | ^~~ + cc1: all warnings being treated as errors + +This is a false positive report by the gcc compiler. + +The function rxfs_storeInit() returns a 0 only when it has successfully +assigned a value to the ops variable, and afs_CacheStoreDcaches() is +only called if the return value from rxfs_storeInit() is 0. + +The ops variable is only used within a block that is within a for loop, +which could leave a stray value if the variable isn't initialized within +that loop. + +Assigning a NULL to ops is sufficient to avoid the compiler error, and +relocating the declaration of the ops variable into the block where it +is actually used ensures that it's always initialized before its use +within the loop. + +Clean up whitespace in the statement that follows the new location for +the ops variable. + +Note, this commit is being added before a commit that adds the static +attribute to the rxfs_storeInit() function which also "fixes" the +compiler error (see: afs: Add static attribute to internal functions). + +Reviewed-on: https://gerrit.openafs.org/15630 +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 36e4c02ff27b9d66755b9544778896b9b1e5c391) + +Change-Id: I9d8a07e576c6bf889f8f182c6fc0d34dc997c004 +--- + src/afs/afs_fetchstore.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c +index 7b35b8f7f..63b370dae 100644 +--- a/src/afs/afs_fetchstore.c ++++ b/src/afs/afs_fetchstore.c +@@ -564,7 +564,6 @@ afs_CacheStoreVCache(struct dcache **dcList, struct vcache *avc, + afs_hyper_t *anewDV, afs_size_t *amaxStoredLength) + { + afs_int32 code = 0; +- struct storeOps *ops; + void * rock = NULL; + unsigned int i, j; + +@@ -619,7 +618,8 @@ afs_CacheStoreVCache(struct dcache **dcList, struct vcache *avc, + ICL_HANDLE_OFFSET(length)); + + do { +- tc = afs_Conn(&avc->f.fid, areq, 0, &rxconn); ++ struct storeOps *ops = NULL; ++ tc = afs_Conn(&avc->f.fid, areq, 0, &rxconn); + + #ifdef AFS_64BIT_CLIENT + restart: +-- +2.44.0 + diff --git a/0022-afs-Add-static-attribute-to-internal-functions.patch b/0022-afs-Add-static-attribute-to-internal-functions.patch new file mode 100644 index 000000000000..f6426e79cb4b --- /dev/null +++ b/0022-afs-Add-static-attribute-to-internal-functions.patch @@ -0,0 +1,487 @@ +From d82082f27ba7308c41c7e2ef7585ed33d384bad7 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Thu, 29 Feb 2024 17:53:31 -0700 +Subject: [PATCH 22/29] afs: Add static attribute to internal functions + +When building against a Linux 6.8 kernel, functions that are missing +prototypes or declarations are flagged. + +We can add the static attribute to functions that are not referenced +outside of the file that implements them to avoid having these functions +flagged by the compiler. + +These functions are flagged due to missing prototypes when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +There are no functional changes in this commit. + +Reviewed-on: https://gerrit.openafs.org/15625 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit efee796f28b53bf3ffc03186f81790c36c23c94c) + +Change-Id: I0d923a65731f825d6c190056b0ccc3d362236706 +--- + src/afs/LINUX/osi_file.c | 2 +- + src/afs/LINUX/osi_module.c | 4 ++-- + src/afs/LINUX/osi_pag_module.c | 4 ++-- + src/afs/afs_call.c | 6 ++--- + src/afs/afs_disconnected.c | 20 ++++++++-------- + src/afs/afs_fetchstore.c | 42 +++++++++++++++++----------------- + src/afs/afs_icl.c | 4 ++-- + src/afs/afs_pag_cred.c | 4 ++-- + src/afs/afs_server.c | 2 +- + src/afs/afs_vcache.c | 2 +- + 10 files changed, 45 insertions(+), 45 deletions(-) + +diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c +index e8c298068..cb91ecb0a 100644 +--- a/src/afs/LINUX/osi_file.c ++++ b/src/afs/LINUX/osi_file.c +@@ -47,7 +47,7 @@ extern struct cred *cache_creds; + #endif + + /* Old export ops: decode_fh will call back here. Accept any dentry it suggests */ +-int ++static int + afs_fh_acceptable(void *context, struct dentry *dp) + { + return 1; +diff --git a/src/afs/LINUX/osi_module.c b/src/afs/LINUX/osi_module.c +index fdc347d2c..30ac048d3 100644 +--- a/src/afs/LINUX/osi_module.c ++++ b/src/afs/LINUX/osi_module.c +@@ -64,7 +64,7 @@ afs_init_idmap(void) + } + #endif + +-int __init ++static int __init + afs_init(void) + { + int err; +@@ -114,7 +114,7 @@ afs_init(void) + return 0; + } + +-void __exit ++static void __exit + afs_cleanup(void) + { + afs_shutdown_pagecopy(); +diff --git a/src/afs/LINUX/osi_pag_module.c b/src/afs/LINUX/osi_pag_module.c +index e832c5abd..24b938f0e 100644 +--- a/src/afs/LINUX/osi_pag_module.c ++++ b/src/afs/LINUX/osi_pag_module.c +@@ -58,7 +58,7 @@ int afs_global_owner = 0; + struct user_namespace *afs_ns; + #endif + +-int __init ++static int __init + afspag_init(void) + { + #if !defined(EXPORTED_PROC_ROOT_FS) +@@ -90,7 +90,7 @@ afspag_init(void) + return 0; + } + +-void __exit ++static void __exit + afspag_cleanup(void) + { + #if !defined(EXPORTED_PROC_ROOT_FS) +diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c +index ba78bce6e..4ac63b187 100644 +--- a/src/afs/afs_call.c ++++ b/src/afs/afs_call.c +@@ -267,7 +267,7 @@ afsd_thread(int *rock) + } + } + +-void ++static void + afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5, + long parm6) + { +@@ -436,7 +436,7 @@ afsd_thread(void *rock) + return 0; + } + +-void ++static void + # if defined(AFS_LINUX_ENV) && !defined(INIT_WORK_HAS_DATA) + afsd_launcher(struct work_struct *work) + # else +@@ -457,7 +457,7 @@ afsd_launcher(void *rock) + # endif /* !HAVE_LINUX_KTHREAD_RUN */ + } + +-void ++static void + afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5, + long parm6) + { +diff --git a/src/afs/afs_disconnected.c b/src/afs/afs_disconnected.c +index 1aaabd905..03ff90f7e 100644 +--- a/src/afs/afs_disconnected.c ++++ b/src/afs/afs_disconnected.c +@@ -102,7 +102,7 @@ afs_FindDCacheByFid(struct VenusFid *afid) + * + * \return Mask of operations. + */ +-int ++static int + afs_GenStoreStatus(struct vcache *avc, struct AFSStoreStatus *astat) + { + if (!avc || !astat || !avc->f.ddirty_flags) +@@ -157,7 +157,7 @@ get_parent_dir_fid_hook(void *hdata, char *aname, afs_int32 vnode, + * + * \return 0 on success, -1 on failure + */ +-int ++static int + afs_GetParentDirFid(struct vcache *avc, struct VenusFid *afid) + { + struct dcache *tdc; +@@ -234,7 +234,7 @@ get_vnode_name_hook(void *hdata, char *aname, afs_int32 vnode, + * \param deleted Has this file been deleted? If yes, use the shadow + * dir for looking up the name. + */ +-int ++static int + afs_GetVnodeName(struct vcache *avc, struct VenusFid *afid, char *aname, + int deleted) + { +@@ -358,7 +358,7 @@ chk_del_children_hook(void *hdata, char *aname, afs_int32 vnode, + * + * \note afs_DDirtyVCListLock must be write locked. + */ +-int ++static int + afs_CheckDeletedChildren(struct vcache *avc) + { + struct dcache *tdc; +@@ -452,7 +452,7 @@ fix_children_fids_hook(void *hdata, char *aname, afs_int32 vnode, + * \param old_fid The current dir's fid. + * \param new_fid The new dir's fid. + */ +-void ++static void + afs_FixChildrenFids(struct VenusFid *old_fid, struct VenusFid *new_fid) + { + struct dcache *tdc; +@@ -499,7 +499,7 @@ afs_DbgListDirEntries(struct VenusFid *afid) + * be deferred to later in the resync process + */ + +-int ++static int + afs_GetParentVCache(struct vcache *avc, int deleted, struct VenusFid *afid, + char *aname, struct vcache **adp) + { +@@ -548,7 +548,7 @@ end: + * - Get the new name from the current dir. + * - Old dir fid and new dir fid are collected along the way. + * */ +-int ++static int + afs_ProcessOpRename(struct vcache *avc, struct vrequest *areq) + { + struct VenusFid old_pdir_fid, new_pdir_fid; +@@ -651,7 +651,7 @@ done: + * - Handle errors. + * - Reorder vhash and dcaches in their hashes, using the newly acquired fid. + */ +-int ++static int + afs_ProcessOpCreate(struct vcache *avc, struct vrequest *areq, + afs_ucred_t *acred) + { +@@ -921,7 +921,7 @@ end: + * + * \note avc must be write locked. + */ +-int ++static int + afs_ProcessOpRemove(struct vcache *avc, struct vrequest *areq) + { + char *tname = NULL; +@@ -1022,7 +1022,7 @@ end: + * + * \return 0 for success. On failure, other error codes. + */ +-int ++static int + afs_SendChanges(struct vcache *avc, struct vrequest *areq) + { + struct afs_conn *tc; +diff --git a/src/afs/afs_fetchstore.c b/src/afs/afs_fetchstore.c +index 63b370dae..97d067181 100644 +--- a/src/afs/afs_fetchstore.c ++++ b/src/afs/afs_fetchstore.c +@@ -77,14 +77,14 @@ FillStoreStats(int code, int idx, osi_timeval32_t xferStartTime, + + + +-afs_int32 ++static afs_int32 + rxfs_storeUfsPrepare(void *r, afs_uint32 size, afs_uint32 *tlen) + { + *tlen = (size > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : size); + return 0; + } + +-afs_int32 ++static afs_int32 + rxfs_storeMemPrepare(void *r, afs_uint32 size, afs_uint32 *tlen) + { + afs_int32 code; +@@ -105,7 +105,7 @@ rxfs_storeMemPrepare(void *r, afs_uint32 size, afs_uint32 *tlen) + return code; + } + +-afs_int32 ++static afs_int32 + rxfs_storeUfsRead(void *r, struct osi_file *tfile, afs_uint32 offset, + afs_uint32 tlen, afs_uint32 *bytesread) + { +@@ -126,7 +126,7 @@ rxfs_storeUfsRead(void *r, struct osi_file *tfile, afs_uint32 offset, + return 0; + } + +-afs_int32 ++static afs_int32 + rxfs_storeMemRead(void *r, struct osi_file *tfile, afs_uint32 offset, + afs_uint32 tlen, afs_uint32 *bytesread) + { +@@ -142,7 +142,7 @@ rxfs_storeMemRead(void *r, struct osi_file *tfile, afs_uint32 offset, + return 0; + } + +-afs_int32 ++static afs_int32 + rxfs_storeMemWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten) + { + afs_int32 code; +@@ -159,7 +159,7 @@ rxfs_storeMemWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten) + return 0; + } + +-afs_int32 ++static afs_int32 + rxfs_storeUfsWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten) + { + afs_int32 code; +@@ -179,7 +179,7 @@ rxfs_storeUfsWrite(void *r, afs_uint32 l, afs_uint32 *byteswritten) + return 0; + } + +-afs_int32 ++static afs_int32 + rxfs_storePadd(void *rock, afs_uint32 size) + { + afs_int32 code = 0; +@@ -203,7 +203,7 @@ rxfs_storePadd(void *rock, afs_uint32 size) + return 0; + } + +-afs_int32 ++static afs_int32 + rxfs_storeStatus(void *rock) + { + struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)rock; +@@ -213,7 +213,7 @@ rxfs_storeStatus(void *rock) + return 1; + } + +-afs_int32 ++static afs_int32 + rxfs_storeClose(void *r, struct AFSFetchStatus *OutStatus, int *doProcessFS) + { + afs_int32 code; +@@ -236,7 +236,7 @@ rxfs_storeClose(void *r, struct AFSFetchStatus *OutStatus, int *doProcessFS) + return code; + } + +-afs_int32 ++static afs_int32 + rxfs_storeDestroy(void **r, afs_int32 code) + { + struct rxfs_storeVariables *v = (struct rxfs_storeVariables *)*r; +@@ -255,7 +255,7 @@ rxfs_storeDestroy(void **r, afs_int32 code) + return code; + } + +-afs_int32 ++static afs_int32 + afs_GenericStoreProc(struct storeOps *ops, void *rock, + struct dcache *tdc, int *shouldwake, + afs_size_t *bytesXferred) +@@ -353,7 +353,7 @@ struct storeOps rxfs_storeMemOps = { + #endif + }; + +-afs_int32 ++static afs_int32 + rxfs_storeInit(struct vcache *avc, struct afs_conn *tc, + struct rx_connection *rxconn, afs_size_t base, + afs_size_t bytes, afs_size_t length, +@@ -437,7 +437,7 @@ unsigned int storeallmissing = 0; + * \param ops pointer to the block of storeOps to be used for this operation + * \param rock pointer to the opaque protocol-specific data of this operation + */ +-afs_int32 ++static afs_int32 + afs_CacheStoreDCaches(struct vcache *avc, struct dcache **dclist, + afs_size_t bytes, afs_hyper_t *anewDV, int *doProcessFS, + struct AFSFetchStatus *OutStatus, afs_uint32 nchunks, +@@ -720,7 +720,7 @@ struct rxfs_fetchVariables { + afs_int32 iovmax; + }; + +-afs_int32 ++static afs_int32 + rxfs_fetchUfsRead(void *r, afs_uint32 size, afs_uint32 *bytesread) + { + afs_int32 code; +@@ -738,7 +738,7 @@ rxfs_fetchUfsRead(void *r, afs_uint32 size, afs_uint32 *bytesread) + return 0; + } + +-afs_int32 ++static afs_int32 + rxfs_fetchMemRead(void *r, afs_uint32 tlen, afs_uint32 *bytesread) + { + afs_int32 code; +@@ -755,7 +755,7 @@ rxfs_fetchMemRead(void *r, afs_uint32 tlen, afs_uint32 *bytesread) + } + + +-afs_int32 ++static afs_int32 + rxfs_fetchMemWrite(void *r, struct osi_file *fP, afs_uint32 offset, + afs_uint32 tlen, afs_uint32 *byteswritten) + { +@@ -771,7 +771,7 @@ rxfs_fetchMemWrite(void *r, struct osi_file *fP, afs_uint32 offset, + return 0; + } + +-afs_int32 ++static afs_int32 + rxfs_fetchUfsWrite(void *r, struct osi_file *fP, afs_uint32 offset, + afs_uint32 tlen, afs_uint32 *byteswritten) + { +@@ -787,7 +787,7 @@ rxfs_fetchUfsWrite(void *r, struct osi_file *fP, afs_uint32 offset, + } + + +-afs_int32 ++static afs_int32 + rxfs_fetchClose(void *r, struct vcache *avc, struct dcache * adc, + struct afs_FetchOutput *o) + { +@@ -814,7 +814,7 @@ rxfs_fetchClose(void *r, struct vcache *avc, struct dcache * adc, + return code; + } + +-afs_int32 ++static afs_int32 + rxfs_fetchDestroy(void **r, afs_int32 code) + { + struct rxfs_fetchVariables *v = (struct rxfs_fetchVariables *)*r; +@@ -833,7 +833,7 @@ rxfs_fetchDestroy(void **r, afs_int32 code) + return code; + } + +-afs_int32 ++static afs_int32 + rxfs_fetchMore(void *r, afs_int32 *length, afs_uint32 *moredata) + { + afs_int32 code; +@@ -882,7 +882,7 @@ struct fetchOps rxfs_fetchMemOps = { + rxfs_fetchDestroy + }; + +-afs_int32 ++static afs_int32 + rxfs_fetchInit(struct afs_conn *tc, struct rx_connection *rxconn, + struct vcache *avc, afs_offs_t base, + afs_uint32 size, afs_int32 *alength, struct dcache *adc, +diff --git a/src/afs/afs_icl.c b/src/afs/afs_icl.c +index 42b4a0ccb..08a166020 100644 +--- a/src/afs/afs_icl.c ++++ b/src/afs/afs_icl.c +@@ -34,7 +34,7 @@ int afs_icl_sizeofLong = ICL_LONG; + int afs_icl_inited = 0; + + /* init function, called once, under afs_icl_lock */ +-int ++static int + afs_icl_Init(void) + { + afs_icl_inited = 1; +@@ -539,7 +539,7 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr) + #endif + + +-void ++static void + afs_icl_AppendOne(struct afs_icl_log *logp, int type, long parm) + { + if (type) { +diff --git a/src/afs/afs_pag_cred.c b/src/afs/afs_pag_cred.c +index 3dce8543b..e77cf8ae3 100644 +--- a/src/afs/afs_pag_cred.c ++++ b/src/afs/afs_pag_cred.c +@@ -32,7 +32,7 @@ static struct afspag_cell *cells = 0; + static struct afspag_cell *primary_cell = 0; + + +-struct afspag_cell * ++static struct afspag_cell * + afspag_GetCell(char *acell) + { + struct afspag_cell *tcell; +@@ -66,7 +66,7 @@ out: + } + + +-struct afspag_cell * ++static struct afspag_cell * + afspag_GetPrimaryCell(void) + { + struct afspag_cell *tcell; +diff --git a/src/afs/afs_server.c b/src/afs/afs_server.c +index 3674eff43..9d2d93cde 100644 +--- a/src/afs/afs_server.c ++++ b/src/afs/afs_server.c +@@ -556,7 +556,7 @@ CkSrv_MarkUpDown(struct afs_conn **conns, struct rx_connection **rxconns, + } + } + +-void ++static void + CkSrv_GetCaps(int nconns, struct rx_connection **rxconns, + struct afs_conn **conns) + { +diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c +index e72b45ea4..f500b65a3 100644 +--- a/src/afs/afs_vcache.c ++++ b/src/afs/afs_vcache.c +@@ -727,7 +727,7 @@ afs_FlushReclaimedVcaches(void) + #endif + } + +-void ++static void + afs_PostPopulateVCache(struct vcache *avc, struct VenusFid *afid, int seq) + { + /* +-- +2.44.0 + diff --git a/0023-rx-Add-static-attribute-to-internal-functions.patch b/0023-rx-Add-static-attribute-to-internal-functions.patch new file mode 100644 index 000000000000..4b4736ce91c5 --- /dev/null +++ b/0023-rx-Add-static-attribute-to-internal-functions.patch @@ -0,0 +1,76 @@ +From 5c40a30514681080a304c9a284e991371ad33689 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Fri, 12 Jan 2024 15:30:23 -0700 +Subject: [PATCH 23/29] rx: Add static attribute to internal functions + +When building against a Linux 6.8 kernel, functions that are missing +prototypes or declarations are flagged. + +We can add the static attribute to functions that are not referenced +outside of the file that implements them to avoid having these functions +flagged by the compiler. + +These functions are flagged due to missing prototypes when building +against a Linux 6.8 kernel (which sets the -Wmissing-declarations and +-Wmissing-prototypes compiler flags as default). Linux 6.8 commit: + 'Makefile.extrawarn: turn on missing-prototypes globally' (0fcb70851f). + +When building against a kernel with CONFIG_WERROR=y, the build fails. + +There are no functional changes in this commit. + +Reviewed-on: https://gerrit.openafs.org/15626 +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 55adceba2d561ec4e89235de329782a68e603a11) + +Change-Id: I1b2a6e1c07bd4b75b7b83e177f17865eb903e488 +--- + src/rx/rx.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/rx/rx.c b/src/rx/rx.c +index aaec60907..d6c52c369 100644 +--- a/src/rx/rx.c ++++ b/src/rx/rx.c +@@ -6513,7 +6513,7 @@ mtuout: + return -1; + } + +-void ++static void + rxi_NatKeepAliveEvent(struct rxevent *event, void *arg1, + void *dummy, int dummy2) + { +@@ -6615,7 +6615,7 @@ rx_SetConnSecondsUntilNatPing(struct rx_connection *conn, afs_int32 seconds) + * declared dead; if nothing has been sent for a while, we send a + * keep-alive packet (if we're actually trying to keep the call alive) + */ +-void ++static void + rxi_KeepAliveEvent(struct rxevent *event, void *arg1, void *dummy, + int dummy2) + { +@@ -6656,7 +6656,7 @@ rxi_KeepAliveEvent(struct rxevent *event, void *arg1, void *dummy, + } + + /* Does what's on the nameplate. */ +-void ++static void + rxi_GrowMTUEvent(struct rxevent *event, void *arg1, void *dummy, int dummy2) + { + struct rx_call *call = arg1; +@@ -8266,7 +8266,7 @@ static int rxi_monitor_processStats = 0; + static int rxi_monitor_peerStats = 0; + + +-void ++static void + rxi_ClearRPCOpStat(rx_function_entry_v1_p rpc_stat) + { + rpc_stat->invocations = 0; +-- +2.44.0 + diff --git a/0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch b/0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch new file mode 100644 index 000000000000..ed16d683fa47 --- /dev/null +++ b/0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch @@ -0,0 +1,52 @@ +From 8b9831622af6da269d12668e1b50816872dafcc7 Mon Sep 17 00:00:00 2001 +From: Andrew Deason <adeason@sinenomine.net> +Date: Tue, 7 Dec 2021 15:43:35 -0600 +Subject: [PATCH 24/29] rxgen: Declare generated PKG_TranslateOpCode() + +Ever since commit 5c77a6ca (rxgen: add *TranslateOpcode functions to +XDR code), rxgen generates a PKG_TranslateOpCode function in the +relevant .xdr.c source, which can translate an RPC opcode into the RPC +name. But we never declare this function in a header file, making it +impossible to use without compiler warnings (unless the caller +declares the function itself). + +To make it possible to actually use this function, declare this +function in the generated header file. + +Reviewed-on: https://gerrit.openafs.org/14871 +Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 9b2c27fc6d299cb0b23eca3e8cb25b7e0c41b11a) + +Change-Id: I2479ff7f6579769b3319b2939ffde60fe570c880 +--- + src/rxgen/rpc_parse.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c +index 768e42f3b..59854f4d5 100644 +--- a/src/rxgen/rpc_parse.c ++++ b/src/rxgen/rpc_parse.c +@@ -2150,6 +2150,8 @@ h_ProcMainBody_setup(void) + { + f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n", + prefix, PackagePrefix[PackageIndex]); ++ f_print(fout,"extern char * %s%sTranslateOpCode(int op);\n", prefix, ++ PackagePrefix[PackageIndex]); + } + + static void +@@ -2161,6 +2163,8 @@ h_HeadofOldStyleProc_setup(void) + f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n", + prefix, pprefix); + f_print(fout,"\nextern int %sOpCodeIndex(int op);\n", PackagePrefix[PackageIndex]); ++ f_print(fout, "extern char * %s%sTranslateOpCode(int op);\n", ++ prefix, pprefix); + } + + void +-- +2.44.0 + diff --git a/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch b/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch new file mode 100644 index 000000000000..e74a7bfb8214 --- /dev/null +++ b/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch @@ -0,0 +1,70 @@ +From 53c988023e7e6087026d6ed795ed4a13ea39cb94 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Tue, 5 Mar 2024 07:40:08 -0700 +Subject: [PATCH 25/29] rxgen: Declare generated PKG_OpCodeStats() + +The function {PKG}_OpCodeStats() is generated by rxgen, however a +prototype for the function is not generated. + +The functions h_ProcMainBody_setup() and h_HeadofOldStyleProc_setup() +in rpc_parse.c emit prototypes for {PKG}_ExecuteRequest() and +{PKG}_TranslateOpCode(), but do not emit a prototype for +{PKG}_OpCodeStats(). + +Update rxgen to emit a function prototype for {PKG}_OpCodeStats() in the +generated header file. + +Use a variable to point to "PackagePrefix[PackageIndex]" in +h_ProcMainBody_setup to improve readability. + +{PKG}_OpCodeStats(), specifically RXSTATS_OpCodeStats(), is flagged due +to a missing prototype when building against a Linux 6.8 kernel (which +sets the -Wmissing-declarations and -Wmissing-prototypes compiler flags +as default). Linux 6.8 commit: 'Makefile.extrawarn: turn on +missing-prototypes globally' (0fcb70851f). When building against a +kernel with CONFIG_WERROR=y, the build fails. + +Reviewed-on: https://gerrit.openafs.org/15631 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 26bb4d143b31ba027cf2721ac731df67a174c43b) + +Change-Id: I9072d22d142b5b7a2f59b0cfc4026066ef1d9501 +--- + src/rxgen/rpc_parse.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c +index 59854f4d5..e648a6600 100644 +--- a/src/rxgen/rpc_parse.c ++++ b/src/rxgen/rpc_parse.c +@@ -2148,10 +2148,14 @@ er_TailofOldStyleProc_setup(void) + static void + h_ProcMainBody_setup(void) + { ++ char *pprefix = PackagePrefix[PackageIndex]; + f_print(fout,"\nextern int %s%sExecuteRequest(struct rx_call *);\n", +- prefix, PackagePrefix[PackageIndex]); ++ prefix, pprefix); + f_print(fout,"extern char * %s%sTranslateOpCode(int op);\n", prefix, +- PackagePrefix[PackageIndex]); ++ pprefix); ++ f_print(fout,"extern struct %s%sstats *%s%sOpCodeStats(int op);\n", ++ prefix, pprefix, ++ prefix, pprefix); + } + + static void +@@ -2165,6 +2169,8 @@ h_HeadofOldStyleProc_setup(void) + f_print(fout,"\nextern int %sOpCodeIndex(int op);\n", PackagePrefix[PackageIndex]); + f_print(fout, "extern char * %s%sTranslateOpCode(int op);\n", + prefix, pprefix); ++ f_print(fout, "extern struct %s%sstats *%s%sOpCodeStats(int op);\n", ++ prefix, pprefix, prefix, pprefix); + } + + void +-- +2.44.0 + diff --git a/0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch b/0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch new file mode 100644 index 000000000000..e15bc3b11325 --- /dev/null +++ b/0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch @@ -0,0 +1,72 @@ +From 9befccd11d338dfc7220a3ae3695634cefd2c359 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Mon, 12 Feb 2024 12:31:30 -0700 +Subject: [PATCH 26/29] Linux 6.8: use hlist iteration for dentry children + +Linux 6.8 commit 'dentry: switch the lists of children to hlist' +(da549bdd15) replaces the dentry lists d_subdirs/d_child with the hlist +d_children/d_sib. + +Add an autoconf test for a d_children member in the dentry structure. + +Define a macro that uses the applicable Linux function for iterating +over a dentry's children. + +Reviewed-on: https://gerrit.openafs.org/15632 +Reviewed-by: Andrew Deason <adeason@sinenomine.net> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 8e0bbe6a07523dd2e7efb3c9d1b4ad9e19fc9bb7) + +Change-Id: Ief4c334c4ef3e54822e068dcdf654541e86b9176 +--- + src/afs/LINUX/osi_vcache.c | 10 +++++++++- + src/cf/linux-kernel-struct.m4 | 3 +++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c +index 897fd37ab..43644f44b 100644 +--- a/src/afs/LINUX/osi_vcache.c ++++ b/src/afs/LINUX/osi_vcache.c +@@ -15,6 +15,14 @@ + + #include "osi_compat.h" + ++#if defined(STRUCT_DENTRY_HAS_D_CHILDREN) ++# define afs_for_each_child(child, parent) \ ++ hlist_for_each_entry((child), &(parent)->d_children, d_sib) ++#else ++# define afs_for_each_child(child, parent) \ ++ list_for_each_entry((child), &(parent)->d_subdirs, d_child) ++#endif ++ + static void + TryEvictDirDentries(struct inode *inode) + { +@@ -312,7 +320,7 @@ osi_ResetVCache(struct vcache *avc) + * because 'dp' is an ancestor of 'child'. + */ + struct dentry *child; +- list_for_each_entry(child, &dp->d_subdirs, d_child) { ++ afs_for_each_child(child, dp) { + spin_lock(&child->d_lock); + child->d_time = 0; + spin_unlock(&child->d_lock); +diff --git a/src/cf/linux-kernel-struct.m4 b/src/cf/linux-kernel-struct.m4 +index 2824ec198..5cd346fb5 100644 +--- a/src/cf/linux-kernel-struct.m4 ++++ b/src/cf/linux-kernel-struct.m4 +@@ -17,6 +17,9 @@ AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_alias], [dcache.h]) + dnl linux 2.6.16 moved dentry->d_child to dentry->d_u.d_child + dnl linux 3.19 moved it back to dentry->d_child + AC_CHECK_LINUX_STRUCT([dentry], [d_u.d_child], [dcache.h]) ++dnl linux 6.8 uses hlist for dentry children and renamed ++dnl d_subdirs/d_child to d_childern/d_sib ++AC_CHECK_LINUX_STRUCT([dentry], [d_children], [dcache.h]) + AC_CHECK_LINUX_STRUCT([dentry_operations], [d_automount], [dcache.h]) + AC_CHECK_LINUX_STRUCT([group_info], [gid], [cred.h]) + AC_CHECK_LINUX_STRUCT([inode], [i_alloc_sem], [fs.h]) +-- +2.44.0 + diff --git a/0027-Linux-6.8-Remove-ctl_table-sentinels.patch b/0027-Linux-6.8-Remove-ctl_table-sentinels.patch new file mode 100644 index 000000000000..24bbd0b973c6 --- /dev/null +++ b/0027-Linux-6.8-Remove-ctl_table-sentinels.patch @@ -0,0 +1,86 @@ +From f9f074e6f9a3114b1926a90bd7810bfa192f9886 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Tue, 5 Mar 2024 08:37:47 -0700 +Subject: [PATCH 27/29] Linux 6.8: Remove ctl_table sentinels + +The Linux 6.8 commit 'sysctl: Remove the now superfluous sentinel +elements from ctl_table array' (c8a65501d3) was a clean up commit +that removed the sentinel entry in the ctl_table array (e.g. the +"null" entry at the end of the table). + +As of Linux 6.8, including the sentinel entry (.procname =) in the +ctl_table is unnecessary, but doesn't yet break anything. But it is +likely that including the sentinel will start to cause runtime errors in +future Linux versions very soon, so avoid the sentinel when we can, to +avoid possible problems in the future. + +Define a new macro that can be used as the last entry of a ctl_table +that will either add a "null" entry, or nothing. + +There is not a specific build test we can use within configure, so we +must explicitly test the Linux version to decide if we need to use a +sentinel or not when defining the macro. We are selecting 6.8 to match +the version where the Linux kernel is removing the sentinels from the in +kernel filesystems. + +Note: See the Linux merge commits 'Merge tag 'sysctl-6.8-rc1' of +git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux' (a05aea98d4) +for more details behind the staged removal of the sentinels in the +ctl_table structures and the potential future change for removing the +actual check for the sentinel within the Linux kernel. + +Reviewed-on: https://gerrit.openafs.org/15645 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Mark Vitale <mvitale@sinenomine.net> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 35c8c1bf0b1cb48178f676ba5bcf16ad59c5a33b) + +Change-Id: I34cb7586003e10a6c7438d7205123d57af30585e +--- + src/afs/LINUX/osi_sysctl.c | 16 ++++++++++------ + 1 file changed, 10 insertions(+), 6 deletions(-) + +diff --git a/src/afs/LINUX/osi_sysctl.c b/src/afs/LINUX/osi_sysctl.c +index a0a039892..c1116fc79 100644 +--- a/src/afs/LINUX/osi_sysctl.c ++++ b/src/afs/LINUX/osi_sysctl.c +@@ -54,6 +54,14 @@ extern afs_int32 afs_pct2; + # define AFS_SYSCTL_INT(num, perms, var) \ + AFS_SYSCTL_INT2(num, perms, #var, var) + ++# if LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0) ++/* end of list sentinel not needed */ ++# define AFS_SYSCTL_SENTINEL ++# else ++/* NULL entry to mark the end of the list */ ++# define AFS_SYSCTL_SENTINEL { .procname = NULL } ++# endif ++ + static struct ctl_table_header *afs_sysctl = NULL; + + static struct ctl_table afs_sysctl_table[] = { +@@ -75,9 +83,7 @@ static struct ctl_table afs_sysctl_table[] = { + AFS_SYSCTL_INT( 13, 0644, afs_cacheBlocks), + AFS_SYSCTL_INT2(14, 0644, "md5inum", afs_md5inum), + +- { +- .procname = 0 +- } ++ AFS_SYSCTL_SENTINEL + }; + # if !defined(HAVE_LINUX_REGISTER_SYSCTL) + static struct ctl_table fs_sysctl_table[] = { +@@ -87,9 +93,7 @@ static struct ctl_table fs_sysctl_table[] = { + .mode = 0555, + .child = afs_sysctl_table + }, +- { +- .procname = 0 +- } ++ AFS_SYSCTL_SENTINEL + }; + # endif + int +-- +2.44.0 + diff --git a/0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch b/0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch new file mode 100644 index 000000000000..16b7091a1d7e --- /dev/null +++ b/0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch @@ -0,0 +1,156 @@ +From b6458796f2deef285fd0ad06480b5fc35cd8acb3 Mon Sep 17 00:00:00 2001 +From: Cheyenne Wills <cwills@sinenomine.net> +Date: Mon, 11 Mar 2024 09:05:33 -0600 +Subject: [PATCH 28/29] Linux 6.8: Use roken's strlcpy() in kernel module + +The Linux 6.8 commit 'string: Remove strlcpy()' (d26270061a) removed the +the strlcpy function from the Linux kernel. The replacement function, +strscpy(), cannot be used as a drop-in replacement as its currently a +Linux kernel specific function and there are differences in the returned +value. + +We can use roken's strlcpy() (provided in roken/strlcpy.c). + +Create a configure test to that defines its own strlcpy() to test +if the kernel doesn't provide one itself. Note, we need to use a +different function signature for strlcpy() from what the kernel might +have otherwise the test build succeeds when the kernel does provide a +strlcpy(). + +Update the OpenAFS kernel specific roken.h to define the prototype for +strlcpy when it's not present in the Linux kernel. We need to match the +defines used in the 'real' roken.h so the roken/strlcpy.c can build +properly. Add defines for ROKEN_LIB_FUNCTION, ROKEN_LIB_CALL and +ROKEN_LIB_VARIABLE to the kernel roken.h + +Update Linux's osi_machdep.h to include roken.h so the strlcpy protoype +is available. + +Update the Linux MakefileProto to include the strcpy-kernel object +when building the kernel module. + +Reviewed-on: https://gerrit.openafs.org/15646 +Tested-by: BuildBot <buildbot@rampaginggeek.com> +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +(cherry picked from commit 30b18c165752e6d0ce7b6daa6a90453f5e5e6d17) + +Change-Id: I8013623e8f735d15bb7d4ac84ed0867f12b77783 +--- + src/afs/LINUX/osi_machdep.h | 1 + + src/cf/linux-kernel-func.m4 | 11 +++++++++++ + src/crypto/hcrypto/kernel/roken.h | 29 +++++++++++++++++++++++++++++ + src/external/libafsdep | 1 + + src/libafs/MakefileProto.LINUX.in | 6 ++++-- + 5 files changed, 46 insertions(+), 2 deletions(-) + +diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h +index 916a1dfed..263c8633c 100644 +--- a/src/afs/LINUX/osi_machdep.h ++++ b/src/afs/LINUX/osi_machdep.h +@@ -77,6 +77,7 @@ + #endif + + #include "afs/sysincludes.h" ++#include "roken.h" + + #if !defined(HAVE_LINUX_TIME_T) + typedef time64_t time_t; +diff --git a/src/cf/linux-kernel-func.m4 b/src/cf/linux-kernel-func.m4 +index 7f3000fc1..6f9d35022 100644 +--- a/src/cf/linux-kernel-func.m4 ++++ b/src/cf/linux-kernel-func.m4 +@@ -252,6 +252,17 @@ AC_CHECK_LINUX_FUNC([inode_atime_mtime_accessors], + [inode_set_atime(NULL, 0, 0); + inode_set_mtime(NULL, 0, 0);]) + ++dnl Linux 6.8 removed the strlcpy() function. We test to see if we can redefine ++dnl a strlcpy() function. We use a totally different function signature to ++dnl to ensure that this fails when the kernel does provide strlcpy(). ++AC_CHECK_LINUX_FUNC([no_strlcpy], ++ [[#include <linux/string.h> ++ size_t strlcpy(char *d); ++ size_t strlcpy(char *d) { return strlen(d); }]], ++ [[static char buff[10]; ++ size_t s; ++ s = strlcpy(buff);]]) ++ + dnl Consequences - things which get set as a result of the + dnl above tests + AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"], +diff --git a/src/crypto/hcrypto/kernel/roken.h b/src/crypto/hcrypto/kernel/roken.h +index f8c233468..6cb060131 100644 +--- a/src/crypto/hcrypto/kernel/roken.h ++++ b/src/crypto/hcrypto/kernel/roken.h +@@ -11,6 +11,35 @@ + # error "This header is for kernel code only" + #endif + ++/* ++ * The following function annotations are not needed when building for kernel ++ * space ++ */ ++#define ROKEN_LIB_FUNCTION ++#define ROKEN_LIB_CALL ++#define ROKEN_LIB_VARIABLE ++ ++/* ++ * Our HAVE_STRLCPY from autoconf refers to whether strlcpy() is available in ++ * userspace. Whether it's available in the kernel is another question, so ++ * override HAVE_STRLCPY here. Usually it is available (only a few cases lack ++ * it), so turn it on by default, and turn it off for a few cases below. ++ */ ++#undef HAVE_STRLCPY ++#define HAVE_STRLCPY 1 ++ ++#ifdef AFS_AIX_ENV ++# undef HAVE_STRLCPY ++#elif defined(AFS_LINUX_ENV) && defined(HAVE_LINUX_NO_STRLCPY) ++# undef HAVE_STRLCPY ++#endif ++ ++/* strlcpy.c */ ++#if defined (AFS_LINUX_ENV) && !defined(HAVE_STRLCPY) ++# define strlcpy rk_strlcpy ++ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL strlcpy (char *, const char *, size_t); ++#endif ++ + /* ct.c */ + int ct_memcmp(const void *p1, const void *p2, size_t len); + +diff --git a/src/external/libafsdep b/src/external/libafsdep +index fb365df2d..9d36a30c0 100644 +--- a/src/external/libafsdep ++++ b/src/external/libafsdep +@@ -24,3 +24,4 @@ heimdal/krb5/crypto-evp.c + heimdal/krb5/keyblock.c + heimdal/krb5/store-int.c + heimdal/roken/ct.c ++heimdal/roken/strlcpy.c +\ No newline at end of file +diff --git a/src/libafs/MakefileProto.LINUX.in b/src/libafs/MakefileProto.LINUX.in +index 8744ab8b6..6e62c8c97 100644 +--- a/src/libafs/MakefileProto.LINUX.in ++++ b/src/libafs/MakefileProto.LINUX.in +@@ -42,7 +42,8 @@ AFS_OS_OBJS = \ + osi_ioctl.o \ + osi_proc.o \ + osi_vnodeops.o \ +- osi_pagecopy.o ++ osi_pagecopy.o \ ++ strlcpy-kernel.o + + AFS_OS_PAGOBJS = \ + osi_alloc.o \ +@@ -59,7 +60,8 @@ AFS_OS_PAGOBJS = \ + osi_flush.o \ + <all> + osi_ioctl.o \ +- osi_pag_module.o ++ osi_pag_module.o \ ++ strlcpy-kernel.o + + AFS_OS_NFSOBJS = + +-- +2.44.0 + diff --git a/0029-afs-Drop-GLOCK-for-various-Rx-calls.patch b/0029-afs-Drop-GLOCK-for-various-Rx-calls.patch new file mode 100644 index 000000000000..02b30b80d7b2 --- /dev/null +++ b/0029-afs-Drop-GLOCK-for-various-Rx-calls.patch @@ -0,0 +1,362 @@ +From 35c339ec6b648deb02f7598c02df07b0c2ad0021 Mon Sep 17 00:00:00 2001 +From: Andrew Deason <adeason@dson.org> +Date: Sun, 3 May 2020 10:33:28 -0500 +Subject: [PATCH 29/29] afs: Drop GLOCK for various Rx calls + +Most calls into Rx from libafs do so without the AFS_GLOCK, but a few +pieces of code still hold AFS_GLOCK while making some Rx calls. A few +calls into Rx also currently require AFS_GLOCK, but drop AFS_GLOCK +internally, which is somewhat confusing/inconsistent. Calling Rx +functions with AFS_GLOCK held can potentially cause locking/allocation +problems on various platforms, such as FreeBSD where we get WITNESS +warnings about acquiring sleepable Rx locks while holding the +non-sleepable AFS_GLOCK. + +Fix a variety of Rx calls from libafs to drop AFS_GLOCK before calling +into Rx. Specifically, this commit handles calls to rxi_GetIFInfo, +rx_InitHost, rx_StartServer, rx_ServerProc, rx_GetConnection, +rx_DestroyConnection/rx_PutConnection, and +rx_SetConnSecondsUntilNatPing. + +For calls made via afs_start_thread, adjust afs_start_thread to accept +a new argument that says whether to acquire AFS_GLOCK for the relevant +function or not. + +For a call to rx_InitHost inside afs_InitSetup, dropping GLOCK makes +it possible for another thread to also enter afs_InitSetup while we're +running, before afs_InitSetup_done is set. To prevent two threads from +running afs_InitSetup in parallel, introduce afs_InitSetup_running +(which is set while afs_InitSetup is running), and simply wait for it +to be cleared if it is set when we enter afs_InitSetup. + +This commit does not handle strictly all calls into Rx from libafs, +since many Rx calls don't do anything interesting besides set some +internal variables, and so AFS_GLOCK doesn't really matter for them, +and dropping/reacquiring it around those calls may have performance +impact. + +Reviewed-on: https://gerrit.openafs.org/14184 +Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> +Tested-by: BuildBot <buildbot@rampaginggeek.com> +(cherry picked from commit d5e1428a3bd4a7fbb4401cf17176474f0c1825d3) + + Conflicts: + src/afs/afs_call.c - context only due to not having commit: + 'Log binding ip address and port during startup' (02dede5d40) + +Change-Id: I0d14105d5dc8bfd4740c7a9adfc61c36f8a2318c +--- + src/afs/LINUX/osi_misc.c | 22 +++++++++++++++++++--- + src/afs/LINUX/osi_prototypes.h | 2 +- + src/afs/afs_call.c | 19 ++++++++++++++++++- + src/afs/afs_callback.c | 2 ++ + src/afs/afs_conn.c | 6 ++++++ + src/afs/afs_daemons.c | 14 ++++++++------ + src/afs/afs_init.c | 2 ++ + src/afs/afs_pag_call.c | 15 ++++++++++----- + src/rx/rx_kcommon.c | 10 ---------- + 9 files changed, 66 insertions(+), 26 deletions(-) + +diff --git a/src/afs/LINUX/osi_misc.c b/src/afs/LINUX/osi_misc.c +index aa5d5fc93..be6984661 100644 +--- a/src/afs/LINUX/osi_misc.c ++++ b/src/afs/LINUX/osi_misc.c +@@ -155,7 +155,18 @@ int osi_abspath(char *aname, char *buf, int buflen, + + + /* This could use some work, and support on more platforms. */ +-int afs_thread_wrapper(void *rock) ++static int ++afs_thread_wrapper(void *rock) ++{ ++ void (*proc)(void) = rock; ++ __module_get(THIS_MODULE); ++ (*proc)(); ++ module_put(THIS_MODULE); ++ return 0; ++} ++ ++static int ++afs_thread_wrapper_glock(void *rock) + { + void (*proc)(void) = rock; + __module_get(THIS_MODULE); +@@ -166,7 +177,12 @@ int afs_thread_wrapper(void *rock) + return 0; + } + +-void afs_start_thread(void (*proc)(void), char *name) ++void ++afs_start_thread(void (*proc)(void), char *name, int needs_glock) + { +- kthread_run(afs_thread_wrapper, proc, "%s", name); ++ if (needs_glock) { ++ kthread_run(afs_thread_wrapper_glock, proc, "%s", name); ++ } else { ++ kthread_run(afs_thread_wrapper, proc, "%s", name); ++ } + } +diff --git a/src/afs/LINUX/osi_prototypes.h b/src/afs/LINUX/osi_prototypes.h +index 130b5660e..2ed054339 100644 +--- a/src/afs/LINUX/osi_prototypes.h ++++ b/src/afs/LINUX/osi_prototypes.h +@@ -50,7 +50,7 @@ extern int osi_lookupname(char *aname, uio_seg_t seg, int followlink, + struct dentry **dpp); + extern int osi_abspath(char *aname, char *buf, int buflen, + int followlink, char **pathp); +-extern void afs_start_thread(void (*proc)(void), char *name); ++extern void afs_start_thread(void (*proc)(void), char *name, int needs_glock); + + /* osi_probe.c */ + extern void *osi_find_syscall_table(int which); +diff --git a/src/afs/afs_call.c b/src/afs/afs_call.c +index 4ac63b187..7fb323c29 100644 +--- a/src/afs/afs_call.c ++++ b/src/afs/afs_call.c +@@ -104,11 +104,19 @@ extern afs_int32 afs_md5inum; + static int + afs_InitSetup(int preallocs) + { ++ static int afs_InitSetup_running; ++ + int code; + ++ while (afs_InitSetup_running) { ++ afs_osi_Sleep(&afs_InitSetup_running); ++ } ++ + if (afs_InitSetup_done) + return EAGAIN; + ++ afs_InitSetup_running = 1; ++ + #ifdef AFS_SUN510_ENV + /* Initialize a RW lock for the ifinfo global array */ + rw_init(&afsifinfo_lock, NULL, RW_DRIVER, NULL); +@@ -133,10 +141,12 @@ afs_InitSetup(int preallocs) + /* start RX */ + if(!afscall_set_rxpck_received) + rx_extraPackets = AFS_NRXPACKETS; /* smaller # of packets */ ++ AFS_GUNLOCK(); + code = rx_InitHost(rx_bindhost, htons(7001)); ++ AFS_GLOCK(); + if (code) { + afs_warn("AFS: RX failed to initialize %d).\n", code); +- return code; ++ goto done; + } + rx_SetRxDeadTime(afs_rx_deadtime); + /* resource init creates the services */ +@@ -145,6 +155,9 @@ afs_InitSetup(int preallocs) + afs_InitSetup_done = 1; + afs_osi_Wakeup(&afs_InitSetup_done); + ++ done: ++ afs_InitSetup_running = 0; ++ afs_osi_Wakeup(&afs_InitSetup_running); + return code; + } + +@@ -1703,7 +1716,9 @@ afs_shutdown(enum afs_shutdown_type cold_flag) + afs_warn("CB... "); + + afs_termState = AFSOP_STOP_RXCALLBACK; ++ AFS_GUNLOCK(); + rx_WakeupServerProcs(); ++ AFS_GLOCK(); + #ifdef AFS_AIX51_ENV + shutdown_rxkernel(); + #endif +@@ -1756,7 +1771,9 @@ afs_shutdown(enum afs_shutdown_type cold_flag) + afs_warn("NetIfPoller... "); + osi_StopNetIfPoller(); + #endif ++ AFS_GUNLOCK(); + rxi_FreeAllPackets(); ++ AFS_GLOCK(); + + afs_termState = AFSOP_STOP_COMPLETE; + +diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c +index 1fe990edf..7cffef6ff 100644 +--- a/src/afs/afs_callback.c ++++ b/src/afs/afs_callback.c +@@ -985,7 +985,9 @@ afs_RXCallBackServer(void) + /* + * Donate this process to Rx. + */ ++ AFS_GUNLOCK(); + rx_ServerProc(NULL); ++ AFS_GLOCK(); + return (0); + + } /*afs_RXCallBackServer */ +diff --git a/src/afs/afs_conn.c b/src/afs/afs_conn.c +index 2a3a513b2..8728ce518 100644 +--- a/src/afs/afs_conn.c ++++ b/src/afs/afs_conn.c +@@ -532,7 +532,9 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell, + */ + if ((service != 52) && (sap->natping == NULL)) { + sap->natping = tc; ++ AFS_GUNLOCK(); + rx_SetConnSecondsUntilNatPing(tc->id, 20); ++ AFS_GLOCK(); + } + + tc->forceConnectFS = 0; /* apparently we're appropriately connected now */ +@@ -542,7 +544,9 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell, + } /* end of if (tc->forceConnectFS)*/ + + *rxconn = tc->id; ++ AFS_GUNLOCK(); + rx_GetConnection(*rxconn); ++ AFS_GLOCK(); + + ReleaseSharedLock(&afs_xconn); + return tc; +@@ -672,7 +676,9 @@ afs_PutConn(struct afs_conn *ac, struct rx_connection *rxconn, + (unsigned long)(uintptrsz)ac, (int)ac->refCount); + } + ac->parent->refCount--; ++ AFS_GUNLOCK(); + rx_PutConnection(rxconn); ++ AFS_GLOCK(); + } /*afs_PutConn */ + + +diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c +index 1879772fb..632aa849b 100644 +--- a/src/afs/afs_daemons.c ++++ b/src/afs/afs_daemons.c +@@ -223,19 +223,21 @@ afs_Daemon(void) + } + } + if (last10MinCheck + 600 < now) { ++ int addrs_changed; + #ifdef AFS_USERSPACE_IP_ADDR + extern int rxi_GetcbiInfo(void); + #endif + afs_Trace1(afs_iclSetp, CM_TRACE_PROBEUP, ICL_TYPE_INT32, 600); + #ifdef AFS_USERSPACE_IP_ADDR +- if (rxi_GetcbiInfo()) { /* addresses changed from last time */ +- afs_FlushCBs(); +- } +-#else /* AFS_USERSPACE_IP_ADDR */ +- if (rxi_GetIFInfo()) { /* addresses changed from last time */ ++ addrs_changed = rxi_GetcbiInfo(); ++#else ++ AFS_GUNLOCK(); ++ addrs_changed = rxi_GetIFInfo(); ++ AFS_GLOCK(); ++#endif ++ if (addrs_changed) { /* addresses changed from last time */ + afs_FlushCBs(); + } +-#endif /* else AFS_USERSPACE_IP_ADDR */ + if (!afs_CheckServerDaemonStarted) + afs_CheckServers(0, NULL); + afs_GCUserData(); /* gc old conns */ +diff --git a/src/afs/afs_init.c b/src/afs/afs_init.c +index bdb791c1a..efa513256 100644 +--- a/src/afs/afs_init.c ++++ b/src/afs/afs_init.c +@@ -554,7 +554,9 @@ afs_ResourceInit(int preallocs) + afs_server = + rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", &secobj, 1, + RXSTATS_ExecuteRequest); ++ AFS_GUNLOCK(); + rx_StartServer(0); ++ AFS_GLOCK(); + afs_osi_Wakeup(&afs_server); /* wakeup anyone waiting for it */ + return 0; + +diff --git a/src/afs/afs_pag_call.c b/src/afs/afs_pag_call.c +index 610cfb3a8..9b7a90631 100644 +--- a/src/afs/afs_pag_call.c ++++ b/src/afs/afs_pag_call.c +@@ -91,10 +91,13 @@ afspag_Init(afs_int32 nfs_server_addr) + afs_uuid_create(&afs_cb_interface.uuid); + + AFS_GLOCK(); +- + afs_InitStats(); ++ AFS_GUNLOCK(); ++ + rx_Init(htons(7001)); + ++ AFS_GLOCK(); ++ + AFS_STATCNT(afs_ResourceInit); + AFS_RWLOCK_INIT(&afs_xuser, "afs_xuser"); + AFS_RWLOCK_INIT(&afs_xpagcell, "afs_xpagcell"); +@@ -117,18 +120,20 @@ afspag_Init(afs_int32 nfs_server_addr) + 1, RXSTATS_ExecuteRequest); + pagcb_svc = rx_NewService(0, PAGCB_SERVICEID, "pagcb", &srv_secobj, + 1, PAGCB_ExecuteRequest); ++ AFS_GUNLOCK(); + rx_StartServer(0); ++ AFS_GLOCK(); + + clt_secobj = rxnull_NewClientSecurityObject(); + rmtsys_conn = rx_NewConnection(nfs_server_addr, htons(7009), + RMTSYS_SERVICEID, clt_secobj, 0); + + #ifdef RXK_LISTENER_ENV +- afs_start_thread(rxk_Listener, "Rx Listener"); ++ afs_start_thread(rxk_Listener, "Rx Listener", 1); + #endif +- afs_start_thread((void *)(void *)rx_ServerProc, "Rx Server Thread"); +- afs_start_thread(afs_rxevent_daemon, "Rx Event Daemon"); +- afs_start_thread(afs_Daemon, "AFS PAG Daemon"); ++ afs_start_thread((void *)(void *)rx_ServerProc, "Rx Server Thread", 0); ++ afs_start_thread(afs_rxevent_daemon, "Rx Event Daemon", 1); ++ afs_start_thread(afs_Daemon, "AFS PAG Daemon", 1); + + afs_icl_InitLogs(); + +diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c +index c90df3d36..239cf1607 100644 +--- a/src/rx/rx_kcommon.c ++++ b/src/rx/rx_kcommon.c +@@ -267,13 +267,7 @@ rx_ServerProc(void *unused) + threadID = rxi_availProcs++; + MUTEX_EXIT(&rx_quota_mutex); + +-# ifdef RX_ENABLE_LOCKS +- AFS_GUNLOCK(); +-# endif /* RX_ENABLE_LOCKS */ + rxi_ServerProc(threadID, NULL, NULL); +-# ifdef RX_ENABLE_LOCKS +- AFS_GLOCK(); +-# endif /* RX_ENABLE_LOCKS */ + + return NULL; + } +@@ -856,8 +850,6 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport) + # if (defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)) && defined(KERNEL_FUNNEL) + thread_funnel_switch(KERNEL_FUNNEL, NETWORK_FUNNEL); + # endif +- AFS_ASSERT_GLOCK(); +- AFS_GUNLOCK(); + # if defined(AFS_HPUX102_ENV) + # if defined(AFS_HPUX110_ENV) + /* we need a file associated with the socket so sosend in NetSend +@@ -997,14 +989,12 @@ rxk_NewSocketHost(afs_uint32 ahost, short aport) + # endif /* else defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) */ + # endif /* else AFS_HPUX110_ENV */ + +- AFS_GLOCK(); + # if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL) + thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL); + # endif + return (osi_socket *)newSocket; + + bad: +- AFS_GLOCK(); + # if defined(AFS_DARWIN_ENV) && defined(KERNEL_FUNNEL) + thread_funnel_switch(NETWORK_FUNNEL, KERNEL_FUNNEL); + # endif +-- +2.44.0 + @@ -6,44 +6,112 @@ pkgname=openafs-modules-dkms _srcname=openafs -pkgver=1.8.7 +pkgver=1.8.11 pkgrel=1 pkgdesc="Kernel module for OpenAFS (dkms)" arch=('i686' 'x86_64' 'armv7h') url="http://www.openafs.org" -license=('custom:"IBM Public License Version 1.0"') +license=(IPL-1.0) depends=('dkms' 'libelf' 'openafs') provides=("openafs-modules=$pkgver") conflicts=('openafs-features-libafs' 'openafs-modules' 'openafs<1.6.6-2') options=(!emptydirs) -source=("http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2" - "dkms.conf" - 0001-Avoid-duplicate-definitions-of-globals.patch - 0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch - 0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch - 0004-LINUX-5.8-use-lru_cache_add.patch - 0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch) -sha256sums=('53543a561fce67714fec9f2a6bf408c5cc1d061c7dc9d1459458275e8ccbfa79' - '5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0' - '18634d85ca4dec3366533a2767e652dab27202667de1d04f578f40a94d8ec15a' - '4b9d269e2b3c214f9240917b9d895b41e09c1afdbef75e30a0db02a240bf9b0e' - '9e630d2029c113f482c321007522ce887273250c4125aa6fee1229aa78e8f8c3' - '6deaa098e7e6113c426d9449c5b6252c76dfbe4a67705420215ae501de8e9f0d' - '3a0a022a8a4cb1034e60dec9c55727e1be846080f5923a7edcc7e18fe6b57606') +source=(http://openafs.org/dl/openafs/${pkgver}/${_srcname}-${pkgver}-src.tar.bz2 + 0001-afs-Make-afs_AllocDCache-static.patch + 0002-LINUX-Minor-osi_vfsop.c-cleanup.patch + 0003-afs-Remove-SRXAFSCB_GetDE.patch + 0004-afs-remove-dead-ICL-fstrace-code.patch + 0005-cf-Add-function-prototypes-for-linux-conftest.patch + 0006-afs-Remove-DFlushDCache.patch + 0007-afs-Remove-afs_MemExtendEntry.patch + 0008-afs-Remove-afs_osi_UnmaskUserLoop.patch + 0009-afs-Remove-dummy_PSetAcl.patch + 0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch + 0011-afs-Remove-afs_DbgDisconFiles.patch + 0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch + 0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch + 0014-Linux-6.8-Add-function-prototypes-for-krb5.patch + 0015-afs-Declare-init_hckernel_mutex.patch + 0016-afs-Add-includes-to-pick-up-function-prototypes.patch + 0017-afs-Move-function-prototypes-into-headers.patch + 0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch + 0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch + 0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch + 0021-afs-fix-ops-variable-may-be-used-uninitialized.patch + 0022-afs-Add-static-attribute-to-internal-functions.patch + 0023-rx-Add-static-attribute-to-internal-functions.patch + 0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch + 0025-rxgen-Declare-generated-PKG_OpCodeStats.patch + 0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch + 0027-Linux-6.8-Remove-ctl_table-sentinels.patch + 0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch + 0029-afs-Drop-GLOCK-for-various-Rx-calls.patch + dkms.conf) +sha256sums=('e2efb4710996b7d23198b53c56295a8f9e24e8a555317c5fc63b8125a3714ecd' + 'e85f5656f76700e4236b1033cf4b7f08c59ab757d52d2a67dcb2c65762388733' + '8d48b727e77b1e952310ad9f94bd4ece9e64e1f03a35463bb23dffa1009738d8' + 'c44c91e31df1ec77f1a39eb7b172c4e348e41b293ae05606288bfe333ad7c29b' + '48dd1065f8bcb90d0bdc7ae5b484da5a1a5d93461f6ac1d6ceef103d2b807f22' + 'ce054eadb9c84173b0bd1318ef88cb9500049431779252e501491d9389141bad' + 'ae525167f5f6f7e0301eee70b3424e51e45e56e9fe9588b95cf72d5fa96717b9' + '974861c174969591351c5fb4a47946e02f979c2b5590f89d9d16dfbe4238451f' + 'e5d72b5e08c63df10299b56bfebf3c5c44e07d16c0436fb2c0eef3614ad505e3' + '8143496d251dd1f13b8603b4e692fbd67f925caccd12035598e70542d24389f5' + '216e684f8181adc4a4b3c4ba934997cada10831c5608e724e91d09e836ec626d' + '2e573535da21f8be5b83c8e82166c0bdc5896293b28e793fa4c1bdb9ff942dbd' + '0535fbdd3c8431b7b16842f1fa6592355f647ae456112e97d34d541e74204be5' + '7aacef8bd6832f119472f7d52af36951a56f1e54d36d9bce59998fcf818517e5' + '3db5177c80a7694c1be3b74f419570a5076edc519b40112cf17e68fecc7574a3' + '9fe647d54c999e358597fe671dc7e88da609a69bb93624e15919d9b4cc4fdb5a' + '7ced2ca2d4f54b2fa15c584869de122810ee0d1b024d1bf541f38d77172e311c' + 'c88c8b8e1c993da773eea3ae4f17e5171189ed7e1fc5769fdb49d82cae0cffd3' + 'c57c826c9f26568241bcb17eff04067a1b5e388f72523765aa80d480c3690325' + 'd508dd6136170fcb4794e283178f9c5f4ede12f415b882ba7c13470e8f09bdde' + '894eb7e7889749cefa9cbf86e2eceda470d20510a5a7a5be2cd851f8570e076c' + 'fb36b0ef833811910cae42d8411a00dcf2aff08c8799f766e32cda3ad5a7f0e2' + 'd08d38ff53890632900de5d69dc105711d5bce2d02a55ffe70c87b38ca39aca7' + 'db700b5f62e979af60856278306e8fce6df21dfb24996dd0d690c82222f4d793' + '46294f8323bf71ee96c8f765bb36fc5e0af6b2257deac7eaea4f4cb9568d9fe1' + '5d4a2614065046a32ef805198349e70476d3ed9e079a4ef7577e71e0dac1d2fa' + '4c8201265f558bac146bf8cee38f8c925b2c2262133ae88d9eb2f0623a0ada07' + 'ceb02a7a5e596434215693f065ad6221f568f85aab173df4752248d2c4d8f971' + '2b05242c5516871191a251a617c6c02e80f34b92b6cfeb0c9c6a1f3e0ff915d9' + '82b197ac5f2639d891c8a646963ef6b87ef4171c7a70ac6ca7a9a55511090952' + '5ea5e184f9b44f5ed45817d2b5a10149d15c8c54f49e0b5b4b773652673cb9b0') prepare() { cd "${srcdir}/${_srcname}-${pkgver}" - # Fix compilation with GCC 10 - patch -p1 < "${srcdir}"/0001-Avoid-duplicate-definitions-of-globals.patch - - # Compatibility with Linux 5.8 - patch -p1 < "${srcdir}"/0002-LINUX-5.8-Replace-kernel_setsockopt-with-new-funcs.patch - patch -p1 < "${srcdir}"/0003-LINUX-5.8-do-not-set-name-field-in-backing_dev_info.patch - patch -p1 < "${srcdir}"/0004-LINUX-5.8-use-lru_cache_add.patch - - # Compatibility with Linux 5.9 - patch -p1 < "${srcdir}"/0005-LINUX-5.9-Remove-HAVE_UNLOCKED_IOCTL-COMPAT_IOCTL.patch + # Compatibility with Linux 6.8 + patch -p1 < "$srcdir"/0001-afs-Make-afs_AllocDCache-static.patch + patch -p1 < "$srcdir"/0002-LINUX-Minor-osi_vfsop.c-cleanup.patch + patch -p1 < "$srcdir"/0003-afs-Remove-SRXAFSCB_GetDE.patch + patch -p1 < "$srcdir"/0004-afs-remove-dead-ICL-fstrace-code.patch + patch -p1 < "$srcdir"/0005-cf-Add-function-prototypes-for-linux-conftest.patch + patch -p1 < "$srcdir"/0006-afs-Remove-DFlushDCache.patch + patch -p1 < "$srcdir"/0007-afs-Remove-afs_MemExtendEntry.patch + patch -p1 < "$srcdir"/0008-afs-Remove-afs_osi_UnmaskUserLoop.patch + patch -p1 < "$srcdir"/0009-afs-Remove-dummy_PSetAcl.patch + patch -p1 < "$srcdir"/0010-afs-Remove-SRXAFSCB_FetchData-StoreData.patch + patch -p1 < "$srcdir"/0011-afs-Remove-afs_DbgDisconFiles.patch + patch -p1 < "$srcdir"/0012-afs-Add-declaration-for-RXAFS_ResidencyCmd.patch + patch -p1 < "$srcdir"/0013-roken-Declare-ct_memcmp-in-hcrypto-kernel-roken.h.patch + patch -p1 < "$srcdir"/0014-Linux-6.8-Add-function-prototypes-for-krb5.patch + patch -p1 < "$srcdir"/0015-afs-Declare-init_hckernel_mutex.patch + patch -p1 < "$srcdir"/0016-afs-Add-includes-to-pick-up-function-prototypes.patch + patch -p1 < "$srcdir"/0017-afs-Move-function-prototypes-into-headers.patch + patch -p1 < "$srcdir"/0018-afs-Add-afs_xioctl-prototyes-to-afs_prototypes.h.patch + patch -p1 < "$srcdir"/0019-afs-Remove-SRXAFSCB-protos-from-afs_prototypes.h.patch + patch -p1 < "$srcdir"/0020-rx-Add-function-prototypes-to-rx_prototypes.h.patch + patch -p1 < "$srcdir"/0021-afs-fix-ops-variable-may-be-used-uninitialized.patch + patch -p1 < "$srcdir"/0022-afs-Add-static-attribute-to-internal-functions.patch + patch -p1 < "$srcdir"/0023-rx-Add-static-attribute-to-internal-functions.patch + patch -p1 < "$srcdir"/0024-rxgen-Declare-generated-PKG_TranslateOpCode.patch + patch -p1 < "$srcdir"/0025-rxgen-Declare-generated-PKG_OpCodeStats.patch + patch -p1 < "$srcdir"/0026-Linux-6.8-use-hlist-iteration-for-dentry-children.patch + patch -p1 < "$srcdir"/0027-Linux-6.8-Remove-ctl_table-sentinels.patch + patch -p1 < "$srcdir"/0028-Linux-6.8-Use-roken-s-strlcpy-in-kernel-module.patch + patch -p1 < "$srcdir"/0029-afs-Drop-GLOCK-for-various-Rx-calls.patch # Only needed when changes to configure were made ./regen.sh -q |