Whamcloud - gitweb
LU-14370 quota: use dt_sync() to flush pending writes 22/41322/3
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 26 Jan 2021 14:18:59 +0000 (17:18 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 6 Mar 2021 02:35:25 +0000 (02:35 +0000)
and find remaining quota.

Fixes: 18cd3e1e28 ("LU-12702 quota: wait pending write before acquiring remotely")
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I8f1ec334a1d1eefc385d8c6ef451de8a3f12365f
Reviewed-on: https://review.whamcloud.com/41322
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/dt_object.h
lustre/osd-zfs/osd_handler.c
lustre/quota/qsd_handler.c

index 0330989..5cc8b26 100644 (file)
@@ -298,17 +298,6 @@ struct dt_device_operations {
                       struct dt_device *dev);
 
        /**
-        * Wait pending quota update finish
-        *
-        * There might be a window that quota usage has been updated,
-        * but commit callback to reduce pending write have not been
-        * finished, this is used to wait all pending update done.
-        *
-        * \param[in] dev       dt device
-        */
-       void (*dt_wait_quota_pending)(struct dt_device *dev);
-
-       /**
         * Start transaction commit asynchronously.
         *
 
@@ -2731,14 +2720,6 @@ static inline int dt_ro(const struct lu_env *env, struct dt_device *dev)
         return dev->dd_ops->dt_ro(env, dev);
 }
 
-static inline void dt_wait_quota_pending(struct dt_device *dev)
-{
-       LASSERT(dev);
-       LASSERT(dev->dd_ops);
-       if (dev->dd_ops->dt_wait_quota_pending)
-               dev->dd_ops->dt_wait_quota_pending(dev);
-}
-
 static inline int dt_declare_insert(const struct lu_env *env,
                                     struct dt_object *dt,
                                     const struct dt_rec *rec,
index fe9ebc7..94dec9d 100644 (file)
@@ -699,15 +699,6 @@ static int osd_ro(const struct lu_env *env, struct dt_device *d)
        RETURN(0);
 }
 
-static void osd_wait_quota_pending(struct dt_device *d)
-{
-       struct osd_device  *o = osd_dt_dev(d);
-
-       if (o->od_quota_slave_md != NULL ||
-           o->od_quota_slave_dt != NULL)
-               txg_wait_callbacks(spa_get_dsl(dmu_objset_spa(o->od_os)));
-}
-
 static struct dt_device_operations osd_dt_ops = {
        .dt_root_get            = osd_root_get,
        .dt_statfs              = osd_statfs,
@@ -719,7 +710,6 @@ static struct dt_device_operations osd_dt_ops = {
        .dt_sync                = osd_sync,
        .dt_commit_async        = osd_commit_async,
        .dt_ro                  = osd_ro,
-       .dt_wait_quota_pending  = osd_wait_quota_pending,
 };
 
 /*
index ae770f5..c29b303 100644 (file)
@@ -662,7 +662,7 @@ again:
                 */
                if (lqe->lqe_pending_write >= space && !wait_pending) {
                        wait_pending = 1;
-                       dt_wait_quota_pending(qqi->qqi_qsd->qsd_dev);
+                       dt_sync(env, qqi->qqi_qsd->qsd_dev);
                        goto again;
                }