OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_1-262-g4810cca

Gerrit Code Review
Fri, 12 May 2023 11:20:35 -0400

The following commit has been merged in the master branch:
commit 4810cca10bc32df7ba7809fc2bf095d20e2febd8
Author: Ben Huntsman <>
Date:   Thu May 4 16:52:38 2023 -0700

    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:
    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,
    [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 ()
    Change-Id: I3131dc7d184a299e7d7806ce8a0c3d890b5c3624
    Tested-by: BuildBot <>
    Reviewed-by: Cheyenne Wills <>
    Reviewed-by: Benjamin Kaduk <>

 src/afs/afs_osi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

OpenAFS Master Repository