[Bug 224892] ufs: lock order reversal

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Jan 4 12:52:22 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224892

            Bug ID: 224892
           Summary: ufs: lock order reversal
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: breno.leitao at gmail.com

I am running current freebsd (Jan 4st - git commit
6fceb757ffd5b050eca4c75ecbd350710b11db5e) on a powerpc64 machine and I am
facing a file system lock order reversal.

lock order reversal:
 1st 0xc0000000008ac748 bufwait (bufwait) @
/root/kernel/freebsd/sys/kern/vfs_bio.c:3564
 2nd 0x4985200 dirhash (dirhash) @
/root/kernel/freebsd/sys/ufs/ufs/ufs_dirhash.c:289
stack backtrace:
#0 0x5ec138 at ??+0
#1 0x5ee360 at ??+0
#2 0x576c2c at ??+0
#3 0x870e50 at ??+0
#4 0x871314 at ??+0
#5 0x875008 at ??+0
#6 0x87f6b4 at ??+0
#7 0x923d0c at ??+0
#8 0x66ede4 at ??+0
#9 0x66ef2c at ??+0
#10 0x908890 at ??+0
#11 0x8fd938 at ??+0


$ awk 'NR >= 3560 && NR <= 3570' /root/kernel/freebsd/sys/kern/vfs_bio.c    
                if (flags & GB_LOCK_NOWAIT)
                        lockflags |= LK_NOWAIT;

                error = BUF_TIMELOCK(bp, lockflags,
                    BO_LOCKPTR(bo), "getblk", slpflag, slptimeo);

                /*
                 * If we slept and got the lock we have to restart in case
                 * the buffer changed identities.
                 */
                if (error == ENOLCK)


$ awk 'NR >= 285 && NR <= 295' /root/kernel/freebsd/sys/ufs/ufs/ufs_dirhash.c

        dh = ip->i_dirhash;
        if (dh == NULL)
                return (NULL);
        sx_xlock(&dh->dh_lock);
        if (dh->dh_hash != NULL)
                return (dh);
        ufsdirhash_free_locked(ip);
        return (NULL);
}

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list