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

[Nbd] strange error when killing program reading from /dev/nb0



I had set up /dev/nb0 associated with an 80 GB whole disk on another
machine, and was testing how well things work.  Mostly it works fine.
I've run QEMU with /dev/nb0 as an emulated /dev/hda and that let me
make that drive bootable (using QEMU -kernel option to load a local
kernel image directly before the drive was bootable), and then boot
OK from the drive.  The guest OS under QEMU saw all the partition
just fine.

Later I was running a timing test to compare how well NBD transfers
data over my LAN, to be compared against a plain TCP connection.
So I let that run for a while.  Then I decided I wanted to do some
other stuff and put off this transfer benchmark to later.  So I
first killed the program that was reading /dev/nb0 using Cntrl-C.
That program is not coded to trap SIGINT, so it should have simply
killed the program immediately.  That's when I got all these kernel
messages.  This was running on /dev/tty1 so I got all the kernel
printk() messages directly.  This is what I saw.  Note that the
first kernel message is on the 2nd line, with the timestamp of
[657899.259186].  That seems to indicate that the NBD code does
have some kind of handler for these signals.

=============================================================================
root@...101...:/root 290> vbuf -i /dev/nb0 -o /dev/null
    8411676672 [1048576]      9.978 MBps  (   9.746 MBps) [657899.259186] nbd (pid 3076: vbuf) got signal 9
[657899.259610] nbd0: Send control failed (result -4)
[657899.259868] nbd0: Request send failed
[657899.260098] end_request: I/O error, dev nbd0, sector 16438016
[657899.260250] printk: 2 messages suppressed.
[657899.260371] Buffer I/O error on device nbd0, logical block 8219008
[657899.260513] Buffer I/O error on device nbd0, logical block 8219009
[657899.260652] Buffer I/O error on device nbd0, logical block 8219010
[657899.260775] Buffer I/O error on device nbd0, logical block 8219011
[657899.260897] Buffer I/O error on device nbd0, logical block 8219012
[657899.261018] Buffer I/O error on device nbd0, logical block 8219013
[657899.261168] Buffer I/O error on device nbd0, logical block 8219014
[657899.261305] Buffer I/O error on device nbd0, logical block 8219015
[657899.261447] Buffer I/O error on device nbd0, logical block 8219016
[657899.261589] Buffer I/O error on device nbd0, logical block 8219017
[657899.280954] nbd0: Unexpected reply (d1df3e14)
[657899.281119] nbd0: shutting down socket
[657899.281266] end_request: I/O error, dev nbd0, sector 16438016
[657899.281416] end_request: I/O error, dev nbd0, sector 16438526
[657899.281565] end_request: I/O error, dev nbd0, sector 16438272
[657899.281897] end_request: I/O error, dev nbd0, sector 16438270
[657899.282050] nbd0: queue cleared
Kernel call returned: Invalid request descriptorClosing: que, sock, done

0.120u 88.380s 14:03.56 10.4% (0t+0ds 0avg 0max)k 0i+0o (1maj+445min)pf 0 swap
root@...101...:/root 291>
=============================================================================

Can someone tell me what this means, and what went wrong?

The connection to the server was closed by this and I think that should
not be taking place, since killing a program that has a device open for
reading (or writing for that matter) shouldn't make the device no longer
available.  I tried to restart the program, which got the following, so
it apparently really did shut down the socket as it said it did.

=============================================================================
root@...101...:/root 291> vbuf -i /dev/nb0 -o /dev/null
             0 [      0]      0.000  Bps  (   0.000  Bps) [658638.389762] nbd0: Attempted send on closed socket
[658638.390009] end_request: I/O error, dev nbd0, sector 0
[658638.390139] printk: 250 messages suppressed.
[658638.390258] Buffer I/O error on device nbd0, logical block 0
[658638.390384] Buffer I/O error on device nbd0, logical block 1
[658638.390503] Buffer I/O error on device nbd0, logical block 2
[658638.390624] Buffer I/O error on device nbd0, logical block 3
[658638.390745] Buffer I/O error on device nbd0, logical block 4
[658638.390867] Buffer I/O error on device nbd0, logical block 5
[658638.390988] Buffer I/O error on device nbd0, logical block 6
[658638.391110] Buffer I/O error on device nbd0, logical block 7
[658638.391231] Buffer I/O error on device nbd0, logical block 8
[658638.391352] Buffer I/O error on device nbd0, logical block 9
[658638.391784] nbd0: Attempted send on closed socket
[658638.391896] end_request: I/O error, dev nbd0, sector 248
[658638.392043] nbd0: Attempted send on closed socket
[658638.392168] end_request: I/O error, dev nbd0, sector 496
[658638.392295] nbd0: Attempted send on closed socket
[658638.392421] end_request: I/O error, dev nbd0, sector 0

vbuf: read( 3, 0xb7bbf000, 1048576 ): Input/output error
             0 [      0]      0.000  Bps  (    0.004 sec)
root@...101...:/root 292> nbd-client -d /dev/nb0
Disconnecting: que, disconnect, root@...101...:/root 293> nbd-client -d /dev/nb0
Disconnecting: que, disconnect, root@...101...:/root 294>
root@...101...:/root 294> vbuf -i /dev/nb0 -o /dev/null
             0 [      0]      0.000  Bps  (   0.000  Bps) [658877.901070] nbd0: Attempted send on closed socket
[658877.901201] end_request: I/O error, dev nbd0, sector 0
[658877.901319] printk: 55 messages suppressed.
[658877.901439] Buffer I/O error on device nbd0, logical block 0
[658877.901564] Buffer I/O error on device nbd0, logical block 1
[658877.901684] Buffer I/O error on device nbd0, logical block 2
[658877.901729] Buffer I/O error on device nbd0, logical block 3
[658877.901775] Buffer I/O error on device nbd0, logical block 4
[658877.901820] Buffer I/O error on device nbd0, logical block 5
[658877.901866] Buffer I/O error on device nbd0, logical block 6
[658877.901912] Buffer I/O error on device nbd0, logical block 7
[658877.901957] Buffer I/O error on device nbd0, logical block 8
[658877.902003] Buffer I/O error on device nbd0, logical block 9
[658877.902093] nbd0: Attempted send on closed socket
[658877.902138] end_request: I/O error, dev nbd0, sector 248
[658877.902206] nbd0: Attempted send on closed socket
[658877.902250] end_request: I/O error, dev nbd0, sector 496
[658877.902306] nbd0: Attempted send on closed socket
[658877.902360] end_request: I/O error, dev nbd0, sector 0

vbuf: read( 3, 0xb7c35000, 1048576 ): Input/output error
             0 [      0]      0.000  Bps  (    0.002 sec)
root@...101...:/root 295> nbd-client 169.254.38.5 9000 /dev/nb0
Negotiation: ..size = 78150744KB
bs=1024, sz=78150744
root@...101...:/root 296> nbd-client -d /dev/nb0
Disconnecting: que, disconnect, sock, done
root@...101...:/root 297> [659952.069891] nbd0: Receive control failed (result -32)
[659952.070021] nbd0: queue cleared
Kernel call returned: Broken pipeClosing: que, sock, done

root@...101...:/root 297>
=============================================================================

-- 
-----------------------------------------------------------------------------
| Phil Howard KA9WGN       | http://linuxhomepage.com/      http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/   http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------



Reply to: