Whamcloud - gitweb
LU-13100 lov: grant deadlock if same OSC in two components 95/37095/8
authorAndriy Skulysh <c17819@cray.com>
Thu, 24 Oct 2019 12:11:25 +0000 (15:11 +0300)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Feb 2021 20:13:36 +0000 (20:13 +0000)
The same osc can be involved in several components but osc layer
leaves active last used extent, so an RPC can't be sent if grants
are required from the same OST for another component.

Add cl_io_extent_release() to release active extent before
switching to the next component.

Change-Id: Idadda6eaecd1d47b78880c81e1fb7513d5be2419
Cray-bug-id: LUS-8038
Signed-off-by: Andriy Skulysh <c17819@cray.com>
Reviewed-by: Vitaly Fertman <c17818@cray.com>
Reviewed-by: Alexander Zarochentsev <c17826@cray.com>
Reviewed-by: Andrew Perepechko <c17827@cray.com>
Reviewed-on: https://review.whamcloud.com/37095
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Mike Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/cl_object.h
lustre/include/lustre_osc.h
lustre/lov/lov_io.c
lustre/mdc/mdc_dev.c
lustre/obdclass/cl_io.c
lustre/osc/osc_io.c

index 05c89eb..c5acbf9 100644 (file)
@@ -1604,6 +1604,11 @@ struct cl_io_operations {
                        struct cl_page_list *queue, int from, int to,
                        cl_commit_cbt cb);
        /**
+        * Release active extent.
+        */
+       void  (*cio_extent_release)(const struct lu_env *env,
+                                   const struct cl_io_slice *slice);
+       /**
         * Decide maximum read ahead extent
         *
         * \pre io->ci_type == CIT_READ
@@ -2415,6 +2420,7 @@ int   cl_io_submit_sync  (const struct lu_env *env, struct cl_io *io,
 int   cl_io_commit_async (const struct lu_env *env, struct cl_io *io,
                          struct cl_page_list *queue, int from, int to,
                          cl_commit_cbt cb);
+void  cl_io_extent_release (const struct lu_env *env, struct cl_io *io);
 int   cl_io_read_ahead   (const struct lu_env *env, struct cl_io *io,
                          pgoff_t start, struct cl_read_ahead *ra);
 void  cl_io_rw_advance   (const struct lu_env *env, struct cl_io *io,
index de848ae..ebce916 100644 (file)
@@ -679,6 +679,8 @@ 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,
                        cl_commit_cbt cb);
+void osc_io_extent_release(const struct lu_env *env,
+                          const struct cl_io_slice *ios);
 int osc_io_iter_init(const struct lu_env *env, const struct cl_io_slice *ios);
 void osc_io_iter_fini(const struct lu_env *env,
                      const struct cl_io_slice *ios);
index 6f561e7..3a13802 100644 (file)
@@ -1348,6 +1348,10 @@ static int lov_io_commit_async(const struct lu_env *env,
                        break;
 
                from = 0;
+
+               if (lov_comp_entry(index) !=
+                   lov_comp_entry(page->cp_lov_index))
+                       cl_io_extent_release(sub->sub_env, &sub->sub_io);
        }
 
        /* for error case, add the page back into the qin list */
index 75d44ba..24f3a27 100644 (file)
@@ -1355,6 +1355,7 @@ static struct cl_io_operations mdc_io_ops = {
        .cio_read_ahead   = mdc_io_read_ahead,
        .cio_submit       = osc_io_submit,
        .cio_commit_async = osc_io_commit_async,
+       .cio_extent_release = osc_io_extent_release,
 };
 
 int mdc_io_init(const struct lu_env *env, struct cl_object *obj,
index e7eb452..7d42ff0 100644 (file)
@@ -609,6 +609,20 @@ int cl_io_commit_async(const struct lu_env *env, struct cl_io *io,
 }
 EXPORT_SYMBOL(cl_io_commit_async);
 
+void cl_io_extent_release(const struct lu_env *env, struct cl_io *io)
+{
+       const struct cl_io_slice *scan;
+       ENTRY;
+
+       list_for_each_entry(scan, &io->ci_layers, cis_linkage) {
+               if (scan->cis_iop->cio_extent_release == NULL)
+                       continue;
+               scan->cis_iop->cio_extent_release(env, scan);
+       }
+       EXIT;
+}
+EXPORT_SYMBOL(cl_io_extent_release);
+
 /**
  * Submits a list of pages for immediate io.
  *
index 47e56a7..9f964c1 100644 (file)
@@ -373,6 +373,18 @@ int osc_io_commit_async(const struct lu_env *env,
 }
 EXPORT_SYMBOL(osc_io_commit_async);
 
+void osc_io_extent_release(const struct lu_env *env,
+                          const struct cl_io_slice *ios)
+{
+       struct osc_io *oio = cl2osc_io(env, ios);
+
+       if (oio->oi_active != NULL) {
+               osc_extent_release(env, oio->oi_active);
+               oio->oi_active = NULL;
+       }
+}
+EXPORT_SYMBOL(osc_io_extent_release);
+
 static bool osc_import_not_healthy(struct obd_import *imp)
 {
        return imp->imp_invalid || imp->imp_deactive ||
@@ -1231,7 +1243,8 @@ static const struct cl_io_operations osc_io_ops = {
        },
        .cio_read_ahead             = osc_io_read_ahead,
        .cio_submit                 = osc_io_submit,
-       .cio_commit_async           = osc_io_commit_async
+       .cio_commit_async           = osc_io_commit_async,
+       .cio_extent_release         = osc_io_extent_release
 };
 
 /*****************************************************************************