* [SPDK] flush request error
@ 2018-10-16 8:49 wanghonghui
0 siblings, 0 replies; 2+ messages in thread
From: wanghonghui @ 2018-10-16 8:49 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 1501 bytes --]
hi all:
I ran a kvm virtual machine(Linux), and this machine have a vhost spdk disk
when I use mkfs.ext4 to create a filesystem on this disk, I got a error "blk_update_request: I/O error , dev vdb, sector 0"
I test three kernel version :
4.0, 4.1(from upstream compiled by myself)
3.10.0-693(from centos7)
only 4.0 and 4.1 have this problem, 3.10.0-693 is ok
The reason is mkfs.ext4 issue some flush requests to vhost spdk disk, but spdk's process_blk_request function do not issue the VIRTIO_BLK_T_FLUSH requests to bdev
so I modify the process_blk_request function and the problem resolved:
diff --git a/lib/vhost/vhost_blk.c b/lib/vhost/vhost_blk.c
index 9e986d4..ee3c8a8 100644
--- a/lib/vhost/vhost_blk.c
+++ b/lib/vhost/vhost_blk.c
@@ -269,6 +269,14 @@ process_blk_request(struct spdk_vhost_blk_task *task, struct spdk_vhost_blk_dev
task->used_len, ' ');
blk_request_finish(true, task);
break;
+ case VIRTIO_BLK_T_FLUSH:
+ task->used_len = payload_len + sizeof(*task->status);
+ rc = spdk_bdev_flush(bvdev->bdev_desc, bvdev->bdev_io_channel, 0, 0, blk_request_complete_cb, task);
+ if (rc) {
+ invalid_blk_request(task, VIRTIO_BLK_S_IOERR);
+ return -1;
+ }
+ break;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [SPDK] flush request error
@ 2018-10-16 14:23 Cao, Gang
0 siblings, 0 replies; 2+ messages in thread
From: Cao, Gang @ 2018-10-16 14:23 UTC (permalink / raw)
To: spdk
[-- Attachment #1: Type: text/plain, Size: 1916 bytes --]
Hi Honghui,
Could you just submit a patch for this?
Thanks,
Gang
-----Original Message-----
From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of wanghonghui
Sent: Tuesday, October 16, 2018 4:50 PM
To: spdk(a)lists.01.org
Subject: [SPDK] flush request error
hi all:
I ran a kvm virtual machine(Linux), and this machine have a vhost spdk disk
when I use mkfs.ext4 to create a filesystem on this disk, I got a error "blk_update_request: I/O error , dev vdb, sector 0"
I test three kernel version :
4.0, 4.1(from upstream compiled by myself)
3.10.0-693(from centos7)
only 4.0 and 4.1 have this problem, 3.10.0-693 is ok
The reason is mkfs.ext4 issue some flush requests to vhost spdk disk, but spdk's process_blk_request function do not issue the VIRTIO_BLK_T_FLUSH requests to bdev
so I modify the process_blk_request function and the problem resolved:
diff --git a/lib/vhost/vhost_blk.c b/lib/vhost/vhost_blk.c
index 9e986d4..ee3c8a8 100644
--- a/lib/vhost/vhost_blk.c
+++ b/lib/vhost/vhost_blk.c
@@ -269,6 +269,14 @@ process_blk_request(struct spdk_vhost_blk_task *task, struct spdk_vhost_blk_dev
task->used_len, ' ');
blk_request_finish(true, task);
break;
+ case VIRTIO_BLK_T_FLUSH:
+ task->used_len = payload_len + sizeof(*task->status);
+ rc = spdk_bdev_flush(bvdev->bdev_desc, bvdev->bdev_io_channel, 0, 0, blk_request_complete_cb, task);
+ if (rc) {
+ invalid_blk_request(task, VIRTIO_BLK_S_IOERR);
+ return -1;
+ }
+ break;
_______________________________________________
SPDK mailing list
SPDK(a)lists.01.org
https://lists.01.org/mailman/listinfo/spdk
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-10-16 14:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-16 8:49 [SPDK] flush request error wanghonghui
-- strict thread matches above, loose matches on Subject: below --
2018-10-16 14:23 Cao, Gang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox