Author: sbruno Date: Wed Jun 24 15:52:26 2015 New Revision: 284766 URL: https://svnweb.freebsd.org/changeset/base/284766
Log: At the suggestion of jhb, replace atomic_set/clear calls with use of exclusive locks in the enable/disable interpreter path. Tested with WITNESS/INVARIANTS on and off. Reviewed by: sson davide Modified: head/sys/kern/imgact_binmisc.c Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Wed Jun 24 15:13:27 2015 (r284765) +++ head/sys/kern/imgact_binmisc.c Wed Jun 24 15:52:26 2015 (r284766) @@ -308,14 +308,14 @@ imgact_binmisc_disable_entry(char *name) { imgact_binmisc_entry_t *ibe; - sx_slock(&interp_list_sx); + sx_xlock(&interp_list_sx); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - sx_sunlock(&interp_list_sx); + sx_xunlock(&interp_list_sx); return (ENOENT); } - atomic_clear_32(&ibe->ibe_flags, IBF_ENABLED); - sx_sunlock(&interp_list_sx); + ibe->ibe_flags &= ~IBF_ENABLED; + sx_xunlock(&interp_list_sx); return (0); } @@ -329,14 +329,14 @@ imgact_binmisc_enable_entry(char *name) { imgact_binmisc_entry_t *ibe; - sx_slock(&interp_list_sx); + sx_xlock(&interp_list_sx); if ((ibe = imgact_binmisc_find_entry(name)) == NULL) { - sx_sunlock(&interp_list_sx); + sx_xunlock(&interp_list_sx); return (ENOENT); } - atomic_set_32(&ibe->ibe_flags, IBF_ENABLED); - sx_sunlock(&interp_list_sx); + ibe->ibe_flags |= IBF_ENABLED; + sx_xunlock(&interp_list_sx); return (0); } _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"