Skip to content

NBD: flag handling cleanup

Eric Blake qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3nbd: Treat flags vs. command type as separate fieldsblock/nbd-client.c include/block/nbd.h nbd/client.c +1 more+41 -320 replies
2/3nbd: Fix poor debug messagenbd/client.c+1 -11 reply
3/3nbd: Reject unknown request flagsnbd/server.c+4 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/3] NBD: flag handling cleanup

I'm currently helping with work on adding extensions to the upstream NBD protocol to allow more efficient handling of sparse files, and wanted to get my feet wet in the qemu NBD code (both client and server), to actually implement those proposals to see how well they work. In the process, I found a flaw where we were silently ignoring bad client flags; the same flaw was just recently patched in upstream NBD:
https://github.com/yoe/nbd/commit/ab22e0820

I didn't go quite as far as upstream (that is, I still silently permit FLAG_FUA in combination with CMD_TRIM, which does not have defined semantics upstream, and where our current implementation might be too weak compared to the actual semantics that upstream wants to propose, because we aren't actually flushing in that case), but this at least gets rid of the worst offenses and starts to document some anomolies that may need later fixing.

Eric Blake (3):
nbd: Treat flags vs. command type as separate fields
nbd: Fix poor debug message
nbd: Reject unknown request flags

 include/block/nbd.h | 17 +++++++++++------
 block/nbd-client.c  | 11 ++++-------
 nbd/client.c        | 19 +++++++++++--------
 nbd/server.c        | 32 ++++++++++++++++++++------------
 4 files changed, 46 insertions(+), 33 deletions(-)
Signature · 1 line
2.5.5