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

[Xen-changelog] [qemu-xen master] nbd: Allow unmap and fua during write zeroes



commit 169407e1f7c9afee1cdac0ee6ad0b8d5e361c4dd
Author:     Eric Blake <eblake@xxxxxxxxxx>
AuthorDate: Thu Nov 17 14:13:54 2016 -0600
Commit:     Paolo Bonzini <pbonzini@xxxxxxxxxx>
CommitDate: Tue Nov 22 23:26:51 2016 +0100

    nbd: Allow unmap and fua during write zeroes
    
    Commit fa778fff wired up support to send the NBD_CMD_WRITE_ZEROES,
    but forgot to inform the block layer that FUA unmapping of zeroes is
    supported.  Without BDRV_REQ_MAY_UNMAP listed as a supported flag,
    the block layer will always insist on the NBD layer passing
    NBD_CMD_FLAG_NO_HOLE, resulting in the server always allocating
    things even when it was desired to let the server punch holes.
    Similarly, failing to set BDRV_REQ_FUA means that the client may
    send unnecessary NBD_CMD_FLUSH when it could have instead used the
    NBD_CMD_FLAG_FUA bit.
    
    CC: qemu-stable@xxxxxxxxxx
    Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
    Message-Id: <1479413642-22463-2-git-send-email-eblake@xxxxxxxxxx>
    Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
---
 block/nbd-client.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/nbd-client.c b/block/nbd-client.c
index 2a302de..3779c6c 100644
--- a/block/nbd-client.c
+++ b/block/nbd-client.c
@@ -415,6 +415,10 @@ int nbd_client_init(BlockDriverState *bs,
     }
     if (client->nbdflags & NBD_FLAG_SEND_FUA) {
         bs->supported_write_flags = BDRV_REQ_FUA;
+        bs->supported_zero_flags |= BDRV_REQ_FUA;
+    }
+    if (client->nbdflags & NBD_FLAG_SEND_WRITE_ZEROES) {
+        bs->supported_zero_flags |= BDRV_REQ_MAY_UNMAP;
     }
 
     qemu_co_mutex_init(&client->send_mutex);
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.