Lock MFI config not exclusively locked - panic
John Baldwin
jhb at freebsd.org
Wed Sep 26 14:14:39 UTC 2012
On Tuesday, September 25, 2012 9:37:41 pm Steven Hartland wrote:
> ----- Original Message -----
> > I've been testing some enhancements to mfiutil so compiled
> > kernel in debug with:-
> > options INVARIANTS
> > options INVARIANT_SUPPORT
> > options DDB
> > options MFI_DEBUG
> >
> > After doing that and running mfiutil to import a foreign
> > config I get a panic with:-
> > Lock MFI config not exclusively locked @ /usr/src/sys/dev/mfi/mfi.c:1001
> >
> > Looking at the code this was trigged by the mfi_ldprobe from
> > mfi_check_command_post which doesn't do any locking.
> >
> > Is the correct fix for this to wrap all the calls to mfi_ldprobe
> > with config and io lock as per mfi_startup e.g.
> > sx_xlock(&sc->mfi_config_lock);
> > mtx_lock(&sc->mfi_io_lock);
> > mfi_ldprobe(sc);
> > mtx_unlock(&sc->mfi_io_lock);
> > sx_xunlock(&sc->mfi_config_lock);
>
> Replying to my own posts again, but just spotted mfi_config_lock
> method and seems its just missing MFI_DCMD_CFG_FOREIGN_IMPORT
> which is required for user commands.
>
> Adding it fixes this panic :)
Committed, thanks!
--
John Baldwin
More information about the freebsd-stable
mailing list