Whamcloud - gitweb
LU-12702 quota: wait pending write before acquiring remotely
[fs/lustre-release.git] / lustre / osd-zfs / osd_handler.c
index bca22d1..7a8bc16 100644 (file)
@@ -699,6 +699,15 @@ 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,
@@ -710,6 +719,7 @@ 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,
 };
 
 /*
@@ -1361,7 +1371,7 @@ static struct lu_device *osd_device_fini(const struct lu_env *env,
        int                rc;
        ENTRY;
 
-
+       osd_index_backup(env, o, false);
        if (o->od_os) {
                osd_objset_unregister_callbacks(o);
                if (!o->od_dt_dev.dd_rdonly) {