Skip to content
  • Eric Blake's avatar
    a89ef0c3
    nbd: don't request FUA on FLUSH · a89ef0c3
    Eric Blake authored
    
    
    The NBD protocol does not clearly document what will happen
    if a client sends NBD_CMD_FLAG_FUA on NBD_CMD_FLUSH.
    Historically, both the qemu and upstream NBD servers silently
    ignored that flag, but that feels a bit risky.  Meanwhile, the
    qemu NBD client unconditionally sends the flag (without even
    bothering to check whether the caller cares; at least with
    NBD_CMD_WRITE the client only sends FUA if requested by a
    higher layer).
    
    There is ongoing discussion on the NBD list to fix the
    protocol documentation to require that the server MUST ignore
    the flag (unless the kernel folks can better explain what FUA
    means for a flush), but until those doc improvements land, the
    current nbd.git master was recently changed to reject the flag
    with EINVAL (see nbd commit ab22e082), which now makes it
    impossible for a qemu client to use FLUSH with an upstream NBD
    server.
    
    We should not send FUA with flush unless the upstream protocol
    documents what it will do, and even then, it should be something
    that the caller can opt into, rather than being unconditional.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <1459526902-32561-1-git-send-email-eblake@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    a89ef0c3
    nbd: don't request FUA on FLUSH
    Eric Blake authored
    
    
    The NBD protocol does not clearly document what will happen
    if a client sends NBD_CMD_FLAG_FUA on NBD_CMD_FLUSH.
    Historically, both the qemu and upstream NBD servers silently
    ignored that flag, but that feels a bit risky.  Meanwhile, the
    qemu NBD client unconditionally sends the flag (without even
    bothering to check whether the caller cares; at least with
    NBD_CMD_WRITE the client only sends FUA if requested by a
    higher layer).
    
    There is ongoing discussion on the NBD list to fix the
    protocol documentation to require that the server MUST ignore
    the flag (unless the kernel folks can better explain what FUA
    means for a flush), but until those doc improvements land, the
    current nbd.git master was recently changed to reject the flag
    with EINVAL (see nbd commit ab22e082), which now makes it
    impossible for a qemu client to use FLUSH with an upstream NBD
    server.
    
    We should not send FUA with flush unless the upstream protocol
    documents what it will do, and even then, it should be something
    that the caller can opt into, rather than being unconditional.
    
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    Message-Id: <1459526902-32561-1-git-send-email-eblake@redhat.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
Loading