scsi_scan_bus in FreeBSD 10.1 has mutex unlock and lock swapped

Sibananda Sahu sibananda.sahu at avagotech.com
Wed Apr 8 15:40:39 UTC 2015


Hi,



Recently I was working with mpslsi3 driver and found that the system just
crashed at xpt_action() call.



After digging a little into the CAM layer code I found that:

inside scsi_scan_bus()at line number: 1935 first mutex_unlock(mtx) is
called and then at line 1974 called mtx_lock(mtx) just before exiting the
XPT_SCAN_BUS case.



I just swapped the calls and called mutex_lock() first and then called
mutex_unlock() and found there is no kernel panic.

Driver was loaded just fine but after a while I was unable to operate the
system.

But pinging to the system was working and the system was up.



Is it OK or it looks to be a bug?





Thanks,

Sibananda Sahu


More information about the freebsd-scsi mailing list