From 0dcef9da8a0229421717efb3caace27e6a32c588 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Wed, 23 Aug 2023 18:46:53 -0400 Subject: [PATCH] LU-13814 clio: Improve cl_io_submit_sync comments Add notes on what cl_io_submit_sync is for. Test-Parameters: trivial Signed-off-by: Patrick Farrell Change-Id: I5e32f1a7e6893b63d82f14848a865f90d30fb079 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52073 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Sebastien Buisson Reviewed-by: Andreas Dilger --- lustre/obdclass/cl_io.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index 94e6bc8..ef674ae 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -670,6 +670,9 @@ EXPORT_SYMBOL(cl_io_submit_rw); /** * Submit a sync_io and wait for the IO to be finished, or error happens. * If \a timeout is zero, it means to wait for the IO unconditionally. + * + * This is used for synchronous submission of an async IO, so the waiting is + * done here in this function and the IO is done when this function returns. */ int cl_io_submit_sync(const struct lu_env *env, struct cl_io *io, enum cl_req_type iot, struct cl_2queue *queue, @@ -682,6 +685,10 @@ int cl_io_submit_sync(const struct lu_env *env, struct cl_io *io, cl_page_list_for_each(pg, &queue->c2_qin) { LASSERT(pg->cp_sync_io == NULL); + /* this is for sync submission of async IO, IO that was always + * sync (like DIO) is handled differently + */ + LASSERT(pg->cp_type != CPT_TRANSIENT); pg->cp_sync_io = anchor; } -- 1.8.3.1