From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anNdA-0003h6-Nd for qemu-devel@nongnu.org; Tue, 05 Apr 2016 05:50:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anNd6-0001CO-RW for qemu-devel@nongnu.org; Tue, 05 Apr 2016 05:50:40 -0400 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]:33296) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anNd6-0001Bk-DF for qemu-devel@nongnu.org; Tue, 05 Apr 2016 05:50:36 -0400 Received: by mail-wm0-x243.google.com with SMTP id i204so2689103wmd.0 for ; Tue, 05 Apr 2016 02:50:36 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 5 Apr 2016 11:50:14 +0200 Message-Id: <1459849818-26649-12-git-send-email-pbonzini@redhat.com> In-Reply-To: <1459849818-26649-1-git-send-email-pbonzini@redhat.com> References: <1459849818-26649-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 11/15] nbd: don't request FUA on FLUSH List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini From: Eric Blake 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: Eric Blake Message-Id: <1459526902-32561-1-git-send-email-eblake@redhat.com> Signed-off-by: Paolo Bonzini --- block/nbd-client.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c index 021a88b..878e879 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -319,10 +319,6 @@ int nbd_client_co_flush(BlockDriverState *bs) return 0; } - if (client->nbdflags & NBD_FLAG_SEND_FUA) { - request.type |= NBD_CMD_FLAG_FUA; - } - request.from = 0; request.len = 0; -- 2.5.5