qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 1644cc: nbd/server: Don't complain on certain


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 1644cc: nbd/server: Don't complain on certain client disco...
Date: Mon, 22 Nov 2021 10:20:51 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 1644cccea5c71b02b9cf8f78b780e7069a29b189
      
https://github.com/qemu/qemu/commit/1644cccea5c71b02b9cf8f78b780e7069a29b189
  Author: Eric Blake <eblake@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Don't complain on certain client disconnects

When a client disconnects abruptly, but did not have any pending
requests (for example, when using nbdsh without calling h.shutdown),
we used to output the following message:

$ qemu-nbd -f raw file
$ nbdsh -u 'nbd://localhost:10809' -c 'h.trim(1,0)'
qemu-nbd: Disconnect client, due to: Failed to read request: Unexpected 
end-of-file before all bytes were read

Then in commit f148ae7, we refactored nbd_receive_request() to use
nbd_read_eof(); when this returns 0, we regressed into tracing
uninitialized memory (if tracing is enabled) and reporting a
less-specific:

qemu-nbd: Disconnect client, due to: Request handling failed in intermediate 
state

Note that with Unix sockets, we have yet another error message,
unchanged by the 6.0 regression:

$ qemu-nbd -k /tmp/sock -f raw file
$ nbdsh -u 'nbd+unix:///?socket=/tmp/sock' -c 'h.trim(1,0)'
qemu-nbd: Disconnect client, due to: Failed to send reply: Unable to write to 
socket: Broken pipe

But in all cases, the error message goes away if the client performs a
soft shutdown by using NBD_CMD_DISC, rather than a hard shutdown by
abrupt disconnect:

$ nbdsh -u 'nbd://localhost:10809' -c 'h.trim(1,0)' -c 'h.shutdown()'

This patch fixes things to avoid uninitialized memory, and in general
avoids warning about a client that does a hard shutdown when not in
the middle of a packet.  A client that aborts mid-request, or which
does not read the full server's reply, can still result in warnings,
but those are indeed much more unusual situations.

CC: qemu-stable@nongnu.org
Fixes: f148ae7d36 ("nbd/server: Quiesce coroutines on context switch", v6.0.0)
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
[eblake: defer unrelated typo fixes to later patch]
Message-Id: <20211117170230.1128262-2-eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>


  Commit: e35574226a63f29e32eda8da5cc14832f19850e2
      
https://github.com/qemu/qemu/commit/e35574226a63f29e32eda8da5cc14832f19850e2
  Author: Eric Blake <eblake@redhat.com>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  nbd/server: Simplify zero and trim

Now that the block layer supports 64-bit operations (see commit
2800637a and friends, new to v6.2), we no longer have to self-fragment
requests larger than 2G, reverting the workaround added in 890cbccb08
("nbd: Fix large trim/zero requests", v5.1.0).

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20211117170230.1128262-3-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>


  Commit: d8a6311dabe62b7d3553915511e9d61fc3556eb6
      
https://github.com/qemu/qemu/commit/d8a6311dabe62b7d3553915511e9d61fc3556eb6
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-11-22 (Mon, 22 Nov 2021)

  Changed paths:
    M nbd/server.c

  Log Message:
  -----------
  Merge tag 'pull-nbd-2021-11-22' of https://repo.or.cz/qemu/ericb into staging

nbd patches for 2021-11-22

- Eric Blake: Avoid uninitialized memory on client hard disconnect
- Eric Blake: Take advantage of block layer 64-bit zero/trim

# gpg: Signature made Mon 22 Nov 2021 02:55:07 PM CET
# gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
# gpg:                 aka "Eric Blake (Free Software Programmer) 
<ebb9@byu.net>" [full]
# gpg:                 aka "[jpeg image of size 6874]" [full]

* tag 'pull-nbd-2021-11-22' of https://repo.or.cz/qemu/ericb:
  nbd/server: Simplify zero and trim
  nbd/server: Don't complain on certain client disconnects

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/89d2f9e4c637...d8a6311dabe6



reply via email to

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