dm: block_if: io_uring: flush the modified in-core data on demand
When `io_uring` is used, `blockif_flush_cache` is missing when an WRITE operation is completed. `blockif_flush_cache` would flush the modified in-core data to the disk device according to the setting of the cache mode. Tracked-On: #8612 Signed-off-by: Shiqing Gao <shiqing.gao@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
parent
5306d9e7db
commit
f92b0f43e6
|
@ -1120,6 +1120,7 @@ iou_process_completions(struct blockif_queue *bq)
|
|||
struct blockif_elem *be;
|
||||
struct blockif_req *br;
|
||||
struct io_uring *ring = &bq->ring;
|
||||
int err = 0;
|
||||
|
||||
while (io_uring_peek_cqe(ring, &cqes) == 0) {
|
||||
if (!cqes) {
|
||||
|
@ -1150,8 +1151,12 @@ iou_process_completions(struct blockif_queue *bq)
|
|||
blockif_deinit_bounce_iov(br);
|
||||
}
|
||||
|
||||
if (be->op == BOP_WRITE) {
|
||||
err = blockif_flush_cache(bq->bc);
|
||||
}
|
||||
|
||||
be->status = BST_DONE;
|
||||
(*br->callback)(br, 0);
|
||||
(*br->callback)(br, err);
|
||||
blockif_complete(bq, be);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue