From 74fdbc5c4f11e8ba1374c1d042267e9500be9ac3 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 11 Apr 2017 10:01:23 +0300 Subject: [PATCH 1/1] 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 --- lustre/osd-zfs/osd_handler.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); -- 1.8.3.1