From: Patrick Farrell Date: Wed, 23 Aug 2023 22:46:53 +0000 (-0400) Subject: LU-13814 clio: Improve cl_io_submit_sync comments X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F73%2F52073%2F12;p=fs%2Flustre-release.git LU-13814 clio: Improve cl_io_submit_sync comments Add notes on what cl_io_submit_sync is for. Test-Parameters: forjanitoronly Test-Parameters: fortestonly Signed-off-by: Patrick Farrell Change-Id: I5e32f1a7e6893b63d82f14848a865f90d30fb079 --- diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index 62f3f74..d1ddd56 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; }