Message ID | 20250321004758.152572-1-ming.lei@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | selftests: ublk: fix write cache implementation | expand |
Context | Check | Description |
---|---|---|
shin/vmtest-for-next-VM_Test-0 | success | Logs for build-kernel |
shin/vmtest-for-next-VM_Test-2 | success | Logs for run-tests-on-kernel |
shin/vmtest-for-next-VM_Test-1 | fail | Logs for build-kernel |
shin/vmtest-for-next-PR | success | PR summary |
On Fri, 21 Mar 2025 08:47:58 +0800, Ming Lei wrote: > For loop target, write cache isn't enabled, and each write isn't be > marked as DSYNC too. > > Fix it by enabling write cache, meantime fix FLUSH implementation > by not taking LBA range into account, and there isn't such info > for FLUSH command. > > [...] Applied, thanks! [1/1] selftests: ublk: fix write cache implementation commit: 96af5af47b5407972689929543c73a39b477c8ba Best regards,
diff --git a/tools/testing/selftests/ublk/file_backed.c b/tools/testing/selftests/ublk/file_backed.c index 38e68b414962..8a07356eccaf 100644 --- a/tools/testing/selftests/ublk/file_backed.c +++ b/tools/testing/selftests/ublk/file_backed.c @@ -123,10 +123,7 @@ static int loop_queue_tgt_io(struct ublk_queue *q, int tag) sqe = ublk_queue_alloc_sqe(q); if (!sqe) return -ENOMEM; - io_uring_prep_sync_file_range(sqe, 1 /*fds[1]*/, - iod->nr_sectors << 9, - iod->start_sector << 9, - IORING_FSYNC_DATASYNC); + io_uring_prep_fsync(sqe, 1 /*fds[1]*/, IORING_FSYNC_DATASYNC); io_uring_sqe_set_flags(sqe, IOSQE_FIXED_FILE); q->io_inflight++; sqe->user_data = build_user_data(tag, ublk_op, UBLK_IO_TGT_NORMAL, 1); @@ -187,6 +184,7 @@ static int ublk_loop_tgt_init(struct ublk_dev *dev) struct ublk_params p = { .types = UBLK_PARAM_TYPE_BASIC | UBLK_PARAM_TYPE_DMA_ALIGN, .basic = { + .attrs = UBLK_ATTR_VOLATILE_CACHE, .logical_bs_shift = 9, .physical_bs_shift = 12, .io_opt_shift = 12,
For loop target, write cache isn't enabled, and each write isn't be marked as DSYNC too. Fix it by enabling write cache, meantime fix FLUSH implementation by not taking LBA range into account, and there isn't such info for FLUSH command. Signed-off-by: Ming Lei <ming.lei@redhat.com> --- tools/testing/selftests/ublk/file_backed.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)