[SPDK] How to handle write zeros with Virtio umap flag ?

ssunder at xilinx.com Mon, 03 May 2021 05:43:57 +0000
Newsgroups dev.linux.lists.spdk
Message-ID <[email protected]>
Hi,

I am trying to understand the behavior of VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP folded inside Virtio write zeros request. I found a mention of this flag in vhost_blk.c, where the vhost_blk returning the error as a feature not supported. Please see the code snippet:
		/* Zeroed and Unmap the range, SPDK doen't support it. */
		if (desc->flags & VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP) {
			SPDK_NOTICELOG("Can't support Write Zeroes with Unmap flag\n");
			invalid_blk_request(task, VIRTIO_BLK_S_UNSUPP);
			return -1;
		}

I would like to understand why this is not supported in the SPDK bdev subsystem.  If it is not possible to support this request, what is the workaround I can implement to avoid returning the feature not supported in Virtio's response to a user request?