On 9/18/19 10:01 PM, Eric Blake wrote:
The NBD spec says that if a client requests SET_META_CONTEXT for
exportA, but later requests NBD_OPT_GO/EXPORT_NAME for exportB, then
the server should reject NBD_CMD_BLOCK_STATUS requests (that is, the
context returned for exportA need not apply to exportB). When we
originally added base:allocation, our argument was that we always
ignore export names, so it was easier to just treat any two export
names as being the same export, so no need to reset things. But now
that we have nbdkit_export_name(), we are better off obeying the spec.
Note that there are no known clients in the wild that can actually
perform this cross-export-name request; this was found by inspection.
I also don't see the point in hacking up libnbd to become such a
client.
Fixes: 4f303e44
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
server/internal.h | 1 +
server/protocol-handshake-newstyle.c | 24 ++++++++++++++++++++++--
2 files changed, 23 insertions(+), 2 deletions(-)
This missed NBD_OPT_EXPORT_NAME, I'll see if I can factor out a common
helper function rather than duplicating code. (Then again, a client
that requests SET_META_CONTEXT but doesn't use OPT_GO is an anomaly)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization:
qemu.org |
libvirt.org