mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
Ben Huntsman
332b5593d4
AIX: Free pinned_heap during shutdown to prevent kernel panic
During shutdown, the function shutdown_osisleep is called in src/afs/afs_osi.c. The body of this function is platform- specific, and on AIX there is a call to xmfree: xmfree(tmp); However, on AIX, xmfree actually takes two arguments: int xmfree ( ptr, heap) caddr_t ptr; caddr_t heap; This is called elsewhere in the OpenAFS code correctly for kernel_heap. In src/afs/AIX/osi_sleep.c we start using the pinned_heap, but never xmfree it. Therefore, we need to do so here during the shutdown. Here we include a header file which defines pinned_heap, and then supply it as an argument to xmfree. This prevents a kernel panic during OS shutdown. The panic might go unnoticed in many environments, as during a reboot, the system will normally dump and restart anyway. However, if kdb is loaded (bosboot -a -D), the system will break into the debugger before the full shutdown procedure completes. The stack trace shows the following: KDB(0)> stack pvthread+01D200 STACK: [00023900]abend_trap+000000 () [000EFF24]xmfree_frontend+0000A4 (??, ??, ??) [F1000000C064CF1C]shutdown_osisleep@AF72_5+0000BC (??) [F1000000C064CB7C]shutdown_osi+00001C () [F1000000C064A51C]afs_shutdown+0003BC (0000000100000001) [F1000000C05A8DD4]afs_unmount+000094 (F1000A01501D4C10, 0000000000000000) [F1000000C059FCE0]vfs_unmount+0000A0 (F1000A01501D4C10, 0000000000000000, F1000A015047B07C) [00014D70].hkey_legacy_gate+00004C () [006A6AAC]vfs_unmount+00008C (??, ??, ??) [006B4228]kunmount+000228 (??, ??, ??, ??) [006B4944]uvmount+000204 (??, ??) [00003954]syscall+00024C () [100084FC]helper_UMfunc+00027C (??, ??) [10003D48]dounmount+0000C8 (??, ??, ??, ??) [100044DC]umountmain+0001BC (??, ??) [10000AD4]main+0000B4 (??, ??) [10000168]__start+000068 () Reviewed-on: https://gerrit.openafs.org/15419 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Cheyenne Wills <cwills@sinenomine.net> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> (cherry picked from commit 4810cca10bc32df7ba7809fc2bf095d20e2febd8) Change-Id: I687caa6daae83fc7986e76d370b55f90f5ca53cc Reviewed-on: https://gerrit.openafs.org/15425 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Ben Huntsman <ben@huntsmans.net> Tested-by: Ben Huntsman <ben@huntsmans.net> Reviewed-by: Mark Vitale <mvitale@sinenomine.net> Reviewed-by: Michael Meffie <mmeffie@sinenomine.net> Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
AFS is a distributed file system that enables users to share and access all of the files stored in a network of computers as easily as they access the files stored on their local machines. The file system is called distributed for this exact reason: files can reside on many different machines, but are available to users on every machine. OpenAFS 1.0 was originally released by IBM under the terms of the IBM Public License 1.0 (IPL10). For details on IPL10 see the LICENSE file in this directory. The current OpenAFS distribution is licensed under a combination of the IPL10 and many other licenses as granted by the relevant copyright holders. The LICENSE file in this directory contains more details, thought it is not a comprehensive statement. See INSTALL for information about building and installing OpenAFS on various platforms. See CODING for developer information and guidelines. See NEWS for recent changes to OpenAFS.
Description
Languages
C
72.2%
C++
20.1%
Makefile
1.4%
Perl
1.2%
Rich Text Format
1%
Other
3.7%