OpenAFS Master Repository branch, openafs-stable-1_8_x, updated. openafs-stable-1_8_10-30-g08a9085

Gerrit Code Review
Thu, 5 Oct 2023 08:41:56 -0400

The following commit has been merged in the openafs-stable-1_8_x branch:
commit 08a90850fd792718ec5abdda172ab0214abfced6
Author: Andrew Deason <>
Date:   Tue Feb 7 22:48:23 2023 -0600

    vol: Re-evaluate conditons for cond vars
    Most users of cond vars follow this general pattern when waiting for a
        while (!condition) {
    	CV_WAIT(cv, mutex);
    But a few places in src/vol do this:
        if (!condition) {
    	CV_WAIT(cv, mutex);
    It is important to always re-check for the relevant condition after
    waiting for a CV, even if it seems like we only need to wait exactly
    once, because pthread_cond_wait() is allowed to wake up its caller
    spuriously even the CV hasn't been signalled. On Solaris, this can
    actually happen if the calling thread is interrupted by a signal.
    In VInitPreAttachVolumes() for DAFS, currently this can cause a
    segfault if CV_WAIT returns while 'vq' is empty. We will try to
    queue_Remove() the head of the queue itself, resulting in
    being set to NULL, which will segfault when we try to pull the next
    item off of the queue.
    We generally cannot be interrupted by a signal when using opr's
    softsig, because signals are only delivered to the softsig thread and
    blocked in all other threads. It is technically possible to trigger
    this situation on Solaris by sending the (unblockable) SIGCANCEL
    signal, though this would be very unusual.
    To make sure issues like this cannot happen and to avoid weird corner
    cases, adjust all of our CV waiters to wait for a CV using a while()
    loop or similar pattern. Spurious wakeups may be impossible with LWP,
    but just try to make all code use a similar structure to be safe.
    Thanks for for finding and investigating the
    relevant issue.
    Reviewed-by: Cheyenne Wills <>
    Reviewed-by: Mark Vitale <>
    Reviewed-by: Marcio Brito Barbosa <>
    Reviewed-by: Michael Meffie <>
    Reviewed-by: Benjamin Kaduk <>
    Tested-by: BuildBot <>
    (cherry picked from commit 9bc06a059121207b354fdf97f65029d8c2b3df30)
    Change-Id: Ib1fdf06570e441b4a322a1e9b90ff084e07ad1fb
    Reviewed-by: Andrew Deason <>
    Tested-by: BuildBot <>
    Reviewed-by: Marcio Brito Barbosa <>
    Reviewed-by: Kailas Zadbuke <>
    Reviewed-by: Stephan Wiesand <>

 src/vol/volume.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

OpenAFS Master Repository