m...@netbsd.org (Emmanuel Dreyfus) writes:

>I can tell that in vfs_bio.c, bread() -> bio_doread() will call
>VOP_STRATEGY once for the offendinf buf_t, but biodone() is called twice
>in interrupt context for the buf_t, leading to the biodone2 already
>panic later.

>Since you know the xbd code you could save me some time: where do we go
>below VOP_SRATEGY? 

The buffer is passed to xbdstrategy that tries to run the I/O queue.
-> on error it finishes with biodone
regulary it calls dk_strategy that iterates over xbd_diskstart.
-> on error from xbd_diskstart it again finishes with biodone

xbd_diskstart tries to push a single buffer, it either
- queues the buffer to the "hardware" (a hypervisor event) or
- returns EAGAIN to retry the operation or
- returns another error to fail the operation

a queued operation eventually returns with a call to xbd_handler.
- for every buffer returned, dk_done is called which finally ends
  in invoking biodone.

hypervisor events link to a 'xbd_req' structure (and per request,
which can be I/O but also a cache flush operation). For I/O requests
the 'xbd_req' structure points to the buffer.

                                Michael van Elst
Internet: mlel...@serpens.de
                                "A potential Snark may lurk in every tree."

Reply via email to