* strange dm-crypt problem with qemu / LIO / vhost
@ 2020-04-06 18:21 Andreas Kinzler
2020-04-06 21:33 ` David Disseldorp
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Andreas Kinzler @ 2020-04-06 18:21 UTC (permalink / raw)
To: target-devel
I am trying to use a /dev/mapper/luks (via cryptsetup/LUKS) on a
backstorage/iblock from the target/SCSI framework and pass that through
vhost (tcm_vhost) to qemu guests. It works with Linux guests but with
Windows guests (using the virtio-scsi pv-driver) I get tons of errors in
dmesg:
[ 3683.403467] bio error: 00000000f33a8dcd, err: 10
[ 3683.403612] bio error: 00000000a508ea6b, err: 10
[ 3683.414686] bio error: 00000000f06baf1d, err: 10
[ 3683.414767] bio error: 0000000035714712, err: 10
[ 3683.414829] bio error: 0000000062dd8892, err: 10
[ 3683.414883] bio error: 000000005c303a2d, err: 10
[ 3683.414936] bio error: 0000000024d02dea, err: 10
This is from target_core_iblock.c function "iblock_bio_done".
Any ideas? Hints?
Regards Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: strange dm-crypt problem with qemu / LIO / vhost
2020-04-06 18:21 strange dm-crypt problem with qemu / LIO / vhost Andreas Kinzler
@ 2020-04-06 21:33 ` David Disseldorp
2020-04-06 22:01 ` Andreas Kinzler
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: David Disseldorp @ 2020-04-06 21:33 UTC (permalink / raw)
To: target-devel
Hi Andreas,
It's normally a good idea to provide your kernel version with any
bug reports...
On Mon, 6 Apr 2020 20:21:55 +0200, Andreas Kinzler wrote:
> [ 3683.414936] bio error: 0000000024d02dea, err: 10
>
> This is from target_core_iblock.c function "iblock_bio_done".
>
> Any ideas? Hints?
This looks like an I/O error from the block layer / underlying dm-crypt
block device. It's not much to go on, but I'd suggest tracing the I/O
further down the stack.
Cheers, David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: strange dm-crypt problem with qemu / LIO / vhost
2020-04-06 18:21 strange dm-crypt problem with qemu / LIO / vhost Andreas Kinzler
2020-04-06 21:33 ` David Disseldorp
@ 2020-04-06 22:01 ` Andreas Kinzler
2020-04-06 23:05 ` David Disseldorp
2020-04-07 10:29 ` Andreas Kinzler
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Kinzler @ 2020-04-06 22:01 UTC (permalink / raw)
To: target-devel
Hello David,
> It's normally a good idea to provide your kernel version with any
> bug reports...
Sorry. Kernel is 5.3.18 vanilla from kernel.org
>> [ 3683.414936] bio error: 0000000024d02dea, err: 10
>> This is from target_core_iblock.c function "iblock_bio_done".
>> Any ideas? Hints?
> This looks like an I/O error from the block layer / underlying dm-crypt
> block device. It's not much to go on, but I'd suggest tracing the I/O
> further down the stack.
In the meantime, I was able to debug further. Actually in Windows only
the "format disk" operation fails. If you do that otherwise and later
use the formatted disk, it seems to work. So I assume it is a special
SCSI opcode that is only used during "format disk" that fails.
What would be a simple debug statement in iblock_bio_done to print the
SCSI opcode to find out which operation failed?
> Cheers, David
Regards Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: strange dm-crypt problem with qemu / LIO / vhost
2020-04-06 18:21 strange dm-crypt problem with qemu / LIO / vhost Andreas Kinzler
2020-04-06 21:33 ` David Disseldorp
2020-04-06 22:01 ` Andreas Kinzler
@ 2020-04-06 23:05 ` David Disseldorp
2020-04-07 10:29 ` Andreas Kinzler
3 siblings, 0 replies; 5+ messages in thread
From: David Disseldorp @ 2020-04-06 23:05 UTC (permalink / raw)
To: target-devel
On Tue, 7 Apr 2020 00:01:49 +0200, Andreas Kinzler wrote:
> > It's normally a good idea to provide your kernel version with any
> > bug reports...
>
> Sorry. Kernel is 5.3.18 vanilla from kernel.org
Thanks.
> >> [ 3683.414936] bio error: 0000000024d02dea, err: 10
> >> This is from target_core_iblock.c function "iblock_bio_done".
> >> Any ideas? Hints?
> > This looks like an I/O error from the block layer / underlying dm-crypt
> > block device. It's not much to go on, but I'd suggest tracing the I/O
> > further down the stack.
>
> In the meantime, I was able to debug further. Actually in Windows only
> the "format disk" operation fails. If you do that otherwise and later
> use the formatted disk, it seems to work. So I assume it is a special
> SCSI opcode that is only used during "format disk" that fails.
>
> What would be a simple debug statement in iblock_bio_done to print the
> SCSI opcode to find out which operation failed?
You could print the SCSI opcode value with something like:
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -290,7 +290,8 @@ static void iblock_bio_done(struct bio *bio)
struct iblock_req *ibr = cmd->priv;
if (bio->bi_status) {
- pr_err("bio error: %p, err: %d\n", bio, bio->bi_status);
+ pr_err("op: %#x, bio error: %p, err: %d\n", cmd->t_task_cdb[0],
+ bio, bio->bi_status);
/*
* Bump the ib_bio_err_cnt and release bio.
*/
include/scsi/scsi_proto.h should allow you to lookup the name.
Cheers, David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: strange dm-crypt problem with qemu / LIO / vhost
2020-04-06 18:21 strange dm-crypt problem with qemu / LIO / vhost Andreas Kinzler
` (2 preceding siblings ...)
2020-04-06 23:05 ` David Disseldorp
@ 2020-04-07 10:29 ` Andreas Kinzler
3 siblings, 0 replies; 5+ messages in thread
From: Andreas Kinzler @ 2020-04-07 10:29 UTC (permalink / raw)
To: target-devel
Hello David,
>> In the meantime, I was able to debug further. Actually in Windows only
>> the "format disk" operation fails. If you do that otherwise and later
>> use the formatted disk, it seems to work. So I assume it is a special
>> SCSI opcode that is only used during "format disk" that fails.
> You could print the SCSI opcode value with something like:
Thanks for the help. I was able to find the root cause. To avoid
duplication with the issue tracker of the kvm-guest drivers, here is the
link to my findings:
https://github.com/virtio-win/kvm-guest-drivers-windows/issues/446
Please feel free to add more comments to remaining open questions there.
Especially about the question of alignment in BIOs.
Regards Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-04-07 10:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-06 18:21 strange dm-crypt problem with qemu / LIO / vhost Andreas Kinzler
2020-04-06 21:33 ` David Disseldorp
2020-04-06 22:01 ` Andreas Kinzler
2020-04-06 23:05 ` David Disseldorp
2020-04-07 10:29 ` Andreas Kinzler
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.