From: wanghonghui <wanghonghui at ucloud.cn>
To: spdk@lists.01.org
Subject: [SPDK] flush request error
Date: Tue, 16 Oct 2018 16:49:43 +0800 [thread overview]
Message-ID: <3de46fe8.fb40.1667c110bc9.Coremail.wanghonghui@ucloud.cn> (raw)
[-- 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;
next reply other threads:[~2018-10-16 8:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 8:49 wanghonghui [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-10-16 14:23 [SPDK] flush request error Cao, Gang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3de46fe8.fb40.1667c110bc9.Coremail.wanghonghui@ucloud.cn \
--to=spdk@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox