qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buffer I/O error on dev nbd0


From: Eric Blake
Subject: Re: Buffer I/O error on dev nbd0
Date: Mon, 23 May 2022 16:22:26 -0500
User-agent: NeoMutt/20220429-77-e284d5

On Fri, May 20, 2022 at 11:02:22AM +0200, Pascal wrote:
> hi,
> 
> *as for my other thread posted yesterday (kernel: block nbd0: shutting down
> sockets), I don't know if the problem is directly related to qemu-nbd but I
> post on this one because it occurs during its use : thank you for
> redirecting me if needed.*
> 
> my system is a Linux (5.10.83) with SystemD (249.7) and Qemu (6.1.0).
> 
> when I connect my blank (zeroized) disk /dev/sdb to /dev/nbd0 and
> disconnect it the next moment, I get I/O error messages even though nothing
> has been done between these two moments on the disk or on the nbd node (no
> process such as udisk, no automatic mounting, etc...).
> 
> qemu-nbd -r -s -f raw -c /dev/nbd0 /dev/sdb
> # some seconds
> qemu-nbd -d /dev/nbd0
> 
> and in journalctl :
> 
> block nbd0: NBD_DISCONNECT
> block nbd0: Disconnected due to user request.

Up to here is the result of qemu-nbd.  Everything after is other
processes (probably udev or similar scanning for partitions on
newly-appearing block devices) that have pending I/O but where you
ripped out the block device from under them.

> blk_update_request: I/O error, dev nbd0, sector 524160 op 0x0:(READ) flags
> 0x80700 phys_seg 1 prio class 0
> blk_update_request: I/O error, dev nbd0, sector 524160 op 0x0:(READ) flags
> 0x0 phys_seg 8 prio class 0
> Buffer I/O error on dev nbd0, logical block 524160, async page read
> Buffer I/O error on dev nbd0, logical block 524161, async page read
> Buffer I/O error on dev nbd0, logical block 524162, async page read
> Buffer I/O error on dev nbd0, logical block 524163, async page read
> Buffer I/O error on dev nbd0, logical block 524164, async page read
> Buffer I/O error on dev nbd0, logical block 524165, async page read
> Buffer I/O error on dev nbd0, logical block 524166, async page read
> Buffer I/O error on dev nbd0, logical block 524167, async page read

These messages are not from qemu-nbd; I don't know if they are from
the kernel NBD module directly, or from whatever other process was
trying to read information about partitions even after the block
device is no longer accessible.

> 
> why these I/O errors occur (blk_update_request) ? especially since they are
> not systematic (some disconnections occur without error).

It's a timing race.  Whatever your system has that reads block devices
(udev?) may or may not have completed by the time you disconnect
/dev/nbd0.  If it wins the race and your disconnect is slow enough,
you get no messages.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]