Panic in g_disk_done() with atacontrol detach

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Feb 1 13:32:50 PST 2004


In message <20040201222823.M616 at korben.in.tern>, Lukas Ertl writes:
>On Sun, 1 Feb 2004, Poul-Henning Kamp wrote:
>
>> In message <20040201190653.M613 at korben.in.tern>, Lukas Ertl writes:
>> >The problem obviously is that ad_detach() calls disk_destroy() which nulls
>> >out the softc, and in g_disk_done() this softc is referenced again.
>> >
>> >The question is: is this an unsupported operation in the sense of "don't
>> >do that"?  If yes, then "atacontrol detach" should probably refuse to do
>> >the actual detach when there are I/O requests running, this would prevent
>> >a lot of foot shooting.
>>
>> No, this should work.
>
>Ok, but just commenting out the "gp->softc = NULL" statements apparently
>aren't the way to go, cause then I end up in a panic somewhere in the
>softupdate code...
>
>Any hints how to properly do this?

I need to look a this in detail before I can answer, but the trick may
be to move the removal of the devstat stuff earlier (ie: before the
null'ing of the softc).

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-geom mailing list