Re: Panic at USB drive plugging in

From: Jia-Shiun Li <jiashiun_at_gmail.com>
Date: Tue, 6 Aug 2013 18:41:29 +0800
2013/7/24 下午10:26 於 "Jia-Shiun Li" <jiashiun_at_gmail.com> 寫道:

> On Wed, Jul 24, 2013 at 4:02 AM, Alexander Motin <mav_at_freebsd.org> wrote:
> > cam.k kernel module includes all existing periph drivers in one bundle.
> > Loading cam.ko you are probably getting sg driver also, that triggers
> > reported issue. You may try to rip out sg with single line hack to
> module's
> > Makefile. The real fix require looking closer on sg, which I never used.
> >
>
> Indeed. Test result did confirm that if sg is not included in cam.ko
> USB drives will not cause kernel to panic.
>
>
Hi all,

turns out, it may be conflicts between assumed and actual sg usage.

The sg driver specifically assumes a write-read sequence. If a read comes
first it will cause sg to panic at msleep() in sgread. In my case the
process is hald-probe-storage tasting new devices. But it can be as simple
as "dd if=/dev/sgX".
I am wondering that, is sg necessary on FreeBSD? Since most applications
seem to live happily without it in GENERIC kernel. Maybe we can isolate it
from cam.ko to make cam usable as module, and make the standalone sg module
depending on cam module before sg got more resistant to misuse?

Regards,
Jia-Shiun.
Received on Tue Aug 06 2013 - 08:42:00 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:40 UTC