From 807b5650dc3287252894810d1761ec171e93d307 Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Fri, 23 Feb 2024 11:02:35 -0500 Subject: [PATCH] LU-13814 clio: add io to cio_submit cp_owner is going away for transient pages, so we need to remove its usage to find the top level IO. Here that means passing the IO down through a few layers. Signed-off-by: Patrick Farrell Change-Id: I7fac0e53a7831247b846261c1c734c9d6e43a7d2 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52075 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin Reviewed-by: Sebastien Buisson --- lustre/include/cl_object.h | 1 + lustre/include/lustre_osc.h | 5 +++-- lustre/lov/lov_io.c | 2 ++ lustre/obdclass/cl_io.c | 2 +- lustre/osc/osc_io.c | 18 +++++++++--------- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lustre/include/cl_object.h b/lustre/include/cl_object.h index 281d7e3..c5f8f47 100644 --- a/lustre/include/cl_object.h +++ b/lustre/include/cl_object.h @@ -1515,6 +1515,7 @@ struct cl_io_operations { * executed on them. */ int (*cio_submit)(const struct lu_env *env, + struct cl_io *io, const struct cl_io_slice *slice, enum cl_req_type crt, struct cl_2queue *queue); /** diff --git a/lustre/include/lustre_osc.h b/lustre/include/lustre_osc.h index 29f2c19..d1a45d8 100644 --- a/lustre/include/lustre_osc.h +++ b/lustre/include/lustre_osc.h @@ -675,8 +675,9 @@ void osc_update_next_shrink(struct client_obd *cli); void osc_schedule_grant_work(void); /* osc_io.c */ -int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios, - enum cl_req_type crt, struct cl_2queue *queue); +int osc_io_submit(const struct lu_env *env, struct cl_io *io, + const struct cl_io_slice *ios, enum cl_req_type crt, + struct cl_2queue *queue); int osc_io_commit_async(const struct lu_env *env, const struct cl_io_slice *ios, struct cl_page_list *qin, int from, int to, diff --git a/lustre/lov/lov_io.c b/lustre/lov/lov_io.c index 5cca7f3..aa3c71a 100644 --- a/lustre/lov/lov_io.c +++ b/lustre/lov/lov_io.c @@ -1350,6 +1350,7 @@ static int lov_io_lru_reserve(const struct lu_env *env, * lov_device::ld_mutex mutex. */ static int lov_io_submit(const struct lu_env *env, + struct cl_io *io, const struct cl_io_slice *ios, enum cl_req_type crt, struct cl_2queue *queue) { @@ -1804,6 +1805,7 @@ static void lov_empty_io_fini(const struct lu_env *env, } static int lov_empty_io_submit(const struct lu_env *env, + struct cl_io *io, const struct cl_io_slice *ios, enum cl_req_type crt, struct cl_2queue *queue) { diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index b686e6e..8e334f0 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -655,7 +655,7 @@ int cl_io_submit_rw(const struct lu_env *env, struct cl_io *io, list_for_each_entry(scan, &io->ci_layers, cis_linkage) { if (scan->cis_iop->cio_submit == NULL) continue; - result = scan->cis_iop->cio_submit(env, scan, crt, queue); + result = scan->cis_iop->cio_submit(env, io, scan, crt, queue); if (result != 0) break; } diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index 947af47..b7e50ea 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -119,15 +119,16 @@ static int osc_io_read_ahead(const struct lu_env *env, * or, if page is already submitted, changes osc flags through * osc_set_async_flags(). */ -int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios, - enum cl_req_type crt, struct cl_2queue *queue) +int osc_io_submit(const struct lu_env *env, struct cl_io *io, + const struct cl_io_slice *ios, enum cl_req_type crt, + struct cl_2queue *queue) { struct cl_page *page; struct cl_page *tmp; + struct cl_io *top_io = cl_io_top(io); struct client_obd *cli = NULL; struct osc_object *osc = NULL; /* to keep gcc happy */ struct osc_page *opg; - struct cl_io *io; LIST_HEAD(list); struct cl_page_list *qin = &queue->c2_qin; @@ -168,9 +169,7 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios, cl_page_list_for_each_safe(page, tmp, qin) { struct osc_async_page *oap; - /* Top level IO. */ - io = page->cp_owner; - LASSERT(io != NULL); + LASSERT(top_io != NULL); opg = osc_cl_page_osc(page, osc); oap = &opg->ops_oap; @@ -183,7 +182,7 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios, break; } - result = cl_page_prep(env, io, page, crt); + result = cl_page_prep(env, top_io, page, crt); if (result != 0) { LASSERT(result < 0); if (result != -EALREADY) @@ -227,7 +226,7 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios, } if (sync_queue) { - result = osc_queue_sync_pages(env, io, osc, &list, + result = osc_queue_sync_pages(env, top_io, osc, &list, brw_flags); if (result < 0) break; @@ -237,7 +236,8 @@ int osc_io_submit(const struct lu_env *env, const struct cl_io_slice *ios, } if (queued > 0) - result = osc_queue_sync_pages(env, io, osc, &list, brw_flags); + result = osc_queue_sync_pages(env, top_io, osc, &list, + brw_flags); /* Update c/mtime for sync write. LU-7310 */ if (crt == CRT_WRITE && qout->pl_nr > 0 && result == 0) { -- 1.8.3.1