geom->access problem and workaround

Warner Losh imp at bsdimp.com
Fri Mar 23 13:31:17 UTC 2018


On Fri, Mar 23, 2018 at 4:38 AM, Andriy Gapon <avg at freebsd.org> wrote:

> On 12/03/2018 20:07, Poul-Henning Kamp wrote:
> > If we want to have an architectural sound way to do slow operations
> > before any "user-I/O" is initiated, the right way to do so is to
> > define new BIO_OPEN and BIO_CLOSE  operation, and insist via asserts
> > than all BIO_{READ|WRITE|DELETE} are wrapped in these.
>
>
> In support of this proposal I want to add another example.
> The problem is not only with doing I/O in access, but also with doing
> blocking
> I/O in the normal I/O path.
> The following happened when a userland program tried to read from a CD-ROM
> while
> its tray was open:
>
> panic: sleepq_add: td 0xfffff80008e1c000 to sleep on wchan
> 0xfffff801e58b8048
> with sleeping prohibited
>

cdstrategy shouldn't be sleeping. It can start I/O, but it can't wait for
it to finish. strategy has been a no-sleep-zone since at least v6. The fact
it's waiting for prevent is the bug here.

Waner


More information about the freebsd-arch mailing list