Skip to content

Commit e1418e1

Browse files
committed
librbd/migration/NBDStream: call nbd_shutdown() in close()
Avoid warnings like qemu-nbd: Disconnect client, due to: Failed to read request: Unexpected end-of-file before all bytes were read Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 90b55cf commit e1418e1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librbd/migration/NBDStream.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,12 @@ void NBDStream<I>::close(Context* on_finish) {
263263
ldout(m_cct, 20) << dendl;
264264

265265
if (m_nbd != nullptr) {
266+
// send a graceful shutdown to the server
267+
// ignore errors -- we are read-only, also from the client's
268+
// POV there is no disadvantage to abruptly closing the socket
269+
// in nbd_close()
270+
nbd_shutdown(m_nbd, 0);
271+
266272
nbd_close(m_nbd);
267273
m_nbd = nullptr;
268274
}

0 commit comments

Comments
 (0)