commit eb107ed5c6dd3a53b8a0593054cdf5a03e1421d7 Author: Benjamin Kaduk Date: Sat Jul 28 10:16:37 2018 -0500 Make OpenAFS 1.8.1 Update version strings for the 1.8.1 release. (Note that the version number for Windows for the 1.8.1 prereleases was erroneously 1.8.99xx, when it should have been 1.8.00xx to reflect "next after 1.8.0-final".) Change-Id: I2ce32aeae50d80b88cbc3f73f6787e3a15747085 Reviewed-on: https://gerrit.openafs.org/13266 Reviewed-by: Stephan Wiesand Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 8de97842003b7ee0e48c2e853a7d595813aac1e7 Author: Benjamin Kaduk Date: Sat Jul 28 10:13:13 2018 -0500 Update NEWS for 1.8.1 Change-Id: I341cf2a5e02874629ceee2c9e46d4f764e3494fa Reviewed-on: https://gerrit.openafs.org/13265 Tested-by: BuildBot Reviewed-by: Stephan Wiesand Reviewed-by: Benjamin Kaduk commit 607eba34dbc049bfad22a2ccc64e105b112739a4 Author: Marcio Barbosa Date: Thu Jul 26 10:30:35 2018 -0700 redhat: actually remove unused AFS::ukernel man page Commit 278581c24a802834719e0d57f27978321556c9bb (redhat: package libuafs perl bindings) added swig as a build dependency on RHEL 6+/Fedora 15+ to build and package AFS::ukernel perl bindings for libuafs. The man page for AFS::ukernel is generated from the pod files unconditionally, so needs to be removed from the staging directories when AFS::ukernel is not packaged. Unfortunately, the full path to the staged AFS::ukernel manpage was not given in that commit, so the rpmbuild will fail on RHEL 5 with the error: RPM build errors: Installed (but unpackaged) file(s) found: /usr/share/man/man3/AFS::ukernel.3.gz Fix this error by specifying the full path to the AFS::ukernel man page to actually remove it when we are not packaging AFS::ukernel files. [mmeffie: updated commit message] Reviewed-on: https://gerrit.openafs.org/13257 Reviewed-by: Marcio Brito Barbosa Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk (cherry picked from commit a85aab9dfe7c2ee9e025bc15d849de2dd0a48913) Change-Id: If81f930bd7e922cd5e71c0d459751d4bbe85c843 Reviewed-on: https://gerrit.openafs.org/13264 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 6dd052cbab09c95e97c910421cfaf68713e906c5 Author: Andrew Deason Date: Thu Apr 26 12:27:12 2018 -0500 afs: Stop looking for dcaches on Get*DSlot errors In various places in the code, we'll be looking for a dslot, calling afs_GetValidDSlot (or afs_GetUnusedDSlot) in a loop. In a few places, we currently keep looking for the dslot when we get an error back, since afs_GetValidDSlot may return successfully for other slots, and we might find the dslot we're looking for. This behavior was introduced in a few commits, including: - commit 2679af76 (afs: Traverse discard/free dslot list if errors) - commit 00fd34a6 (afs: Handle easy GetValidDSlot errors) - commit 9a558660 (afs: Cope with afs_GetValidDSlot errors) This behavior means that if afs_GetValidDSlot/afs_GetUnusedDSlot returns an error for a particular dcache slot, but other slots are okay, then we may still find the dcache we're looking for. However, by far the most common reason that afs_GetValidDSlot/afs_GetUnusedDSlot fails is because our disk cache is completely unusable; it is very rare that only a few slots cannot be used, but others are fine (this would mean that the disk cache was corrupted in oddly specific ways, or there are small isolated errors in the underlying disk). So continuing the dcache search in these situations is not very useful. On Linux, this is most commonly seen by the underlying disk cache i/o calls returning -EINTR, which can happen if a SIGKILL signal is pending for the current process when we try to do the i/o. In this situation, all attempts to read in a dslot from disk will fail; trying other slots or waiting will not improve the situation. Depending on which specific code path encounters an afs_Get*DSlot error, we can then flood the log with "disk cache read error in CacheItems" messages emitted from afs_UFSGetDSlot, since we keep calling afs_Get*DSlot in our loop. The worst offender of this is usually afs_GetDSlotFromList via afs_AllocDCache, since we end up calling afs_GetUnusedDSlot for every single dslot in the free and discard lists. However, our other call sites that are looking for dcaches for a specific file can still generate quite a few of these messages, since we'll end up calling afs_GetValidDSlot for every slot in a dcache hash chain. So to avoid flooding the log in these situations, change most callers of afs_GetValidDSlot and afs_GetUnusedDSlot to stop on the first error, and act like we never found a dcache that we were looking for. This commit also adjusts one caller in afs_ProcessOpCreate, which was not handling errors from afs_GetValidDSlot at all, and changes FlushVolumeData to be able to return error codes. Reviewed-on: https://gerrit.openafs.org/13034 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 12f4fd2901fee8bf27c2cec97efd3d242c6ff025) Change-Id: I2a9865e510be39d1b5bcb9280419630036c00bef Reviewed-on: https://gerrit.openafs.org/13191 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Joe Gorse Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 4b42b490fc1c2223a465981a59914b37773ad84a Author: Andrew Deason Date: Fri Jun 29 15:25:48 2018 -0500 afs: Make afs_osi_Free(NULL) a no-op In userspace, we assume that free(NULL) does nothing, which makes certain cleanup code paths simpler. This may or may not be true for our free() abstractions that can run in the kernel (like afs_osi_Free, rxi_Free, etc), which is confusing. To make the higher-level free() abstractions more consistent, change afs_osi_Free to guarantee that passing a NULL pointer does nothing. Reviewed-on: https://gerrit.openafs.org/13236 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 7523397333c0f8c6a08312434968d84b8ff56306) Change-Id: Ifda1bd8c99f128fe01d38fd64dc19afee4c5158f Reviewed-on: https://gerrit.openafs.org/13250 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 6fed86775ba9ac7edc9444986c75a60771927411 Author: Andrew Deason Date: Thu Jul 5 17:16:48 2018 -0500 LINUX: Detect NULL page during write_begin In afs_linux_write_begin, we call grab_cache_page_write_begin to get a page to use for writing data when servicing a write into AFS. Under low-memory conditions, this can return NULL if Linux cannot find a free page to use. Currently, we always try to reference the page returned, and so this causes a BUG. To avoid this, check if grab_cache_page_write_begin returns NULL, and just return -ENOMEM, like other callers of grab_cache_page_write_begin do. Linux's fault injection framework is useful for testing code paths like these. The following settings made it possible to somewhat-reliably exercise the relevant code path on a test RHEL7 system: # grep ^ /sys/kernel/debug/fail_page_alloc/* /sys/kernel/debug/fail_page_alloc/ignore-gfp-highmem:Y /sys/kernel/debug/fail_page_alloc/ignore-gfp-wait:N /sys/kernel/debug/fail_page_alloc/interval:1 /sys/kernel/debug/fail_page_alloc/min-order:0 /sys/kernel/debug/fail_page_alloc/probability:100 /sys/kernel/debug/fail_page_alloc/space:90 /sys/kernel/debug/fail_page_alloc/task-filter:Y /sys/kernel/debug/fail_page_alloc/times:-1 [...] Reviewed-on: https://gerrit.openafs.org/13242 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 89e80c354c404dedc0e5197f99710db0e5e08767) Change-Id: I37b4d1ebb1b76e435bb1c56a76d7e475f47f33de Reviewed-on: https://gerrit.openafs.org/13243 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Mark Vitale Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit 9b04eac509990b8eb0414de5f604ac3456a5bce5 Author: Michael Meffie Date: Fri Jul 6 15:22:36 2018 -0400 vldb_check: write mh entry header flags in network order Commit 6b93ad695e53a86dbe9eea13bd0ff651e1d8c9b7 fixed a false error reported when the vldb contained more than one mh extent blocks. That fix changed the readMH() function to convert the flags field to host byte order of all the mh blocks, not just the first block, in order to check the value of those flags. Unfortunately, that commit missed converting non-zero blocks back to network byte order in the complementary writeMH() function, which is used to write the data back to disk when vldb_check is run with the -fix option. FIXES 134589 Reviewed-on: https://gerrit.openafs.org/13245 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 483cad0121d848836b4155817b86231ef21be27a) Change-Id: I28afa243c78d0a8a53e13f302d69c17a779837d9 Reviewed-on: https://gerrit.openafs.org/13246 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit 38a6a62b10ba895f77b8617a460322b5d834bbe0 Author: Stephan Wiesand Date: Mon Jul 2 14:05:47 2018 +0200 redhat: parallel builds Parallel builds can be an order of magnitude faster. Add the _smp_mflags macro to all invocations of make in the rpm spec, to make use of all available cores and SMT threads on the build system. This should also help noticing new dependency issues early. Note the macro can be overridden on the rpmbuild command line. Reviewed-on: https://gerrit.openafs.org/13240 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit e60766286b7a581dcdd14466884ea7fdcae10918) Change-Id: I3428e5acc7114a5bf1a1090352055041ef099fbd Reviewed-on: https://gerrit.openafs.org/13249 Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: Benjamin Kaduk commit b70c8e193c3187b4fd5367e4b1cb008f126ca9e5 Author: Stephan Wiesand Date: Mon Jul 2 13:33:20 2018 +0200 redhat: speed up userland-only rpm builds When building with --define "build_modules 0", have configure skip the Linux kernel tests, which are slow and many. Reviewed-on: https://gerrit.openafs.org/13239 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit ab61bcffefdd0a431a435def193cd9a46e3b8ab6) Change-Id: I030c4fab62bc8973dd4d914374865569d878090d Reviewed-on: https://gerrit.openafs.org/13248 Reviewed-by: Mark Vitale Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: Benjamin Kaduk commit d5def58a0e474d232ab831ca06bf370af2d7a833 Author: Stephan Wiesand Date: Mon Jul 2 13:28:07 2018 +0200 redhat: package new file include/opr/lock.h Commit 792dd44ac57032a3f2a4743c83c8a0208a08ecec added the installation of include/opr/lock.h, but the rpm spec fails to pick it up, making rpm builds fail. Add the new file to the files list for the -devel package. FIXES 134579 Reviewed-on: https://gerrit.openafs.org/13238 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit babf419886d687f8359159f35e8b89aff5e166f8) Change-Id: I32b6737a6868239c56a604030a49cc45f0379707 Reviewed-on: https://gerrit.openafs.org/13247 Reviewed-by: Mark Vitale Tested-by: Stephan Wiesand Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit 5875ee876941e507b777e4cb1cd05642402997ce Author: Benjamin Kaduk Date: Thu Jun 21 21:05:56 2018 -0500 Make OpenAFS 1.8.1pre2 Update version strings for the first 1.8.1 prerelease. (This time, for sure!) Change-Id: I50a1f939f64f0fd78c47c99d4c921d28c00380ce Reviewed-on: https://gerrit.openafs.org/13231 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 9a8aac9ed93f0e167399df7d4c156b7c227056cc Author: Benjamin Kaduk Date: Sun Jul 1 12:43:28 2018 -0500 Update NEWS for 1.8.1pre2 Change-Id: I5ceba218589aab4f2c3c1874661e2edbb9be0b65 Reviewed-on: https://gerrit.openafs.org/13230 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 0c8551135a6be6e81d79eeb117be43a0b783d7be Author: Mark Vitale Date: Sat Jun 30 17:35:09 2018 -0400 rxevent: prevent negative rx_connection refCount rxi_ChallengeEvent is called directly from rxi_ChallengeOn to start the first challenge; subsequent calls to rxi_ChallengeEvent are from the event handler. When called as an event, we must putConnection the reference held by the event. But when called directly for the first time, the event has not been scheduled yet and so has not taken a reference on the connection. For this case, we must not putConnection or the rx_connection refCount will go negative. One reported symptom of this bug is a fileserver crash with: 'Assertion failed! file rx.c, line 1327.' Introduced by commit 304d758983b499dc568d6ca57b6e92df24b69de8 ('Standardize rx_event usage'). Reviewed-on: https://gerrit.openafs.org/13228 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit b1ad473be01162fe9b3835544a835c4dcf0fcb35) Change-Id: Ice5856627f4f77b5ede3a84fef4b6f2915f5477d Reviewed-on: https://gerrit.openafs.org/13229 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk commit ec4488afc260238ca0a8af33cd71b9b5df8ee14d Author: Benjamin Kaduk Date: Thu Jun 21 21:05:56 2018 -0500 Make OpenAFS 1.8.1pre1 Update version strings for the first 1.8.1 prerelease. Change-Id: Iaf262f468d36fb27d4ce8c994483c99bde666aff Reviewed-on: https://gerrit.openafs.org/13225 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk commit 0a40a42f15e7778908b569390a05352d53841101 Author: Benjamin Kaduk Date: Sun Jun 17 22:31:21 2018 -0500 Update NEWS for 1.8.1pre1 Change-Id: I9c443b26cd937b7d7d0d6863ca92792dfacae770 Reviewed-on: https://gerrit.openafs.org/13224 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit c35db455f2452121ca27c821bc74b04352b4fad8 Author: Benjamin Kaduk Date: Fri Jun 15 09:07:04 2018 -0500 Comment out missing comerr functions from afsauthent.def Apparently commit 70c4922980d1596155b4021cd72d6895c2371e23 was overzealous in making Windows match Unix, as these functions are not available in the Windows build. Reviewed-on: https://gerrit.openafs.org/13219 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 9d0b2698ac7ab8bb689f30d819bbef08c05a8bf7) Change-Id: I6ea04a04a2e18f3a8b7f2fdd0e2ca49f4b208361 Reviewed-on: https://gerrit.openafs.org/13222 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit ef568fbb1980764e9b21660bc224a53c5601a8ce Author: Benjamin Kaduk Date: Fri Jun 15 08:39:47 2018 -0500 Comment out opr_AssertionFailed from afsrpc.def Apparently the Windows utilities link opr.lib directly, so this caused a "multiply defined symbol" error. Reviewed-on: https://gerrit.openafs.org/13216 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 907e09ff2b7e86005765a594db27e1df194ec204) Change-Id: Ibdd1388235086177bd3fec3c1088916d71fc204f Reviewed-on: https://gerrit.openafs.org/13221 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit c9fc9dbf59e0239f064f7c6d865bc4a267505f89 Author: Benjamin Kaduk Date: Fri Jun 15 08:16:26 2018 -0500 Comment out (again!) xdr_Capabilities from afsrpc.def This shows up as an "unresolved external" when linking (though apparently this error does not cause a buildbot failure), noticed when viewing a related windows build log. Reviewed-on: https://gerrit.openafs.org/13215 Reviewed-by: Benjamin Kaduk Tested-by: Benjamin Kaduk (cherry picked from commit 94f1c1e2a7125e93ed49de31522be806af28626b) Change-Id: Ia3a4977f00a0e4b3e3a9c16b20028d78269c4ce8 Reviewed-on: https://gerrit.openafs.org/13220 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 3e414d9b0eb1eb064bcc8d0931d54867d736c0a3 Author: Benjamin Kaduk Date: Thu Jun 14 20:35:46 2018 -0500 Un-export opr_AssertFailU It appears to have been created for parity with osi_AssertFailU, but was then never used. It is safe to remove the export line, since this export has never been in a released version of OpenAFS. Reviewed-on: https://gerrit.openafs.org/13212 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 691757576fb6d60a34fef2c4bc50ae581b65ad76) Change-Id: I4811d1587fc7a25e90e2a0203d965ef352efe7c5 Reviewed-on: https://gerrit.openafs.org/13214 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit 992fd205bdd19c7d98814d8e234dad03a62d506f Author: Benjamin Kaduk Date: Thu May 31 19:02:18 2018 -0500 libafsrpc: export more xdr functions Most of the xdr functions in the library text are to support RXAFS and RXAFSCB RPCs, which we explicitly do not expose from libafsrpc. As such, they do not need to be in the export list, but a couple of generic ones probably should be exported. Do so, for both Unix and Windows. Reviewed-on: https://gerrit.openafs.org/13139 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 6e7db633efad1c88bb300089e3bd4c9feaea5f23) Change-Id: I42ae33f5fdb36401d052cfb200a22aff423ac0a9 Reviewed-on: https://gerrit.openafs.org/13195 Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit 9c66b92e4e3aa000a42044efe7cffa2a46058d73 Author: Benjamin Kaduk Date: Thu May 31 19:00:03 2018 -0500 libafsrpc: export some more rx functions Reviewed-on: https://gerrit.openafs.org/13138 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 0b1edd96ac7a952148ec14f8baaf60c8d8bbc04f) Change-Id: I86c81dd95c75953ebd193bd8b49b467693572614 Reviewed-on: https://gerrit.openafs.org/13194 Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit 2bb07a8f82dca1246620c5e92600ddaa8d16cf48 Author: Benjamin Kaduk Date: Thu May 31 18:40:21 2018 -0500 Export missing opr functions from libafsrpc Our assertion macros expand to function calls, and we have assertions included in macros in installed headers, so the public needs to be able to link against them. Export for both Unix and Windows. Reviewed-on: https://gerrit.openafs.org/13137 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit f01ee714152a0a6247f2f456aa1f0a728d74373c) Change-Id: I1d983d352f4838619d0b8a833e6be90207dffa87 Reviewed-on: https://gerrit.openafs.org/13193 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Benjamin Kaduk commit 56ce248751d804efe664c9af3b62f5e15a026afe Author: Andrew Deason Date: Thu Apr 26 12:01:57 2018 -0500 afs: Avoid GetDCache delays on screwy cache Currently, if our afs_AllocDCache call fails in afs_GetDCache, we retry once per second for 5 minutes. The reasoning is that we're out of dcache slots, and so if we wait a little while, maybe something will become freeable and we can continue. However, afs_AllocDCache can also fail if we have plenty of free dslots, but we are unable to successfully call afs_GetUnusedDSlot() on any of them. This can happen if our disk cache is screwed up, and so waiting and retrying will not make things better (but we'll spew a ton of "disk cache read error in CacheItems slot" errors in the log each time, and do so 300 times). So instead, only do our sleep/retry loop if we actually appear to be out of free or discarded dslots. Otherwise, just return an error immediately, since sleeping and retrying will not make anything better. Reviewed-on: https://gerrit.openafs.org/13033 Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit bec329c1c81d96b5933527f7cdb3638f24833087) Change-Id: Iaee53eca133985ad5964b61b3641cd8ad2802014 Reviewed-on: https://gerrit.openafs.org/13190 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Joe Gorse Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit 38207faabe6641e97d177160f45ccdaef8cef8ab Author: Andrew Deason Date: Thu Apr 26 12:02:18 2018 -0500 afs: Avoid GetDCache panic on AllocDCache failure Currently, in afs_GetDCache, if afs_AllocDCache fails, we retry for 5 minutes and then panic. Panicing in this situation is completely unnecessary; afs_GetDCache can fail for a variety of other mundane reasons (such as, if we can't fetch the requested data from the relevant fileserver). It may seem unusual for afs_AllocDCache to fail for over 5 minutes (this is supposed to mean that we're out of dslots, and our attempts to free up dslots have failed). However, afs_AllocDCache can also fail if we are having issues in accessing the disk cache, and so we may not be out of cache space or dslots at all; we just can't access the cache. In this case, afs_AllocDCache can easily fail forever; waiting longer or trying to free up cache space isn't going to help. So, to avoid panicing in such situations, just make afs_GetDCache return an error. We just need to make sure afs_xdcache is unlocked, and then we can just jump to 'done', like plenty of other codepaths do; no extra cleanup is required. Also since we are removing a panic, add a log message when this situation happens, so EIO errors don't suddenly pop up silently. Reviewed-on: https://gerrit.openafs.org/13032 Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Reviewed-by: Marcio Brito Barbosa Tested-by: BuildBot (cherry picked from commit 0ff2364bd5e68c0a7587f8fbc552bf20b99d7039) Change-Id: Ie29eed271b490edc943929710a87550e2d67b735 Reviewed-on: https://gerrit.openafs.org/13189 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit bc9ab0d85a37b7126502a810320daffc0fdacfb3 Author: Mark Vitale Date: Tue Jun 5 14:12:20 2018 -0400 xdr: remove dead code, whitespace from xdr_enum The 'enum sizecheck' declaration has been unused since openafs-ibm-1_0; it is apparently vestigial from the original XDR code. Remove it, along with some extraneous whitespace. No functional change is incurred by this commit. Reviewed-on: https://gerrit.openafs.org/13076 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk (cherry picked from commit fdc8adbf0904cbbc0590379c5cb702a15273b40c) Change-Id: Ie586f210d17169a03143d1bdebb8430e3881e58c Reviewed-on: https://gerrit.openafs.org/13184 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit 101c114bd3bcc662c49a565dffc597a70ef1ea80 Author: Mark Vitale Date: Wed Jun 6 15:23:26 2018 -0400 xdr: avoid xdr_enum memory overrun Since openafs-ibm-1_0, xdr_enum has used xdr_long to read and write, even though enum_t is defined as int. For systems where sizeof(int) == sizeof(long), this works by accident. But other systems (e.g., DARWIN ARCHFLAGS=x86_64) xdr_enum will overrun its int-sized second parameter. For XDR_DECODE, this results in memory corruption. This was first noticed with OpenAFS 1.8.0 on macOS 10.13; if aklog is issued while already holding a token, it will fail in token_SetsEquivalent with a segfault in decodeToken. The root cause is that the address passed to decodeToken had been overwritten by a previous call to tokenType -> xdr_enum -> xdr_long. Instead, modify xdr_enum to use xdr_int for its work. Reviewed-on: https://gerrit.openafs.org/13075 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk (cherry picked from commit eb1d2ef203a2a99c908b3b89d9ea8337a91b944b) Change-Id: I548ab43fe4513262b6be0608be45bfd8580e6ed8 Reviewed-on: https://gerrit.openafs.org/13183 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk commit 41285fc801cfa91e099e042ab2bc85599fac63fb Author: Michael Meffie Date: Fri Apr 27 23:08:34 2018 -0400 util: check for trailing characters in partition names The function which maps partition names to partition ids currently ignores trailing characters in the partition names. For example, the partition name "/vicepbogus" is currently considered a valid partition name ("/vicepbogus" maps to "bo" which is id 66). Although this is not a regression, it is problematic for several reasons. Firstly, this can lead to duplicate partition ids on the server, for example "/vicepbad" and "/vicepbar" both map to the same partition id ("ba" is id 52). Second, partitions are internally tracked by numeric id. The partition names are generated from numeric ids when reporting partition names. This means the trailing characters are lost when reporting the partition names. For example, vos reports the attached partition "/vicepbad" as "/vicepba". Third, it could be possible (but perhaps unlikely) in the future to extend the range of partition ids, so the trailing characters could become significant at that time. Finally, it could be confusing to admins that such partition names are attached by the fileserver. For example, "/vicepaa-backup" is attached and is used by the fileserver as partition id 26. This change adds a check for trailing characters in partition names in the volutil_GetPartitionID function, so it is more strict in what it accepts as a valid partition name. That function will now return -1 (illegal partition name) when trailing characters are found in partition names. Reviewed-on: https://gerrit.openafs.org/13039 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot Reviewed-by: Andrew Deason (cherry picked from commit 850c7c50dccbdebb8e0a44da4fc7840760d9e02d) Change-Id: I1244630f3b31408f9f723b97956dca6987dd9747 Reviewed-on: https://gerrit.openafs.org/13121 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Marcio Brito Barbosa Reviewed-by: Andrew Deason Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk commit b5f5e48147ea792b43d8716a5b6e334cbbd925e1 Author: Michael Meffie Date: Mon Apr 9 19:54:54 2018 -0400 autoconf: add kernel module to the summary Add the kernel module to the list of optional build items in the configure summary to indicate whether the kernel module build is enabled. Reviewed-on: https://gerrit.openafs.org/13005 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 3d3e7bc51aaf39b5ca04bfd36ff9017ab0622057) Change-Id: I842752bb12b09fdcab6bfb341673bff3528f3880 Reviewed-on: https://gerrit.openafs.org/13112 Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Reviewed-by: Joe Gorse Reviewed-by: Marcio Brito Barbosa Reviewed-by: Andrew Deason Reviewed-by: Mark Vitale Tested-by: BuildBot commit 0bf4ae5f7630fbb8e3bfb8e4dab19ad3e617ed6a Author: Benjamin Kaduk Date: Sun May 27 22:54:01 2018 -0500 libafsauthent: export additional xdr_ functions Formally, we need to use xdr_free to deallocate storage for RPC output variables, in case the XDR stack uses a different allocator than the standard application allocator. Some types have non-autogenerated wrappers exposed already (e.g., token_FreeSet()), but for a handful of the base ptint types we need to expose the xdr routines in order for a safe way to deallocate their storage to be available. Reviewed-on: https://gerrit.openafs.org/13131 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit c12cfd7331727142cb928e08ec32a708d0cfd1e9) Change-Id: Iea3b0bd9fdb373020b41c2bcbf1ebbde222114a8 Reviewed-on: https://gerrit.openafs.org/13192 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit 1318bad870781f73acffc6dff1821f54c28d3ed7 Author: Benjamin Kaduk Date: Sun May 27 16:23:16 2018 -0500 libafsauthent: export ugen_ClientInit* Windows was only exporting the bare version and not the Cell/Flags/Server versions; Unix was exporting none of them. These routines for obtaining a ubik client are more generic than the historical (and already exported) ubik_ClientInit routine, allowing for the use of an alternative configuration directory, additional flags, and the like. Reviewed-on: https://gerrit.openafs.org/13130 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit ef6a1e8118a25b885889179739a3539a598068bc) Change-Id: I04c6565cc4b9c3366bf15b86cd5f70402609c5c5 Reviewed-on: https://gerrit.openafs.org/13182 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit 08d91a86ba4735ca55c18b3cffea58939c790fca Author: Benjamin Kaduk Date: Sun May 27 16:03:12 2018 -0500 libafsauthent: Export more token-manipulation functions For both Windows and Unix. Reviewed-on: https://gerrit.openafs.org/13129 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 1974eac772157651594c1b76ea8f55e4567b3ec5) Change-Id: I7b26772fe9f447ac1cf562eb5837a6035d8f0175 Reviewed-on: https://gerrit.openafs.org/13181 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Joe Gorse Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit f5876726928c1302f2dce8c16e81bbed3d9a021d Author: Benjamin Kaduk Date: Sun May 27 15:18:12 2018 -0500 libafsauthent: export ktc token 'Ex' routines for Unix We need these to handle the modern identity structures (they are already exported on Windows). Reviewed-on: https://gerrit.openafs.org/13128 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 4008f83ca80c5ed7b612a13f760b4bb8b9866f2b) Change-Id: I05d4ea37212738db6be9dace0b9cc1db1e76bd08 Reviewed-on: https://gerrit.openafs.org/13180 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Joe Gorse Reviewed-by: Andrew Deason Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit dca6a646a0b3f8fea0a8bbcb45f39561e319f262 Author: Benjamin Kaduk Date: Sun May 27 14:18:07 2018 -0500 libafsauthent: export more afsconf_ functions We have new functions for (among other things) typed keys, and generic rx identity management; expose them as well as the legacy key- and user- management functions, on both Unix and Windows. Reviewed-on: https://gerrit.openafs.org/13127 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit cdd1f16f5ef52093a8f7d3f87a45775d3c87b780) Change-Id: Ia9ab364fcac10822ba50eb7f418a2228ac0fd935 Reviewed-on: https://gerrit.openafs.org/13179 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Joe Gorse Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit 3a833a7fa825731442a358b93dbbdb9f202c64f1 Author: Benjamin Kaduk Date: Sun May 27 13:11:05 2018 -0500 Synchronize libafsauthent afsconf_ exports with windows The Windows library was exporting several more afsconf_* symbols than the Unix one; bring them into sync. Reviewed-on: https://gerrit.openafs.org/13126 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit bcce41bd99b4361631b64cf4749d1dcf80df1cd7) Change-Id: I4993395d30ca93d28e0ccd4c6ad52975a1e23324 Reviewed-on: https://gerrit.openafs.org/13178 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Joe Gorse Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit 5fd4b3c417ebc0d5e1b4daef4fbc0950ad05c10a Author: Michael Meffie Date: Mon Apr 9 19:50:28 2018 -0400 autoconf: remove uss from configure summary Commit 00a33b26d74aa067086ddc340efb82184715857f (uss: always build uss) made the uss build unconditional. Remove it from the list of optional items in the configure summary. Reviewed-on: https://gerrit.openafs.org/13004 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 85e9db22b265f9bb3745246fea3a07158b8a8c0e) Change-Id: I345752f0739edc3d621b39a50157adb23923e256 Reviewed-on: https://gerrit.openafs.org/13111 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Andrew Deason Reviewed-by: Joe Gorse Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk commit 7a191a7864f950a1b50703c3c9bbc2dcecf82669 Author: Pat Riehecky Date: Fri May 25 12:03:35 2018 -0500 Remove pointless assignments scan-build identified these var assignements as being unused or redundant. Reviewed-on: https://gerrit.openafs.org/13086 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit e71985bce593e9dba43443e084eb726fcc5259e3) Change-Id: Ic93c5e775f13a8f75ba619391d71cb78f4dc06ae Reviewed-on: https://gerrit.openafs.org/13150 Tested-by: BuildBot Reviewed-by: PatRiehecky Reviewed-by: Benjamin Kaduk commit 47694e2976034cef094be5f0b5d0fd0c5bc16893 Author: Pat Riehecky Date: Wed May 23 15:50:45 2018 -0500 Add braces to empty conditional blocks GCC 7+ is able to quickly optimize away empty if/else blocks if the braces are provided. While this adds some additional syntax, it should also result in faster optimization, so change our empty blocks after conditionals to use braces. FIXES 134377 Reviewed-on: https://gerrit.openafs.org/13081 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk (cherry picked from commit a411366f57dcf39cc17b6d61d8332e520dff57d1) Change-Id: I9243105d75878487ec965070d3946e8d683f264b Reviewed-on: https://gerrit.openafs.org/13149 Tested-by: BuildBot Reviewed-by: PatRiehecky Reviewed-by: Benjamin Kaduk commit c41860c2c0c4e0cc3c09aada08089b21fe7e98e6 Author: Pat Riehecky Date: Fri May 25 12:48:15 2018 -0500 Convert extended character set to unicode Reviewed-on: https://gerrit.openafs.org/13088 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 9670937d5f12f1edc7bdcb588133f53ec1af2d6f) Change-Id: I8ba39f92dd485cf8b12fc99cf4251277b29e403d Reviewed-on: https://gerrit.openafs.org/13152 Reviewed-by: PatRiehecky Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 37daf101007e92038560913b56ac0330fce3d230 Author: Michael Meffie Date: Mon Apr 25 11:19:10 2016 -0400 Windows: define AFS_IHANDLE_PIO_ENV for ihandle pio Support for positional i/o in the ihandle package was added to the windows platform in commit 50b6a116a1c412d0e6d7442d13d6e92c9dbb35ee using native windows functions. That commit also defined HAVE_PIO in the windows version of the afsconfig.h file. Unfortunately, that definition of HAVE_PIO is not limited to the ihandle package. Remove the project-wide HAVE_PIO definition from the windows afsconfig.h file and define the new AFS_IHANDLE_PIO_ENV symbol when position i/o support is available in the ihandle package. Build the fallback ih_pread and ih_pwrite functions (which use lseek) only when positional i/o is not available in the ihandle package for the current platform. Use AFS_IHANDLE_PIO_ENV instead of HAVE_PIO in ih_open() to determine when it is is safe to share ihandles among threads. Reviewed-on: https://gerrit.openafs.org/12270 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk (cherry picked from commit 759f29cfdfabed4dc5c1b96a0b2b79a3f83c08e3) Change-Id: Ic64f9e65b10fbe6f7650eff852d5a7e20762ef10 Reviewed-on: https://gerrit.openafs.org/13148 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit ba18ab004566b82b52882326727fa33a297bd05c Author: Mark Vitale Date: Tue Apr 24 14:41:11 2018 -0400 ptserver: improve PR_GetHostCPS logging The IP address of the host is logged as a signed number. Instead, log it as the unsigned (and hex) representation of the host IP addr. Reviewed-on: https://gerrit.openafs.org/13043 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 8225518cd08b810bf3d8c74e27e3d3a753b6b30b) Change-Id: Idbb380fa0c9d71398ea2d47ba49fd217be9f9f26 Reviewed-on: https://gerrit.openafs.org/13147 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 1962edf361341df0b842cd749493026a4540cc7a Author: Michael Meffie Date: Fri Apr 27 22:59:57 2018 -0400 vol: check for bad partition names Currently, servers attempt to attach any partition name starting with "/vicep", even partition names which map to out of range partition ids. Examples of such misnamed partitions are "/vicepzz", "/vicep0", and others. The presence of these misnamed partitions cause the server processes to crash on startup, since the out of range partition ids are used as an index. Add a check for the bad partition names in VCheckPartitions to avoid attaching them. Log a warning for such partitions to let the admins know why the partitions are not attached. Reviewed-on: https://gerrit.openafs.org/13038 Reviewed-by: Benjamin Kaduk Reviewed-by: Marcio Brito Barbosa Reviewed-by: Andrew Deason Reviewed-by: Mark Vitale Tested-by: Benjamin Kaduk (cherry picked from commit c0f2c26e9298d12209fbb5e523ea3173202316e5) Change-Id: Id7dcbd80402b7c8ec1f0e2e5fa2ea0123a2da898 Reviewed-on: https://gerrit.openafs.org/13120 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 8ca1b87d0804b23e32304742297701960489f1b4 Author: Jeffrey Altman Date: Fri May 11 15:44:24 2018 -0400 viced: SRXAFS_InlineBulkStatus set InterfaceVersion on error AFSFetchStatus.InterfaceVersion is required to be "1" for any of the fields in the structure to be considered valid. Therefore, InterfaceVersion must be set to one when returning an 'errorCode' value. When RXAFS_InlineBulkStatus was introduced by OpenAFS in 362d26c733b086d26f013bd229af979a112098f5 not only wasn't InterfaceVersion set but neither was the memory allocated to OutStats initialized. As a result the InterfaceVersion field value could be not only zero but random. The OutStats memory was initialized to zeros beginning with 726e1e13ff93e2cc1ac21964dc8d906869e64406. Reviewed-on: https://gerrit.openafs.org/13067 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit f045de21a45fcc8f71e2b30e826c22c8a7b4d0f2) Change-Id: I0d15147081f6e8744680c16e43b22075070647e4 Reviewed-on: https://gerrit.openafs.org/13117 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit eb607b67793c37f57490ece47f93c65383a2fdf5 Author: Marcio Barbosa Date: Tue May 15 17:10:45 2018 -0400 ubik: clones should not request votes Clones should not be able to become the sync-site. To make it possible, regular sites do not vote for a site tagged as clone. In other words, the clones ask for votes but they cannot be the sync-site. Knowing that their requests for votes should be refused by the regular sites, they should never have enough votes to win the election. In addition to the unnecessary network traffic created by these unnecessary requests, this current approach can be problematic in some specific situations. As an example, consider the following scenario: The user wants to turn a regular site, called host1, into a clone. To do so, he runs the following commands on every single server: $ bos removehost -server -host host1 $ bos addhost -server -host host1 -clone After that, he restarts the servers, one by one. Depending on the delay between the restarts, a clone can become the sync-site. This is possible because the clones request votes from the other sites. If enough regular sites are not aware (yet) that the request for vote came from a clone, the clone in question can get enough votes to win the election. To fix the problems mentioned above, do not request votes if you cannot be the sync-site. Reviewed-on: https://gerrit.openafs.org/12654 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 3cc22a442e1dad628f0b11a32c4037fc7174dde4) Change-Id: Ifa748546aec6928eb4ca988a036d0bf8fb70f6f8 Reviewed-on: https://gerrit.openafs.org/13116 Tested-by: BuildBot Reviewed-by: Marcio Brito Barbosa Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit ecc94cdf1b79f49e87b4147cd9301f7dcb2af735 Author: Marcio Barbosa Date: Thu May 10 00:46:01 2018 -0300 afs: alloc openafs_lck_grp before osi_Init() on darwin Commit a27bed59cae1a4244429c752edfde0a8363c8a3b moved init_hckernel_init to osi_Init. On Darwin (AFS_DARWIN80_ENV), MUTEX_INIT (called by init_hckernel_init) uses openafs_lck_grp as the argument of one of the functions called during the initialization of the mutex in question. Since openafs_lck_grp was not allocated yet, we crash. To fix this problem, call MUTEX_SETUP() before osi_Init() on Darwin. Reviewed-on: https://gerrit.openafs.org/13065 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 8e740aed774d4507e656e6ae743f6c6fe6c0e356) Change-Id: Ic1c58b5e2baeedd1cd24c364dd2907761064c8a9 Reviewed-on: https://gerrit.openafs.org/13115 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 881062ab6f67887ce08ab1000a6ac79c41b12c2f Author: Benjamin Kaduk Date: Tue May 8 18:04:21 2018 -0500 Use afs_DestroyReq in afs_PrefetchNoCache() Since commit 76ad941902c650a4a716168d3cbe68f62aef109f we use afs_DestroyReq() instead of osi_Free() directly. Also update the UKERNEL version of the function to afs_CreateReq() properly. FIXES 134533 Reviewed-on: https://gerrit.openafs.org/13060 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 3ec0414f769c37a19410fbd9aefb086cb5b69e55) Change-Id: Ic85fef48f7adb2a152b5cb4d68b8c4a43c45c06a Reviewed-on: https://gerrit.openafs.org/13114 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 579c077aa63430120e6db8599074c815ff36417f Author: Ben Kaduk Date: Fri Dec 13 16:25:47 2013 -0500 Export {Get,Set}ServiceSpecific from liboafs_rx.la rxgk will use service-specific data. Reviewed-on: https://gerrit.openafs.org/10589 Reviewed-by: Daria Phoebe Brashear Reviewed-by: Chas Williams <3chas3@gmail.com> Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Marcio Brito Barbosa Reviewed-by: Benjamin Kaduk (cherry picked from commit 60a006bdc43df42e40eb43f1e1af7fffe3e85763) Change-Id: I997a6dc9ab728e9e87df321c30d0a26ce2853698 Reviewed-on: https://gerrit.openafs.org/13108 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit acee367c684a262744a9d6718eaf10a9324bdc8e Author: Pat Riehecky Date: Fri May 25 12:11:54 2018 -0500 Add missing va_end Per man va_start: Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function. Reviewed-on: https://gerrit.openafs.org/13087 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 2b08d687b992f238fa59773ef2ff1710c520f861) Change-Id: I8d649b06a8e0baedc40612fe7b2251df1426ce26 Reviewed-on: https://gerrit.openafs.org/13151 Tested-by: BuildBot Reviewed-by: PatRiehecky Reviewed-by: Benjamin Kaduk commit 9d633e1281cb3e8bec95d373fd23c04645851625 Author: Benjamin Kaduk Date: Sat May 5 15:59:08 2018 -0500 Export afs_getDirPath from shared libraries Add this function to the export list for libafsauthent on Windows and Unix. Reviewed-on: https://gerrit.openafs.org/13059 Reviewed-by: Anders Kaseorg Tested-by: Anders Kaseorg Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 849ddd4fde0759e385cf3ed4054fc11c36a62fc3) Change-Id: I39dd95185a705eaf96852e7bae9acbb5f5c50159 Reviewed-on: https://gerrit.openafs.org/13146 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 10caff7c0c37ecb9ad9357d1a15afb9bdb052a59 Author: Benjamin Kaduk Date: Sat May 5 15:42:51 2018 -0500 Rename getDirPath to afs_getDirPath in preparation for export The symbol name getDirPath is rather generic and we probably shouldn't squat on it in the application's namespace. In preparation for exporting this functionality from the Unix shared libraries, rename it to afs_getDirPath. Retain a Windows-only wrapper getDirPath that can continue to be exported from libafsauthent on Windows, for ABI compatibility. New consumers should use afs_getDirPath. Reviewed-on: https://gerrit.openafs.org/13058 Tested-by: BuildBot Reviewed-by: Anders Kaseorg Tested-by: Anders Kaseorg Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 554c38473d1465af4c4613209229c274807fffd8) Change-Id: If527d3f6d619e8bc41914353d28d5d74cb683637 Reviewed-on: https://gerrit.openafs.org/13145 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 19eb5b5c7fbde760449e590750582753bfc00ad3 Author: Benjamin Kaduk Date: Sat May 5 15:35:03 2018 -0500 Remove duplicates from liboafs_util.la.sym Remove the extra copy of things which appeared twice. Reviewed-on: https://gerrit.openafs.org/13057 Tested-by: BuildBot Reviewed-by: Anders Kaseorg Tested-by: Anders Kaseorg Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit b48fe6b57f13bacb368e27389ccd3f9c279822da) Change-Id: I322967df048cb49d270cc149d6b710a38797cbbf Reviewed-on: https://gerrit.openafs.org/13144 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 034b141e24c999a3c83720b2e198dd7cf26a6d69 Author: Benjamin Kaduk Date: Sat May 5 14:42:31 2018 -0500 Export ubik_PR_ symbols from libafsauthent Also export from liboafs_prot the ones missing from this set. This brings the unix exports in sync with the Windows exports (of ubik_PR_ symbols), and is tested as being sufficient to compile python-afs. Reviewed-on: https://gerrit.openafs.org/13056 Tested-by: BuildBot Tested-by: Anders Kaseorg Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 3be1de0e823db7068e27b9c5c30a91673f058e52) Change-Id: I2cd44eb5686b1b7134eb0e4480f5f3502e865ce8 Reviewed-on: https://gerrit.openafs.org/13143 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 2cdd866445fb786f5a20f0786849b0a57eccacf3 Author: Benjamin Kaduk Date: Sat May 5 14:00:27 2018 -0500 Export comerr initialization functions from libafsauthent Add to the libafsauthent export symbol list these comerr initialization functions so that they are usable by consumers. Reviewed-on: https://gerrit.openafs.org/13055 Tested-by: BuildBot Reviewed-by: Anders Kaseorg Tested-by: Anders Kaseorg Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 70c4922980d1596155b4021cd72d6895c2371e23) Change-Id: I7fb91b14c0730abd8544ff0484af8746c2bb50db Reviewed-on: https://gerrit.openafs.org/13142 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 0c6d1610ac9309faf85530bde1b6308fbc8822af Author: Benjamin Kaduk Date: Sat May 5 13:11:00 2018 -0500 opr: install afs/opr.h and opr/lock.h These headers are (transitively) referenced from rx_pthread.h, which is pulled in from rx.h when AFS_PTHREAD_ENV is defined. As such, we are presenting an incomplete public API without this header. Reviewed-on: https://gerrit.openafs.org/13054 Tested-by: BuildBot Reviewed-by: Anders Kaseorg Tested-by: Anders Kaseorg Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 792dd44ac57032a3f2a4743c83c8a0208a08ecec) Change-Id: I9785e4d408b2838a2c65ae372717a6c92e38767b Reviewed-on: https://gerrit.openafs.org/13141 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit f52d15371e2dddfb79a8346b3ad69613963e8866 Author: Mark Vitale Date: Fri May 19 16:34:21 2017 -0400 ubik: remove redundant memset from udisk_write When udisk_write is extending the database, DRead will return a null buffer. udisk_write then calls DNew to get a brand new buffer for the extension write, and clears it with memset. However, this is redundant, since DNew has already cleared the new buffer. Remove the redundant memset. No functional change should be incurred by this commit. Reviewed-on: https://gerrit.openafs.org/12621 Reviewed-by: Benjamin Kaduk Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Marcio Brito Barbosa Tested-by: BuildBot (cherry picked from commit 845c8927ef20e245bb88bc783dc2e581b61fbaba) Change-Id: I58d4052c69c16e4758c6accfbb2a0b1ac2aa413f Reviewed-on: https://gerrit.openafs.org/13124 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 99f1df279d26fe82b21406f3bf987595fd049542 Author: Andrew Deason Date: Thu May 10 16:23:48 2018 -0500 ubik: Make udisk_Log* functions static Nothing uses the udisk_Log* functions outside of disk.c. Declare these static to make sure they stay that way, to make it easier to change their semantics. Reviewed-on: https://gerrit.openafs.org/13069 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit f1d389e80367c7ea532441f9aa27a6cc3e2853a7) Change-Id: I9c1cae678fc099f1eabe4aa6a661dcbc4ea72648 Reviewed-on: https://gerrit.openafs.org/13119 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 7200e6c5cbac93399640355fc2af6568ad6aa346 Author: Andrew Deason Date: Thu May 10 16:05:10 2018 -0500 ubik: Remove 'mtime' from ubik_stat Nothing uses the 'mtime' field from ubik_stat. Remove it. Reviewed-on: https://gerrit.openafs.org/13068 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit b8617f08d1bf57a6b3fbba44e5b4de24dc84a9bb) Change-Id: I1770e55aa45192b4bab6d4256be562cb308fd03a Reviewed-on: https://gerrit.openafs.org/13118 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 74de0a543af154624ea7906b83ef10ba7c48590c Author: Mark Vitale Date: Fri May 25 17:05:28 2018 -0400 afs: fix broken volume callbacks (e.g. vos release) Commit e99bfcfaa3bca3e65f03928718c2c9eb5eff7c8c ('afs: use jenkins hash for dcache, vcache tables') introduced new hashing implementations for the dcache and vcache hash tables. Unfortunately, a typo introduced a bug into the VCHashV hash function; instead of hashing by volume id, it currently hashes by vnode. The most common symptom is that volume callbacks (RXAFSCB_Callback with fid :0:0) fail to find and invalidate all the files for the specified volume. This typically manifests as persistent stale RO content after a 'vos release' for new RW content. This bug only affects the Unix cache manager; the Windows cache manager implementation of RXAFSCB_Callback was unaffected. Reviewed-on: https://gerrit.openafs.org/13090 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 1dc9bb4e7362029db073250f23a09f949e1655de) Change-Id: I535f91630948e7aa6a8d72eb37e0cce88c33156d Reviewed-on: https://gerrit.openafs.org/13140 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit c80af69e04bb39b0aa3d1b6705034fd26358f7c7 Author: Benjamin Kaduk Date: Fri Apr 13 08:07:59 2018 -0500 BSD: Work around panic in FlushVCache Commit 64cc7f0ca7a44bb214396c829268a541ab286c69 created the very useful afs_StaleVCache() helper function, but unfortunately it also introduced a subtle change into how we check for whether a vcache may be a directory. Previously, we just used the low bit of the Fid's Vnode number, since files have an even number and non-files an odd number. The new version uses that check but also explicitly checks `vType(avc)` against VDIR, and this new check involves consulting information stored in the associated vnode entry, not the vcache directly. The afs_FlushVCache() implementation for XBSD and DARWIN NULLs removes the cross-linkage between vcache and vnode, so that AFSTOV(avc) becomes NULL. Just a few lines later, it calls afs_StaleVCacheFlags(), at which point vType() dereferences a bad pointer (offset from a NULL pointer) and panics. This would happen during shutdown, or other periodic reclaim/flush events that can be scheduled. Reviewed-on: https://gerrit.openafs.org/13014 Reviewed-by: Mark Vitale Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk (cherry picked from commit 54e84a98f9747bb5bb2ad4b8031115ad7684c914) Change-Id: I810f72e0be8ab98ea6b4ac05c23bc0cb44e4da3a Reviewed-on: https://gerrit.openafs.org/13113 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 489dce6049a90cbef596b29ccff8d15b3bee6fdb Author: Michael Meffie Date: Mon Apr 9 16:42:41 2018 -0400 autoconf: remove more linux 2.4 references Remove old linux 2.2 and 2.4 references in the autoconf macros left over from the linux 2.2 and 2.4 days. Reviewed-on: https://gerrit.openafs.org/13003 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 833a81eeda6e48ea1ced92169434e843d054c44d) Change-Id: I3bf407ec084d911cc826b50fc39f48a20eb0fd77 Reviewed-on: https://gerrit.openafs.org/13110 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 00f4b8b9471adf2c3d7d8f028afb7524d2f02160 Author: Marcio Barbosa Date: Thu Mar 29 15:52:12 2018 -0300 autoconf: remove check for lorder Currently, lorder is not being used. Remove the conditional that checks if this binary exists. Reviewed-on: https://gerrit.openafs.org/12981 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 1a0d68676526a5031d7f06f44d58c6dbb2b65da7) Change-Id: I3630b6ec9629361e86971ff0c37d93327f6763f4 Reviewed-on: https://gerrit.openafs.org/13109 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 7177faad0a7cb98fe59cd6fd41ed1a44c60be046 Author: Mark Vitale Date: Wed May 17 16:32:20 2017 -0400 ubik: death to orphaned signals ubik has a few very old "orphaned" LWP events that are signalled via LWP_NoYieldSignal, but have no matching waits (LWP_WaitProcess). Each "signal" runs the LWP waiting element list for each LWP on the blocked queue; this may add up to substantial wasted overhead on a heavily loaded ubik server. Remove the orphaned signals. No functional difference should be incurred by this commit. Reviewed-on: https://gerrit.openafs.org/12620 Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Marcio Brito Barbosa Reviewed-by: Mark Vitale Tested-by: Andrew Deason Reviewed-by: Benjamin Kaduk (cherry picked from commit e4c7321560acf0bd34eeee7d46269818d82fdb44) Change-Id: I4303542683aaa62895b73a5ea93bc3d0ac82804a Reviewed-on: https://gerrit.openafs.org/13123 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 6c481da10e613e678e9d66582a0445177f923d1e Author: Michael Meffie Date: Sun Jan 21 18:38:11 2018 -0500 Suppress statement not reached warnings under Solaris Studio Solaris Studio issues warnings for statements which can not be reached, such as statements following an infinite loop. For example, the return statement will generate a 'statement not reached' warning in the following code: while (1) { /* no breaks or gotos in this body */ } return 0; Suppress these warnings by conditionally removing such statements when building under Solaris Studio. Reviewed-on: https://gerrit.openafs.org/12958 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit f47cb2d4a957910c3e7d4b755f41ddef5dd103c5) Change-Id: I3ac84edbc18d7b6aebd568e9a1c4a3e47aba5512 Reviewed-on: https://gerrit.openafs.org/13107 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit d3389b02b83baf28e663a6df8522d1e1704bd5dd Author: Michael Meffie Date: Sat Jan 13 20:14:59 2018 -0500 afs: squash empty declaration warning Remove spurious semi-colon which generates a warning when building under Solaris Studio. "./src/afs/UKERNEL/sysincludes.h", line ...: warning: syntax error: empty declaration Reviewed-on: https://gerrit.openafs.org/12957 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 306f0f3100e453e165032ae3bc9022b4a9a9a4c5) Change-Id: Ie6657ab06c8d44b1452d9583908efd1596311971 Reviewed-on: https://gerrit.openafs.org/13106 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit c9061ab02748a8dea3eef413d0d3d5efbd111179 Author: Michael Meffie Date: Sat Jan 20 18:34:18 2018 -0500 libafs: git ignore build artifacts on Solaris Ignore build artifacts generated when building the kernel module for Solaris: src/libafs/inet src/libafs/nfs src/libafs/ufs Reviewed-on: https://gerrit.openafs.org/12955 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit e0066095e7f74653c2c08d1b00010ba59f4c2cf3) Change-Id: I5b25a5a4ef6a3b2134daaf848fef9d64b01ee156 Reviewed-on: https://gerrit.openafs.org/13105 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit a2ae6ace35aca1ce02497962356fab22673bd27b Author: Ben Kaduk Date: Fri Dec 13 16:17:54 2013 -0500 Export a few krb5 routines for rxgk We need oafs_h_krb5_generate_random_block when generating random keys and oafs_h_krb5_crypto_fx_cf2 for CombineTokens. Having oafs_h_krb5_crypto_prf_length proves very convenient for key derivation of transport keys, so move it to the public header and export it. oafs_h_krb5_enctype_keysize is needed so that we can tell whether or not we need to pass through random_to_key() when making rxgk_keys. oafs_h_krb5_random_to_key is needed for that random_to_key() operation. Reviewed-on: https://gerrit.openafs.org/10936 Reviewed-by: Chas Williams <3chas3@gmail.com> Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 348dc87bb2eeb66d1e683dc91ee36724ee18f1af) Change-Id: I3ae0f5ba6b0bd2f851f4d41f756521153e303102 Reviewed-on: https://gerrit.openafs.org/13104 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 0bb3fef5a38bda1cb5a72d94de2a2222c3a56ddf Author: Ben Kaduk Date: Wed Dec 4 13:03:15 2013 -0500 auth: Let superuser identities be superusers We have a special rx_identity_kind for superusers, let it actually be useful for something. Reviewed-on: https://gerrit.openafs.org/10575 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit fe8a1f3a2b669057451cac358faa7320722dc053) Change-Id: I36b6b6be6851c45b13c41e751e4d741cd0130fdb Reviewed-on: https://gerrit.openafs.org/13103 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 690b0f0bd238695a2ccde3842198812fb9b89f5d Author: Andrew Deason Date: Wed Mar 7 13:28:34 2018 -0600 Avoid libtool 'nm' errors Starting around Solaris 11.3, '/usr/bin/nm -p' starts reporting some symbols with the 'C' code. libtool cannot handle this (libtool bug #22373), which causes global_symbol_pipe in the generated libtool script to be empty. This causes a rather confusing error when we go to actually use libtool to link something ("syntax error near unexpected token '|'"; see libtool bug #20947), and prevents the build from continuing. Address this in two ways: For all Solaris 11 builds, default to /usr/sfw/bin/gnm over /usr/bin/nm. This avoids any interop issues with libtool and nm, since libtool of course works very well with GNU tooling. In addition, try to catch any nm-related errors with libtool at configure time, to provide a more helpful error message. To implement these changes, create a wrapper around LT_INIT, called AFS_LT_INIT. Reviewed-on: https://gerrit.openafs.org/12945 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 3e9ea6107973ccc4fa3d405f5b5d76666bfd624f) Change-Id: I4a5a358857ec5bfbc31cd99fcca59f3390ad4d16 Reviewed-on: https://gerrit.openafs.org/13066 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit ad86112bbde0979efd4e99f23ca629f93fa258b1 Author: Ian Wienand Date: Tue Mar 20 14:01:43 2018 +1100 Remove warning "find_preferred_connection: no connection and !create" find_preferred_connection() is called with !create via afs_ConnByHost->afs_ConnBySA to determine if there is a cached connection available. Don't warn, as it will next be called with the create flag to create the connection anyway. Reviewed-on: https://gerrit.openafs.org/12964 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 909d8358109445fdb316b68a8e55e17626cf17c9) Change-Id: If2cb4fd25e98f5bbdde00f76e8b3850c53cb6358 Reviewed-on: https://gerrit.openafs.org/13025 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 002844c5f5f0e4b5ff578182c82e2c5e4d21c1d9 Author: Marcio Barbosa Date: Mon May 14 16:46:26 2018 -0300 rx: fix atomics on darwin As described by commit b2a21422129ca1eeeb5ea1a1f7b08b537fd2a9f7, the API used for atomic operations in kernel space is not the same as the one used in user space. To fix this problem, the commit mentioned above introduced macros to correct the name of these functions in kernel space. Unfortunately, the return value of the functions used in kernel space is not the same as the ones used in user space. Generally speaking, the kernel space atomic functions return the original value of the variable received as an argument before the operation in question. On the other hand, the user space atomic functions return the new value, after the operation has been performed. To fix this problem, this commit provides a new set of inline functions (only used in kernel space) with the expected return values. Also, in order to get the inline implementations of the OSAtomic interfaces in terms of the primitives, commit 74f837fd943ddfa20d349a83d6286a0183cb4663 defines OSATOMIC_USE_INLINED on OS X 10.12. However, the definition of this macro only affects the user space legacy interfaces for atomic operations. The kernel space interfaces for atomics are not deprecated and OSATOMIC_USE_INLINED does not affect these functions. To fix this problem, only define OSATOMIC_USE_INLINED in user space (OS X 10.12+). Reviewed-on: https://gerrit.openafs.org/13063 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit c16423ec4e678e5cb01dc99f4115065f8ef6caf7) Change-Id: Ic3ecc1f26a9e81eb0dc6e1503845be57ad80498a Reviewed-on: https://gerrit.openafs.org/13084 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit c201f8d7a96b1f3ab0cb24dc15edb22f84ef1838 Author: Andrew Deason Date: Tue Mar 6 22:04:28 2018 -0600 SOLARIS: Check for map_addr() without 'vacalign' Add a configure check to see if the map_addr() function contains the 'vacalign' argument or not. The argument was removed sometime around Solaris 11.4. Reviewed-on: https://gerrit.openafs.org/12947 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 00e12efa29659c28f0fd7b6acbfb57d91a6ca477) Change-Id: I141ad3c54b2aa3e32311785f4320eba04d840bb2 Reviewed-on: https://gerrit.openafs.org/13102 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 04ed8a2f4fb33c22b1e6c0a56f137666e412a64d Author: Andrew Deason Date: Wed Mar 7 15:57:56 2018 -0600 hcrypto: Avoid arc4random in kernel Our HAVE_ARC4RANDOM symbol represents the availability of arc4random() in userspace, not in the kernel. On Solaris, we'll define HAVE_ARC4RANDOM, but the built kernel module will be unusable, since we cannot resolve the arc4random symbol. To to avoid this, undef HAVE_ARC4RANDOM when building hcrypto for the kernel, just like we do with HAVE_GETUID. Reviewed-on: https://gerrit.openafs.org/12946 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 6082243e42525c738239fe429bcb64e0e4f22207) Change-Id: I41c4c6f65581aee3d53a7c4b8f6c108f88631e3f Reviewed-on: https://gerrit.openafs.org/13101 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit e6198969d4b556c3e39085c01dc2e761731fbdb7 Author: Michael Meffie Date: Thu Feb 22 13:23:18 2018 -0500 venus: convert fs.c to safer string functions Convert string handling to safer functions to avoid buffer overflows. Reviewed-on: https://gerrit.openafs.org/12923 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 5a8b68153124c3a9224f0b6993df9de9c6c54541) Change-Id: Ic7fd4c3c0ffd4b0b38b9735002e9bf8eba8fd0d6 Reviewed-on: https://gerrit.openafs.org/13100 Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit e1b71e88452b2a5ff7473514661cb85dfac1b3c1 Author: Michael Meffie Date: Mon Feb 19 14:01:56 2018 -0500 venus: fix format overflow warning Recent versions of gcc generate a format overflow warning on the dfstring buffer in fs.c. Increase the size of the buffer to avoid a possible buffer overflow. fs.c: In function ‘AclToString’: fs.c:770:30: error: ‘%s’ directive writing up to 1024 bytes into a region of size between 13 and 23 [-Werror=format-overflow=] sprintf(dfsstring, " dfs:%d %s", acl->dfs, acl->cell); ^~ fs.c:770:2: note: ‘sprintf’ output between 8 and 1042 bytes into a destination of size 30 sprintf(dfsstring, " dfs:%d %s", acl->dfs, acl->cell); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Reviewed-on: https://gerrit.openafs.org/12917 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit c84f36a9b8c6b6adb9c77bab1c814ccd3aaf6a5b) Change-Id: I05bef3e09455377364a014b41de1e047f5322c8b Reviewed-on: https://gerrit.openafs.org/13099 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 1bbe9a3fd555d6b968e0e9794edf34aa2e3ac1a6 Author: Michael Meffie Date: Thu Feb 22 16:07:55 2018 -0500 butc: convert butc/dump.c to safer string handling Convert butc/dump.c to safer string handling functions to avoid buffer overflows. Reviewed-on: https://gerrit.openafs.org/12922 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 70b7f743550a8ce02292a12c4188deaf85b1a533) Change-Id: I7a062663b5ac2ab0000fe176c7bfdf3896cfb782 Reviewed-on: https://gerrit.openafs.org/13098 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit dba69c2a190103d1941ca6232d9a466f259a206c Author: Michael Meffie Date: Mon Feb 19 13:57:16 2018 -0500 butc: fix format overflow warning Recent versions of gcc generate an overflow warning in the butc DUMPNAME macro when copying values into the finishedMsg1 buffer. Increase the size of the destination buffer to avoid a possible buffer overflow. dump.c:88:24: error: ‘%s’ directive writing up to 63 bytes into a region of size 50 [-Werror=format-overflow=] sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId); ^ dump.c:1294:5: note: in expansion of macro ‘DUMPNAME’ DUMPNAME(finishedMsg1, nodePtr->dumpSetName, dparams.databaseDumpId); ^~~~~~~~ dump.c:88:6: note: ‘sprintf’ output between 12 and 84 bytes into a destination of size 50 sprintf(dumpname, "%s (DumpId %u)", name, dbDumpId); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dump.c:1294:5: note: in expansion of macro ‘DUMPNAME’ DUMPNAME(finishedMsg1, nodePtr->dumpSetName, dparams.databaseDumpId); ^~~~~~~~ Reviewed-on: https://gerrit.openafs.org/12916 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit cec45d59440f55316097cfd6652d2ea26cd55233) Change-Id: I9f3b284d4a32b868091986964af128ed9b3557fd Reviewed-on: https://gerrit.openafs.org/13097 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit f947e1dcb35988f1e39ec51c7f5cf0f2c4fc321c Author: Andrew Deason Date: Thu Feb 15 18:40:07 2018 -0600 RHEL: Add aarch64/arm64 to spec file Reviewed-on: https://gerrit.openafs.org/12911 Tested-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 3ddae7d168ac08c46b4e31517fdb1f6ac1ae63ac) Change-Id: Iabbdac7b2ca9e5d066db08dd871203ae341538af Reviewed-on: https://gerrit.openafs.org/13096 Tested-by: BuildBot Reviewed-by: PatRiehecky Reviewed-by: Benjamin Kaduk commit 10be5372aa520f84bf63cce258e9ecddbb6b43c0 Author: Andrew Deason Date: Sat Mar 7 17:27:47 2015 -0600 Add support for arm64_linux26 Add support for the arm64/aarch64 architecture on Linux 2.6+. The param header file is mostly combined from arm and amd64. Note that the code for syscall interception has not been updated for arm64, so this will not build on arm64 without support for kernel keyrings. This also does not define any AFS syscall number, since no number in the Linux arm64 syscall table is "free" for us to use, as far as I am aware. Adapted from initial patches from Micheal Waltz . Reviewed-on: https://gerrit.openafs.org/11940 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 4f7550dcaf9375046514cdd97cea0f667e955e9f) Change-Id: I12988da1fbbc7e3733fddf4ca11ad65b96a9c02f Reviewed-on: https://gerrit.openafs.org/13095 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit 891cb67329d595d805289f533e6ee329c0a3851b Author: Andrew Deason Date: Sun Mar 8 11:47:28 2015 -0500 hcrypto: Avoid 'double' param in arm64 kernel code Currently, the RAND_add function in hcrypto uses a floating point argument (specifically, a 'double'), as well as any implementations of RAND_add. On Linux arm64, we cannot use floating point code in the kernel, since the kernel module is compiled with -mgeneral-regs-only, which prevents the use of floating point registers. No code in the tree actually makes use of this argument, but its mere presence is enough to cause an error with at least some versions of gcc with certain arguments. To get around this, simply change all instances of 'double' in hcrypto to be a void pointer instead. This allows the code to compile as long as nobody actually uses that argument in the kernel. If the code is changed such that we do actually use that argument, the argument will be a void* and so will probably (hopefully) cause a compiler error, and the code will need to be examined to make sure this workaround doesn't break anything. We already do this on Solaris, which has similar issues for different compiler versions and compiler flags. Add arm64 Linux to the cases where we do this, but restrict this to kernel code only, to try to avoid doing this more often than necessary. Reviewed-on: https://gerrit.openafs.org/11939 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit b792dea0f1f83673b0b045adf608412901b3024c) Change-Id: I95a016ba4a3dc368680b512110eb0058fcfdb468 Reviewed-on: https://gerrit.openafs.org/13094 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit 518220c7f9b22bac6b9a237708737a18ee7f285e Author: Andrew Deason Date: Fri Mar 13 10:33:05 2015 -0500 Do not set default AFS_SYSCALL Currently, afs_args.h will define an AFS_SYSCALL value by default (31) if the current platform does not define an AFS_SYSCALL value on its own (via its param.h info). This is dangerous, since if a platform does not define an AFS_SYSCALL, or if it happens to not be defined for any reason, some code may try to call syscall 31, which could be anything. So get rid of this. If this breaks the build on any platform, then that platform should define AFS_SYSCALL in its own platform-specific header, or get rid of the problematic AFS_SYSCALL usage. Reviewed-on: https://gerrit.openafs.org/11938 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 0a896b93c86e86f5b438880ef1634b4e39ee5779) Change-Id: Ifcc17d5e26fde01302c43331ffdf005b6b9c3bd3 Reviewed-on: https://gerrit.openafs.org/13093 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit 73c15c4521f508e4b7d2c573a056b2105e51bb34 Author: Andrew Deason Date: Wed Mar 11 12:55:42 2015 -0500 Do not require AFS_SYSCALL Various parts of the code make use of AFS_SYSCALL in order to communicate with the libafs kernel module. Even though most modern platforms do not use an actual syscall anymore (instead using an ioctl-based method or similar to emulate the traditional AFS syscall), some code paths rely on AFS_SYSCALL as a fallback, or just use AFS_SYSCALL because they were never updated to use the newer methods. Even platforms that do not use the traditional AFS syscall still define the AFS_SYSCALL number, in case someone still uses it for something. However, some platforms do not have an AFS syscall number; there is no "slot" allocated to us, so we cannot safely issue any syscall. For those platforms, we must not reference AFS_SYSCALL at all, or we will fail to build. So, get rid of these references to AFS_SYSCALL if it is not defined. In some places, we can just avoid the relevant code making the syscall. In a few other places, we just pretend like the libafs kernel module was not loaded and yield an ENOSYS error, to make the code simpler. Reviewed-on: https://gerrit.openafs.org/11937 Tested-by: BuildBot Reviewed-by: Ian Wienand Reviewed-by: Benjamin Kaduk (cherry picked from commit ed513bb516acdb28fc6bbf01714ef2e1df422a8a) Change-Id: I5e7e2381935eaa595f9fa796f963260b870dc72c Reviewed-on: https://gerrit.openafs.org/13092 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit 902e70a30a87aaabe468f48a792729effdc94f1b Author: Andrew Deason Date: Mon Feb 5 00:07:10 2018 -0600 util: Add the AFS_STRINGIZE() macro Add a macro to help with easily printing the value of #define'd constants, called AFS_STRINGIZE(). For example: printf("The value of AFS_SYSCALL is: " AFS_STRINGIZE(AFS_SYSCALL) "\n"); Reviewed-on: https://gerrit.openafs.org/12893 Tested-by: BuildBot Reviewed-by: Ian Wienand Reviewed-by: Benjamin Kaduk (cherry picked from commit f5794e029903db79f345f42582230a1fd0f7d823) Change-Id: I33d14a62a04c0f79521ec253d51587952bf909a3 Reviewed-on: https://gerrit.openafs.org/13091 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk commit 9a03d84434af4dc69afa3e165fe856e45bab8623 Author: Andrew Deason Date: Tue May 8 19:09:42 2018 -0500 LINUX: Remove unused osi_fetchstore.c Ever since commit ae5f411c (Linux 4.4: Do not use splice()), most of osi_fetchstore.c has been '#if 0'd out. The only portion that isn't is a function definition that is unreferenced (afs_linux_read_actor). Remove the unused code, and other '#if 0' references to it; the code can always be added back later when we can actually use it. Reviewed-on: https://gerrit.openafs.org/13061 Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: BuildBot (cherry picked from commit 96a4bee20d42484148d163b85ca049dcc980a7a5) Change-Id: I224a630f6f3f1d9e0d08a6cd7eae3d3b871b2bd6 Reviewed-on: https://gerrit.openafs.org/13074 Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit 92de7260ee45200b6832cb7f727a582fc37c3699 Author: Andrew Deason Date: Mon Apr 30 17:58:43 2018 -0500 afs: WriteThroughDSlots: Avoid write error panic Currently, afs_WriteThroughDSlots panics if our call to afs_WriteDCache fails. Since afs_WriteThroughDSlots is called every minute by a background daemon, this means that if our cache fs becomes inaccessible (by being forced read-only, or for any other reason), we are virtually guaranteed to panic relatively quickly. To try to avoid this at least for some cases, change afs_WriteThroughDSlots to return an error to our caller when we encounter such an error. For our background task, we can just ignore the error and retry the writes on a future iteration. During shutdown, we still panic if we encounter an error, to try to avoid silently allowing a corrupt cache to be used on subsequent boots. Reviewed-on: https://gerrit.openafs.org/13047 Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Tested-by: BuildBot (cherry picked from commit 46d5695a383b2b993fdd598b770f4e3c0e1a41f3) Change-Id: Iccbec550c00ac725c0033b075ac3cd0b4e1c78c2 Reviewed-on: https://gerrit.openafs.org/13073 Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit e05a095455294feff4e1b28a432896222a3ffd94 Author: Andrew Deason Date: Mon Apr 30 17:33:14 2018 -0500 afs: Avoid afs_GetDCache panic on cache open error When we need to populate a dcache entry, afs_GetDCache calls afs_CFileOpen to get a handle for our file backing that dcache. Currently, if we cannot open the file, we panic. To handle this a little more gracefully, just return an error from afs_GetDCache instead. The relevant userspace request will probably fail with EIO, but this is better than possibly crashing the whole system. Reviewed-on: https://gerrit.openafs.org/13046 Reviewed-by: Benjamin Kaduk Tested-by: Benjamin Kaduk (cherry picked from commit 22e64df8e043fa7bd78bff263866ee2bd6a6e13d) Change-Id: Iddc7b0ebc56a64d792251f1f42c576603f2a86cf Reviewed-on: https://gerrit.openafs.org/13072 Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit a5eeee6d2ef87d95722950989a2d261efc72b959 Author: Andrew Deason Date: Mon Apr 30 17:30:56 2018 -0500 LINUX: Return NULL for afs_linux_raw_open error Currently, afs_linux_raw_open (and by extension, LINUX's implementation of osi_UFSOpen) panic when they are unable to open the given cache file. To allow callers to handle the error more gracefully, change afs_linux_raw_open and osi_UFSOpen to return NULL on error, instead of panic'ing. Expand the language a little on the message logged while we're here, since the system might keep running after this situation now. This commit also changes all callers that did not already handle afs_linux_raw_open/osi_UFSOpen errors to assert on errors, so we still panic for all situations where we encounter an error. More graceful behavior will be added in future commits; this commit does not change the behavior on its own. An error on opening cache files can legitimately happen when there is corruption in the filesystem backing the disk cache, but possibly the easiest way to generate an error is if the filesystem has been forcibly mounted readonly (which can happen at runtime due to filesystem corruption or various hardware faults). The latter will generate -EROFS (-30) errors, but of course other errors are probably possible. Reviewed-on: https://gerrit.openafs.org/13045 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit f6af4a155d3636e8f812e40c7169dd8902ae64be) Change-Id: I5f9a71a96cd9c875f4b024562dfa714f9cc27e2f Reviewed-on: https://gerrit.openafs.org/13071 Reviewed-by: Mark Vitale Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit 5b9da66861db10dcc1d896769b495738cc07b450 Author: Jeffrey Altman Date: Fri Feb 23 18:47:46 2018 -0500 rx: connection aborts send serial zero when no conn available When no connection object is available, send serial number zero (0) instead of one (1). There is no harm in sending one (1) but it might be confused as the first packet sent on the connection. Multiple connection aborts sent would all be sent with serial one (1). Serial number zero (0) can be an indication to humans reading packet traces that the sender has no knowledge of the connection. Reviewed-on: https://gerrit.openafs.org/12932 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 09f31d4c21328bcdc1dccdedf7df53d77c22e3e3) Change-Id: Ie5b8052903307be4bc932e57e45efae7dd75dec8 Reviewed-on: https://gerrit.openafs.org/13051 Reviewed-by: Michael Meffie Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit 36575f909b5e655d78ee0eda691550cb153860c9 Author: Jeffrey Altman Date: Fri Feb 23 18:26:24 2018 -0500 rx: pass serial number to rxi_SendRawAbort The practice of stamping abort packets with the connection's next serial number was altered by a0ae8f514519b73ba7f7653bb78b9fc5b6e228f8. This change restores the prior behavior by passing a serial number as a parameter to rxi_SendRawAbort() so that the serial number can be obtained from the connection instead of hard coded as 1. Reviewed-on: https://gerrit.openafs.org/12931 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit cacf2b646759132dbf21e9c04fb3cfc6c2f8f1f3) Change-Id: I36925d4283ba0aaedc7bee0e878d0e18d9aa23a7 Reviewed-on: https://gerrit.openafs.org/13050 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk commit 8fa929c4cb72f07816b7ab09fcf3c8af6bc4d65d Author: Stephan Wiesand Date: Thu Apr 26 19:33:31 2018 +0200 redhat: Make separate debuginfo for kmods work with recent rpm Commit 443dd5367e0cd9050ad39a6594c5be521271b4e9 introduced the creation of separate debuginfo packages for kmod packages, and commmit 387ae9536888419d7b101513e04e1c644e3218d6 moved the code from the spec into the kmodtool script. Recent versions of rpm (the issue was found on Fedora 27) extract the debuginfo data from a copy of the original files having the package version-release as a suffix. This broke the original change since the regular expression passed to find-debuginfo.sh no longer matched the name of the openafs.ko file. The file list for the -debuginfo package remained empty, which caused rpmbuild to fail. Relax the regex to match the previous and current file names we are after. It is possible but unlikely that .*openafs\.ko.* will ever match any file not being a kernel module. Reviewed-on: https://gerrit.openafs.org/13030 Tested-by: BuildBot Reviewed-by: Michael Meffie Tested-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 076b73e06df8240f209470ea6ee19b66eb4166c3) Change-Id: Ib8a683d586ad3bd5237f27546a95ce92dd9de04f Reviewed-on: https://gerrit.openafs.org/13036 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit a83c74471644cc1f0d39de86cd5a1c54a4d594e7 Author: Stephan Wiesand Date: Thu Apr 26 19:50:06 2018 +0200 redhat: PACKAGE_VERSION macro no longer exists Commit 0d0e7699c9f789214205fe6837cded1a4c95f9c0 replaced all uses of the %PACKAGE_VERSION macro in the spec with the %version one, but missed an instance in the kmodtool script. Fix this, to avoid a warning during rpmbuild. Reviewed-on: https://gerrit.openafs.org/13031 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit cfa74883e4996dfee2bd6ffaa3b967e5a7941e0b) Change-Id: I2d57ddc3700f509da3255df1f952f55d8cd7f0e8 Reviewed-on: https://gerrit.openafs.org/13037 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit b65f3bf787ed2b61aa06c9282f154653c41355dd Author: Michael Meffie Date: Thu Apr 5 23:43:34 2018 -0400 redhat: remove the openafs-kernel-version.sh script Commit ec706b21530240d7fb66bad2f08513eff8f7c335 (Remove Linux 2.4 compat from RedHat packaging) removed the use of the script openafs-kernel-version.sh, which was used in the linux 2.4 days to look up the current kernel version. Nowadays, we use the openafs-kmodtool script to determine the kernel version. Remove the unused openafs-kernel-version.sh script from the package sources. Reviewed-on: https://gerrit.openafs.org/12996 Tested-by: BuildBot Reviewed-by: Stephan Wiesand Reviewed-by: Benjamin Kaduk (cherry picked from commit 28ea20d03f8abd8109547d6825edad159748397a) Change-Id: I8d85ad57e1202f190c1a88812b4532b9642597f5 Reviewed-on: https://gerrit.openafs.org/12999 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit 17f76dfa6abc17a36d78b9e1dc0354cbccc98489 Author: Michael Meffie Date: Thu Apr 5 22:56:50 2018 -0400 redhat: remove extra kernel version check Commit a1c072ac562ccf74e5afb8449db1bcef86aef362 (redhat: fix rpmbuild command line option defaults) added logic to set the default value of the kernvers variable when not specified as an rpmbuild command line option. This default value is not necessary, since 'kmodtool verrel' already returns the current running kernel version by default. The result of 'kmodtool verrel' sets the kverrel variable, which holds the value of the kernel version we are building. The kernvers variable is only used as an argument to 'kmodtool verrel' and may be empty by default to indicate the current version should be returned. Remove the unnecessary setting of the default value of kernvers. Also update the information banner to show the value of kverrel, which is the actual version we are building, instead of kernvers, which is empty be default. Reviewed-on: https://gerrit.openafs.org/12995 Tested-by: BuildBot Reviewed-by: Stephan Wiesand Reviewed-by: Benjamin Kaduk (cherry picked from commit 9f0164f4254da39c3c31e0268da58ce7a6ccda1d) Change-Id: I355e3772c6bda18a385b48be80fb7f952c2fca3b Reviewed-on: https://gerrit.openafs.org/12998 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot commit b30f21b8ec494d921c6ac513bf1022d5937ba220 Author: Stephan Wiesand Date: Wed Apr 4 17:09:39 2018 +0200 FBSD: param.h consistency Commit 88dc4d93f5ef080da8f56fac453f095e6c79d4a0 ("Add param.h files for recent FreeBSD") introduced an inconsistency between the i386 and amd64 param.h files for 11.1 and 12.0 regarding the *_FBSD101_ENV #defines. Citing Benjamin Kaduk: "Traditionally we have the param.h for a FreeBSD N.0 release include the (N-1).Y values that existed at the time of the N.0 release, and freeze that set of (N-1).Y values for the lifetime of FreeBSD N.x, if that makes sense." Given that FreeBSD 11.0 was released shortly after 10.3, and 12.0 is not yet released, consistently #define *_FBSD10{1..3}_ENV for 11.1 and *_FBSD10{1..4}_ENV for 12.0 Reviewed-on: https://gerrit.openafs.org/12990 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 154512831966d12c1e32e6271d4ab1440a25b96e) Change-Id: I5a746beec62f3843526af3f65e0ba03380a5aa41 Reviewed-on: https://gerrit.openafs.org/12997 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit a819cf483e03d32b2213175e19e628d7c3d8194d Author: Stephan Wiesand Date: Mon Mar 26 20:21:19 2018 +0200 redhat: Create unique debuginfo packages for kmods Commit 443dd5367e0cd9050ad39a6594c5be521271b4e9 ("redhat: separate debuginfo package for kmod rpm") introduced the creation of separate debuginfo packages for the kmod packages. As such, this is useful, but all debuginfo packages for a given OpenAFS release ended up with the same name/version/release for the kmod debuginfo package, no matter which kernel release or variant the kmod was built for. Move the additional black magic from the spec into the kmodtool script where we have the means to do better: Use the same naming and versioning conventions as for the kmod-openafs packages themselves. Reviewed-on: https://gerrit.openafs.org/12977 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Michael Meffie Tested-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit 387ae9536888419d7b101513e04e1c644e3218d6) Change-Id: I220408eacd0c39449843240f225cfced163cbff7 Reviewed-on: https://gerrit.openafs.org/12986 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Stephan Wiesand Reviewed-by: Benjamin Kaduk commit 72b2da46bb0f997d70cca3cca7abc4a135d3d500 Author: Andrew Deason Date: Wed Mar 7 11:32:43 2018 -0600 ubik: Log sync site for SDISK_SendFile USYNC error In SDISK_SendFile, we return a USYNC error if the caller is not the sync site. Say who the sync site is when we do this, to possibly help post-mortem debugging. Reviewed-on: https://gerrit.openafs.org/12943 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk (cherry picked from commit c44f6f7a8052bdd1fb021e07bb6ae142b61e6b5b) Change-Id: I398780c98ee5eade75e06a42d54637c169bc250a Reviewed-on: https://gerrit.openafs.org/12948 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit e46c5c455c4eceb5dac5e86611d039c6c7089d6e Author: Andrew Deason Date: Wed Mar 7 13:11:03 2018 -0600 Avoid empty libtool -export-symbols-regex pattern Currently, in LT_LDLIB_shlib_missing, we construct our -export-symbols-regex pattern like so (with some escaping): "($(sed -e 's/^/^/' -e 's/$/$/' xxx.sym | tr '\n' '|' | sed -e 's/|$//'))" The idea is that for a .sym file consisting of, for example: foo bar We then generate a regex like (^foo$|^bar$). However, since the 'tr' removes all newlines, the line given to the last 'sed' in the pipeline has no trailing newline. On some systems, such as Solaris, this causes sed to not output anything at all, resulting in a regex pattern of just "()". For example: # on Debian $ echo -n foo | sed -e 's/foo/bar/' bar$ # on Solaris $ echo -n foo | sed -e 's/foo/bar/' $ To avoid this, we can change the sed pipeline to not remove the newlines until the very end. Change the way we construct our regex to this instead: "($(sed -e 's/^/^/' -e 's/$/$|/' -e '$ s/|$//' xxx.sym | tr -d '\n'))" So the sed removes the extra '|' in the last element by looking at the last line, instead of looking at the end of the line after the 'tr' conversion. Reviewed-on: https://gerrit.openafs.org/12944 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit d0805d72b7a48dcaa7abe1aea136a8cd963d76c2) Change-Id: Iebf0996e63c6233bebbf855cde21094a73fbd420 Reviewed-on: https://gerrit.openafs.org/12949 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Benjamin Kaduk commit b41065f2b8877580a7e1858b8e2857973ddf6503 Author: Marcio Barbosa Date: Thu Feb 22 17:53:23 2018 -0500 ubik: don't set database epoch to 0 if not needed If our attempt to receive a fresh database from a peer fails, we will overwrite the version.epoch field of our current local copy of the database with an invalid value, "0". The idea behind this approach is to make sure that this database will not be seen as a legit copy if the transfer is not completed properly. Although it is questionable if this approach is still necessary (since the current version writes the data into a temporary file), it is undisputed that the database version does not have to be invalidated if the transfer fails in a early stage where no data has been written and we could safely continue to reuse the local copy for read-only queries. Early failures may happen if: 1. The peer sending the database to us is not the peer we believe to be the sync site; 2. The sender is not authorized to call DISK_SendFile; In both cases, the database epoch is invalidated. As a result of that, we may have the following consequences: 1. Reads may not be allowed Once the on disk epoch is invalidated, if the server in question is rebooted, the invalid on disk epoch will be used to initialize the in memory epoch. At this point, reads may not be allowed since urecovery_AllBetter checks if the in memory epoch is greater than 1. Reads should not be blocked forever since the sync-site will send a new database to this remote and, as a result of that, the invalid version will be corrected. 2. Data can be lost If the site with the invalid epoch is the one with the most recent database, the database can be rolled back to an earlier version during a new quorum establishment. Consider the following scenario where we have three sites: Site A (up - database up to date) (sync-site) Site B (up - database up to date) Site C (down - old database) The epoch of B is invalidated due to the problem fixed by this patch. Then, A is turned off and C is turned on. In this scenario, the new sync-site will distribute the old database held by C since its epoch is greater than 0. To fix the problem in question, do not set the database epoch to 0 if the local database was not modified. Acknowledgements: Hartmut Reuter - found the problem; - suggested a possible solution; Benjamin Kaduk - submitted the first version; Andrew Deason - suggested changes; Reviewed-on: https://gerrit.openafs.org/12924 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot Reviewed-by: Michael Meffie (cherry picked from commit bd6a2484011dad6298c4ce97dd0cd68e0834baa5) Change-Id: I64808d4adf6a5925083a671308a60f93ca427180 Reviewed-on: https://gerrit.openafs.org/12937 Reviewed-by: Hartmut Reuter Reviewed-by: Marcio Brito Barbosa Tested-by: BuildBot Reviewed-by: Benjamin Kaduk commit 0b1d10fd2535b0059d1e88c23fbd3f60041edc9f Author: Michael Meffie Date: Tue Feb 20 11:51:01 2018 -0500 afs: improve -volume-ttl error messages Change the afs call which sets the volume ttl value to return EFAULT instead of EINVAL when given an out of range value for the volume ttl parameter. This is more consistent with the other op codes, which return EFAULT when given an out of range parameter and allows the caller to distinguish between an invalid opcode and a bad parameter. Move the volume ttl range constants to afs_args.h, which is where constants related to the op codes are supposed to be defined. This makes the constants available to the caller in afsd.c as well as the implementation in afs_call.c. Update afsd to print a more sensible error message when the volume ttl set calls fails due to an out of range parameter. Reviewed-on: https://gerrit.openafs.org/12918 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk (cherry picked from commit 6d74e3d6a1becf86cec30efc2d01a5692167afe1) Change-Id: I2cd86b6fbba31f74862bb902ac94b0874de8afac Reviewed-on: https://gerrit.openafs.org/12936 Tested-by: BuildBot Reviewed-by: Mark Vitale Reviewed-by: Benjamin Kaduk commit 1d288d8776f1e91e55ee150a864126bcd60c1998 Author: Benjamin Kaduk Date: Fri Mar 9 18:34:54 2018 -0600 Make OpenAFS 1.8.0 Update version strings for 1.8.0. Change-Id: I80be6d31a6578c6cc8de636e6064d320b25a4246 Reviewed-on: https://gerrit.openafs.org/12954 Tested-by: BuildBot Reviewed-by: Michael Meffie Reviewed-by: Benjamin Kaduk