Date: Tue, 22 May 2018 15:13:26 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334048 - head/sys/kern Message-ID: <201805221513.w4MFDQKL061997@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Tue May 22 15:13:25 2018 New Revision: 334048 URL: https://svnweb.freebsd.org/changeset/base/334048 Log: sx: fixup a braino in r334024 If a thread waiting on sx dropped Giant it would not be properly reacquired on exit from the routine, later resulting in panics indicating Giant is not held (when it should be). The bug was not present in the original patch sent to pho, I wittingly added it just prior to the commit and only smoke-tested it. Reported by: pho Modified: head/sys/kern/kern_sx.c Modified: head/sys/kern/kern_sx.c ============================================================================== --- head/sys/kern/kern_sx.c Tue May 22 14:36:46 2018 (r334047) +++ head/sys/kern/kern_sx.c Tue May 22 15:13:25 2018 (r334048) @@ -879,6 +879,7 @@ retry_sleepq: if (in_critical) critical_exit(); #endif + GIANT_RESTORE(); #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) if (__predict_true(!doing_lockprof)) return (error); @@ -898,7 +899,6 @@ out_lockstat: if (!error) LOCKSTAT_PROFILE_OBTAIN_RWLOCK_SUCCESS(sx__acquire, sx, contested, waittime, file, line, LOCKSTAT_WRITER); - GIANT_RESTORE(); return (error); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805221513.w4MFDQKL061997>