Index: sys/kern/subr_trap.c =================================================================== --- sys/kern/subr_trap.c +++ sys/kern/subr_trap.c @@ -134,9 +134,6 @@ KTRUSERRET(td); #endif - td_softdep_cleanup(td); - MPASS(td->td_su == NULL); - /* * If this thread tickled GEOM, we need to wait for the giggling to * stop before we return to userland @@ -195,8 +192,6 @@ ("userret: Returning with preallocated vnode")); KASSERT((td->td_flags & (TDF_SBDRY | TDF_SEINTR | TDF_SERESTART)) == 0, ("userret: Returning with stop signals deferred")); - KASSERT(td->td_su == NULL, - ("userret: Returning with SU cleanup request not handled")); KASSERT(td->td_vslock_sz == 0, ("userret: Returning with vslock-wired space")); #ifdef VIMAGE @@ -289,6 +284,9 @@ ktrcsw(0, 1, __func__); #endif } + + td_softdep_cleanup(td); + MPASS(td->td_su == NULL); #ifdef DIAGNOSTIC if (p->p_numthreads == 1 && (flags & TDF_NEEDSIGCHK) == 0) {