Whamcloud - gitweb
LU-9314 osd: cleaup qsd once commit callbacks are done 96/26496/4
authorAlex Zhuravlev <alexey.zhuravlev@intel.com>
Tue, 11 Apr 2017 07:01:23 +0000 (10:01 +0300)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Apr 2017 04:48:08 +0000 (04:48 +0000)
otherwise osd_trans_commit_cb() calling qsd_op_end() may
find qsd structure released.

Change-Id: Ifd64b17d636f5e728ed6a4ad1a2d4d43998c90ec
Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-on: https://review.whamcloud.com/26496
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/osd-zfs/osd_handler.c

index 9c09620..e8a89a0 100644 (file)
@@ -746,6 +746,9 @@ static int osd_shutdown(const struct lu_env *env, struct osd_device *o)
 
        /* shutdown quota slave instance associated with the device */
        if (o->od_quota_slave != NULL) {
+               /* complete all in-flight callbacks */
+               osd_sync(env, &o->od_dt_dev);
+               txg_wait_callbacks(spa_get_dsl(dmu_objset_spa(o->od_os)));
                qsd_fini(env, o->od_quota_slave);
                o->od_quota_slave = NULL;
        }
@@ -1204,9 +1207,6 @@ static struct lu_device *osd_device_fini(const struct lu_env *env,
        ENTRY;
 
 
-       osd_shutdown(env, o);
-       osd_oi_fini(env, o);
-
        if (o->od_os) {
                osd_objset_unregister_callbacks(o);
                if (!o->od_dt_dev.dd_rdonly) {
@@ -1216,6 +1216,10 @@ static struct lu_device *osd_device_fini(const struct lu_env *env,
                }
        }
 
+       /* now with all the callbacks completed we can cleanup the remainings */
+       osd_shutdown(env, o);
+       osd_oi_fini(env, o);
+
        rc = osd_procfs_fini(o);
        if (rc) {
                CERROR("proc fini error %d\n", rc);