From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khorenko Date: Tue, 25 Aug 2026 15:56:58 +0200 Subject: [Devel] [PATCH RHEL10 COMMIT] drivers/vhost/blk: fix flush support In-Reply-To: <20260825125152.259376-4-andrey.zhadchenko@virtuozzo.com> Message-ID: <202608251356.67PDuwZv803040@f0.sw.ru> List-Id: The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git after rh10-6.12.0-211.39.1.16.9.vz10 ------> commit bc3b45a6f06df2bcd7ef709f5998b10b2bdd5612 Author: Andrey Zhadchenko Date: Tue Aug 25 15:51:50 2026 +0300 drivers/vhost/blk: fix flush support REQ_OP_FLUSH is a technical flag for requests. For bios the correct combination would be REQ_OP_WRITE | REQ_PREFLUSH. See an example in blkdev_issue_flush(). https://virtuozzo.atlassian.net/browse/VSTOR-138640 Fixes: d8722ff88c5d ("drivers/vhost: vhost-blk accelerator for virtio-blk guests") Feature: vhost-blk: in-kernel accelerator for virtio-blk guests Signed-off-by: Andrey Zhadchenko Reviewed-by: Vasileios Almpanis Reviewed-by: Konstantin Khorenko --- drivers/vhost/blk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/blk.c b/drivers/vhost/blk.c index 2c41a073004bc..5c8d5b210c315 100644 --- a/drivers/vhost/blk.c +++ b/drivers/vhost/blk.c @@ -274,7 +274,7 @@ static int vhost_blk_bio_make(struct vhost_blk_req *req, sector_t sector = req->sector; unsigned long pos = 0; - if (unlikely(req->bi_opf == REQ_OP_FLUSH)) + if (unlikely(req->bi_opf & REQ_PREFLUSH)) return vhost_blk_bio_make_simple(req, bdev); if (req->bi_opf == REQ_OP_WRITE && req->len & SECTOR_MASK) { @@ -488,7 +488,7 @@ static int vhost_blk_req_handle(struct vhost_virtqueue *vq, ret = vhost_blk_req_submit(req); break; case VIRTIO_BLK_T_FLUSH: - req->bi_opf = REQ_OP_FLUSH; + req->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH; ret = vhost_blk_req_submit(req); break; case VIRTIO_BLK_T_GET_ID: