From: Alex Zhuravlev Date: Tue, 11 Apr 2017 07:01:23 +0000 (+0300) Subject: LU-9314 osd: cleaup qsd once commit callbacks are done X-Git-Tag: 2.9.56~6 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=74fdbc5c4f11e8ba1374c1d042267e9500be9ac3;hp=b32666d9c34c654a189786f8955afb4f691cbcd4 LU-9314 osd: cleaup qsd once commit callbacks are done otherwise osd_trans_commit_cb() calling qsd_op_end() may find qsd structure released. Change-Id: Ifd64b17d636f5e728ed6a4ad1a2d4d43998c90ec Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/26496 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Mike Pershin Reviewed-by: Oleg Drokin --- diff --git a/lustre/osd-zfs/osd_handler.c b/lustre/osd-zfs/osd_handler.c index 9c09620..e8a89a0 100644 --- a/lustre/osd-zfs/osd_handler.c +++ b/lustre/osd-zfs/osd_handler.c @@ -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);