From 2519bc95aabb31945d423ce95f5f840280c4adde Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Wed, 6 Nov 2019 10:55:52 +1100 Subject: [PATCH] LU-8066 lustre: drop ldebugfs_remove() ldebugfs_remove() is a wrapper around debugfs_remove_recursive() which adds two features: 1/ the pointer is tested with IS_ERR_OR_NULL before making the call 2/ the pointer is cleared after the call. The first is not needed since Linux 3.6 Commit a59d6293e537 ("debugfs: change parameter check in debugfs_remove() functions") and the "OR_NULL" part has never been needed. In many cases a pointer to a debugfs dentry is already never an error, or is NULLed as soon as the error is noticed. Only two place is an error stored (fid_request and fld_request), so we change those to never store the error. The second is only needed for a few global variables. In most other cases the structure holding the pointer will be freed in the near future, so clearing the pointer is pointless. obd_debugfs_entry is one case where I wasn't certain the NULLing the pointer was not needed. Then the debugfs_remove_recursive() call is made just before module exit, and the variable is local to the module, there is no point clearing the variable. As the extra functionality is barely needed, let's just use the standard interface, with occasional checks and clears as needed. Linux-commit b145d7865a7c ("staging: lustre: get rid of ldebugfs_remove()") Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: I68db147433273b70d6fe0957df10ed14e8e924bb Reviewed-on: https://review.whamcloud.com/36682 Tested-by: jenkins Reviewed-by: Shaun Tancheff Tested-by: Maloo Reviewed-by: Ben Evans Reviewed-by: James Simmons Reviewed-by: Petros Koutoupis Reviewed-by: Oleg Drokin --- contrib/scripts/spelling.txt | 1 + lustre/fid/fid_handler.c | 3 +-- lustre/fid/fid_request.c | 17 +++++++++-------- lustre/fld/fld_handler.c | 5 ++--- lustre/fld/fld_request.c | 17 +++++++++-------- lustre/include/lprocfs_status.h | 1 - lustre/ldlm/ldlm_pool.c | 6 ++---- lustre/ldlm/ldlm_resource.c | 25 +++++++------------------ lustre/llite/lproc_llite.c | 5 ++--- lustre/lod/lproc_lod.c | 3 +-- lustre/obdclass/lprocfs_status.c | 15 +++++---------- lustre/osp/lproc_osp.c | 8 ++++---- lustre/ptlrpc/gss/lproc_gss.c | 8 ++++---- lustre/ptlrpc/lproc_ptlrpc.c | 32 +++++++++++++++----------------- lustre/ptlrpc/nrs_crr.c | 2 +- lustre/ptlrpc/nrs_delay.c | 2 +- lustre/ptlrpc/nrs_orr.c | 4 ++-- lustre/ptlrpc/nrs_tbf.c | 2 +- lustre/ptlrpc/sec_lproc.c | 4 ++-- 19 files changed, 69 insertions(+), 91 deletions(-) diff --git a/contrib/scripts/spelling.txt b/contrib/scripts/spelling.txt index 193a73b..6883eb6 100644 --- a/contrib/scripts/spelling.txt +++ b/contrib/scripts/spelling.txt @@ -106,6 +106,7 @@ from_timer||cfs_from_timer f_dentry||f_path.dentry [^_]get_seconds||ktime_get_real_seconds GETSTRIPE||LFS getstripe +ldebugfs_remove||debugfs_remove_recursive ldlm_appetite_t||enum ldlm_appetite ldlm_cancel_flags_t||enum ldlm_cancel_flags ldlm_error_t||enum ldlm_error diff --git a/lustre/fid/fid_handler.c b/lustre/fid/fid_handler.c index 0b89847..12b708d 100644 --- a/lustre/fid/fid_handler.c +++ b/lustre/fid/fid_handler.c @@ -458,8 +458,7 @@ LU_CONTEXT_KEY_DEFINE(seq, LCT_MD_THREAD | LCT_DT_THREAD); static void seq_server_debugfs_fini(struct lu_server_seq *seq) { - if (!IS_ERR_OR_NULL(seq->lss_debugfs_entry)) - ldebugfs_remove(&seq->lss_debugfs_entry); + debugfs_remove_recursive(seq->lss_debugfs_entry); } static int seq_server_debugfs_init(struct lu_server_seq *seq) diff --git a/lustre/fid/fid_request.c b/lustre/fid/fid_request.c index 9629f4e..450d4aa 100644 --- a/lustre/fid/fid_request.c +++ b/lustre/fid/fid_request.c @@ -437,8 +437,7 @@ EXPORT_SYMBOL(seq_client_flush); static void seq_client_debugfs_fini(struct lu_client_seq *seq) { - if (!IS_ERR_OR_NULL(seq->lcs_debugfs_entry)) - ldebugfs_remove(&seq->lcs_debugfs_entry); + debugfs_remove_recursive(seq->lcs_debugfs_entry); } static int seq_client_debugfs_init(struct lu_client_seq *seq) @@ -580,16 +579,19 @@ EXPORT_SYMBOL(client_fid_fini); static int __init fid_init(void) { + struct dentry *de; #ifdef HAVE_SERVER_SUPPORT int rc = fid_server_mod_init(); if (rc) return rc; #endif - seq_debugfs_dir = ldebugfs_register(LUSTRE_SEQ_NAME, - debugfs_lustre_root, - NULL, NULL); - return PTR_ERR_OR_ZERO(seq_debugfs_dir); + de = ldebugfs_register(LUSTRE_SEQ_NAME, + debugfs_lustre_root, + NULL, NULL); + if (!IS_ERR(de)) + seq_debugfs_dir = de; + return PTR_ERR_OR_ZERO(de); } static void __exit fid_exit(void) @@ -597,8 +599,7 @@ static void __exit fid_exit(void) # ifdef HAVE_SERVER_SUPPORT fid_server_mod_exit(); # endif - if (!IS_ERR_OR_NULL(seq_debugfs_dir)) - ldebugfs_remove(&seq_debugfs_dir); + debugfs_remove_recursive(seq_debugfs_dir); } MODULE_AUTHOR("OpenSFS, Inc. "); diff --git a/lustre/fld/fld_handler.c b/lustre/fld/fld_handler.c index 42f00da..12bdcc0 100644 --- a/lustre/fld/fld_handler.c +++ b/lustre/fld/fld_handler.c @@ -402,8 +402,7 @@ EXPORT_SYMBOL(fid_is_local); static void fld_server_debugfs_fini(struct lu_server_fld *fld) { - if (!IS_ERR_OR_NULL(fld->lsf_debugfs_entry)) - ldebugfs_remove(&fld->lsf_debugfs_entry); + debugfs_remove_recursive(fld->lsf_debugfs_entry); } static int fld_server_debugfs_init(struct lu_server_fld *fld) @@ -424,7 +423,7 @@ static int fld_server_debugfs_init(struct lu_server_fld *fld) rc = ldebugfs_seq_create(fld->lsf_debugfs_entry, "fldb", 0444, &fld_debugfs_seq_fops, fld); if (rc) - ldebugfs_remove(&fld->lsf_debugfs_entry); + debugfs_remove_recursive(fld->lsf_debugfs_entry); RETURN(rc); } diff --git a/lustre/fld/fld_request.c b/lustre/fld/fld_request.c index 3dd616e..1498c70 100644 --- a/lustre/fld/fld_request.c +++ b/lustre/fld/fld_request.c @@ -247,8 +247,7 @@ static int fld_client_debugfs_init(struct lu_client_fld *fld) void fld_client_debugfs_fini(struct lu_client_fld *fld) { - if (!IS_ERR_OR_NULL(fld->lcf_debugfs_entry)) - ldebugfs_remove(&fld->lcf_debugfs_entry); + debugfs_remove_recursive(fld->lcf_debugfs_entry); } EXPORT_SYMBOL(fld_client_debugfs_fini); @@ -523,6 +522,7 @@ void fld_client_flush(struct lu_client_fld *fld) static int __init fld_init(void) { + struct dentry *de; #ifdef HAVE_SERVER_SUPPORT int rc; @@ -531,10 +531,12 @@ static int __init fld_init(void) return rc; #endif /* HAVE_SERVER_SUPPORT */ - fld_debugfs_dir = ldebugfs_register(LUSTRE_FLD_NAME, - debugfs_lustre_root, - NULL, NULL); - return PTR_ERR_OR_ZERO(fld_debugfs_dir); + de = ldebugfs_register(LUSTRE_FLD_NAME, + debugfs_lustre_root, + NULL, NULL); + if (!IS_ERR(de)) + fld_debugfs_dir = de; + return PTR_ERR_OR_ZERO(de); } static void __exit fld_exit(void) @@ -543,8 +545,7 @@ static void __exit fld_exit(void) fld_server_mod_exit(); #endif /* HAVE_SERVER_SUPPORT */ - if (!IS_ERR_OR_NULL(fld_debugfs_dir)) - ldebugfs_remove(&fld_debugfs_dir); + debugfs_remove_recursive(fld_debugfs_dir); } MODULE_AUTHOR("OpenSFS, Inc. "); diff --git a/lustre/include/lprocfs_status.h b/lustre/include/lprocfs_status.h index fd916d3..1ff0926 100644 --- a/lustre/include/lprocfs_status.h +++ b/lustre/include/lprocfs_status.h @@ -534,7 +534,6 @@ extern struct proc_dir_entry * lprocfs_register(const char *name, struct proc_dir_entry *parent, struct lprocfs_vars *list, void *data); -extern void ldebugfs_remove(struct dentry **entryp); extern void lprocfs_remove(struct proc_dir_entry **root); extern void lprocfs_remove_proc_entry(const char *name, struct proc_dir_entry *parent); diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index 9bf4dcc..95ad36b 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -872,10 +872,8 @@ static void ldlm_pool_debugfs_fini(struct ldlm_pool *pl) lprocfs_free_stats(&pl->pl_stats); pl->pl_stats = NULL; } - if (pl->pl_debugfs_entry != NULL) { - ldebugfs_remove(&pl->pl_debugfs_entry); - pl->pl_debugfs_entry = NULL; - } + debugfs_remove_recursive(pl->pl_debugfs_entry); + pl->pl_debugfs_entry = NULL; } int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns, diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 9275227..a65a75c 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -230,6 +230,7 @@ int ldlm_debugfs_setup(void) if (IS_ERR_OR_NULL(ldlm_debugfs_dir)) { CERROR("LDebugFS failed in ldlm-init\n"); rc = ldlm_debugfs_dir ? PTR_ERR(ldlm_debugfs_dir) : -ENOMEM; + ldlm_debugfs_dir = NULL; GOTO(err, rc); } @@ -240,7 +241,7 @@ int ldlm_debugfs_setup(void) CERROR("LProcFS failed in ldlm-init\n"); rc = ldlm_ns_debugfs_dir ? PTR_ERR(ldlm_ns_debugfs_dir) : -ENOMEM; - GOTO(err_type, rc); + GOTO(err, rc); } ldlm_svc_debugfs_dir = ldebugfs_register("services", @@ -250,24 +251,19 @@ int ldlm_debugfs_setup(void) CERROR("LProcFS failed in ldlm-init\n"); rc = ldlm_svc_debugfs_dir ? PTR_ERR(ldlm_svc_debugfs_dir) : -ENOMEM; - GOTO(err_ns, rc); + GOTO(err, rc); } rc = ldebugfs_add_vars(ldlm_debugfs_dir, ldlm_debugfs_list, NULL); if (rc != 0) { CERROR("LProcFS failed in ldlm-init\n"); - GOTO(err_svc, rc); + GOTO(err, rc); } RETURN(0); -err_svc: - ldebugfs_remove(&ldlm_svc_debugfs_dir); -err_ns: - ldebugfs_remove(&ldlm_ns_debugfs_dir); -err_type: - ldebugfs_remove(&ldlm_debugfs_dir); err: + debugfs_remove_recursive(ldlm_debugfs_dir); ldlm_svc_debugfs_dir = NULL; ldlm_ns_debugfs_dir = NULL; ldlm_debugfs_dir = NULL; @@ -276,14 +272,7 @@ err: void ldlm_debugfs_cleanup(void) { - if (!IS_ERR_OR_NULL(ldlm_svc_debugfs_dir)) - ldebugfs_remove(&ldlm_svc_debugfs_dir); - - if (!IS_ERR_OR_NULL(ldlm_ns_debugfs_dir)) - ldebugfs_remove(&ldlm_ns_debugfs_dir); - - if (!IS_ERR_OR_NULL(ldlm_debugfs_dir)) - ldebugfs_remove(&ldlm_debugfs_dir); + debugfs_remove_recursive(ldlm_debugfs_dir); ldlm_svc_debugfs_dir = NULL; ldlm_ns_debugfs_dir = NULL; @@ -705,7 +694,7 @@ static void ldlm_namespace_debugfs_unregister(struct ldlm_namespace *ns) CERROR("dlm namespace %s has no procfs dir?\n", ldlm_ns_name(ns)); else - ldebugfs_remove(&ns->ns_debugfs_entry); + debugfs_remove_recursive(ns->ns_debugfs_entry); if (ns->ns_stats != NULL) lprocfs_free_stats(&ns->ns_stats); diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 081316e..44502de 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -1730,7 +1730,7 @@ out_ra_stats: out_stats: lprocfs_free_stats(&sbi->ll_stats); out_debugfs: - ldebugfs_remove(&sbi->ll_debugfs_entry); + debugfs_remove_recursive(sbi->ll_debugfs_entry); RETURN(err); } @@ -1740,8 +1740,7 @@ void ll_debugfs_unregister_super(struct super_block *sb) struct lustre_sb_info *lsi = s2lsi(sb); struct ll_sb_info *sbi = ll_s2sbi(sb); - if (!IS_ERR_OR_NULL(sbi->ll_debugfs_entry)) - ldebugfs_remove(&sbi->ll_debugfs_entry); + debugfs_remove_recursive(sbi->ll_debugfs_entry); if (sbi->ll_dt_obd) sysfs_remove_link(&sbi->ll_kset.kobj, diff --git a/lustre/lod/lproc_lod.c b/lustre/lod/lproc_lod.c index d2fccda..f89b0dc 100644 --- a/lustre/lod/lproc_lod.c +++ b/lustre/lod/lproc_lod.c @@ -1052,8 +1052,7 @@ void lod_procfs_fini(struct lod_device *lod) kobject_put(lov); } - if (!IS_ERR_OR_NULL(lod->lod_debugfs)) - ldebugfs_remove(&lod->lod_debugfs); + debugfs_remove_recursive(lod->lod_debugfs); if (obd->obd_proc_entry) { lprocfs_remove(&obd->obd_proc_entry); diff --git a/lustre/obdclass/lprocfs_status.c b/lustre/obdclass/lprocfs_status.c index d9154dc..1bd4b72 100644 --- a/lustre/obdclass/lprocfs_status.c +++ b/lustre/obdclass/lprocfs_status.c @@ -207,13 +207,6 @@ lprocfs_add_vars(struct proc_dir_entry *root, struct lprocfs_vars *list, } EXPORT_SYMBOL(lprocfs_add_vars); -void ldebugfs_remove(struct dentry **entryp) -{ - debugfs_remove_recursive(*entryp); - *entryp = NULL; -} -EXPORT_SYMBOL_GPL(ldebugfs_remove); - #ifndef HAVE_REMOVE_PROC_SUBTREE /* for b=10866, global variable */ DECLARE_RWSEM(_lprocfs_lock); @@ -1242,7 +1235,9 @@ int lprocfs_obd_setup(struct obd_device *obd, bool uuid_only) CERROR("error %d setting up lprocfs for %s\n",rc,obd->obd_name); obd->obd_proc_entry = NULL; - ldebugfs_remove(&obd->obd_debugfs_entry); + debugfs_remove_recursive(obd->obd_debugfs_entry); + obd->obd_debugfs_entry = NULL; + sysfs_remove_files(&obd->obd_kset.kobj, obd->obd_attrs); obd->obd_attrs = NULL; kset_unregister(&obd->obd_kset); @@ -1269,8 +1264,8 @@ int lprocfs_obd_cleanup(struct obd_device *obd) obd->obd_proc_entry = NULL; } - if (!IS_ERR_OR_NULL(obd->obd_debugfs_entry)) - ldebugfs_remove(&obd->obd_debugfs_entry); + debugfs_remove_recursive(obd->obd_debugfs_entry); + obd->obd_debugfs_entry = NULL; /* obd device never allocated a kset */ if (!obd->obd_kset.kobj.state_initialized) diff --git a/lustre/osp/lproc_osp.c b/lustre/osp/lproc_osp.c index 75b7f07..01f122b 100644 --- a/lustre/osp/lproc_osp.c +++ b/lustre/osp/lproc_osp.c @@ -1019,13 +1019,13 @@ void osp_tunables_fini(struct osp_device *osp) kobject_put(osc); } - if (!IS_ERR_OR_NULL(osp->opd_debugfs)) - ldebugfs_remove(&osp->opd_debugfs); + debugfs_remove_recursive(osp->opd_debugfs); + osp->opd_debugfs = NULL; ptlrpc_lprocfs_unregister_obd(obd); - if (!IS_ERR_OR_NULL(obd->obd_debugfs_entry)) - ldebugfs_remove(&obd->obd_debugfs_entry); + debugfs_remove_recursive(obd->obd_debugfs_entry); + obd->obd_debugfs_entry = NULL; dt_tunables_fini(&osp->opd_dt_dev); } diff --git a/lustre/ptlrpc/gss/lproc_gss.c b/lustre/ptlrpc/gss/lproc_gss.c index 8bfdc49..b422523 100644 --- a/lustre/ptlrpc/gss/lproc_gss.c +++ b/lustre/ptlrpc/gss/lproc_gss.c @@ -211,11 +211,11 @@ static struct lprocfs_vars gss_lk_debugfs_vars[] = { void gss_exit_tunables(void) { - if (!IS_ERR_OR_NULL(gss_debugfs_dir_lk)) - ldebugfs_remove(&gss_debugfs_dir_lk); + debugfs_remove_recursive(gss_debugfs_dir_lk); + gss_debugfs_dir_lk = NULL; - if (!IS_ERR_OR_NULL(gss_debugfs_dir)) - ldebugfs_remove(&gss_debugfs_dir); + debugfs_remove_recursive(gss_debugfs_dir); + gss_debugfs_dir = NULL; if (!IS_ERR_OR_NULL(gss_lprocfs_dir)) lprocfs_remove(&gss_lprocfs_dir); diff --git a/lustre/ptlrpc/lproc_ptlrpc.c b/lustre/ptlrpc/lproc_ptlrpc.c index f2d747a..08039c2 100644 --- a/lustre/ptlrpc/lproc_ptlrpc.c +++ b/lustre/ptlrpc/lproc_ptlrpc.c @@ -258,15 +258,15 @@ ptlrpc_ldebugfs_register(struct dentry *root, char *dir, char *name, } rc = ldebugfs_register_stats(svc_debugfs_entry, name, svc_stats); - if (rc < 0) { - if (dir) - ldebugfs_remove(&svc_debugfs_entry); - lprocfs_free_stats(&svc_stats); - } else { - if (dir) + if (rc < 0) { + if (dir) + debugfs_remove_recursive(svc_debugfs_entry); + lprocfs_free_stats(&svc_stats); + } else { + if (dir) *debugfs_root_ret = svc_debugfs_entry; - *stats_ret = svc_stats; - } + *stats_ret = svc_stats; + } } static int @@ -1227,7 +1227,7 @@ void ptlrpc_ldebugfs_register_service(struct dentry *entry, ptlrpc_ldebugfs_register(entry, svc->srv_name, "stats", &svc->srv_debugfs_entry, &svc->srv_stats); - if (IS_ERR_OR_NULL(svc->srv_debugfs_entry)) + if (!svc->srv_debugfs_entry) return; ldebugfs_add_vars(svc->srv_debugfs_entry, lproc_vars, NULL); @@ -1290,11 +1290,10 @@ EXPORT_SYMBOL(ptlrpc_lprocfs_brw); void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc) { - if (!IS_ERR_OR_NULL(svc->srv_debugfs_entry)) - ldebugfs_remove(&svc->srv_debugfs_entry); + debugfs_remove_recursive(svc->srv_debugfs_entry); - if (svc->srv_stats) - lprocfs_free_stats(&svc->srv_stats); + if (svc->srv_stats) + lprocfs_free_stats(&svc->srv_stats); } void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) @@ -1304,11 +1303,10 @@ void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) */ lprocfs_obd_cleanup(obd); - if (!IS_ERR_OR_NULL(obd->obd_svc_debugfs_entry)) - ldebugfs_remove(&obd->obd_svc_debugfs_entry); + debugfs_remove_recursive(obd->obd_svc_debugfs_entry); - if (obd->obd_svc_stats) - lprocfs_free_stats(&obd->obd_svc_stats); + if (obd->obd_svc_stats) + lprocfs_free_stats(&obd->obd_svc_stats); } EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd); diff --git a/lustre/ptlrpc/nrs_crr.c b/lustre/ptlrpc/nrs_crr.c index f62728f..6d0a0be 100644 --- a/lustre/ptlrpc/nrs_crr.c +++ b/lustre/ptlrpc/nrs_crr.c @@ -792,7 +792,7 @@ static int nrs_crrn_lprocfs_init(struct ptlrpc_service *svc) { NULL } }; - if (IS_ERR_OR_NULL(svc->srv_debugfs_entry)) + if (!svc->srv_debugfs_entry) return 0; return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_crrn_lprocfs_vars, NULL); diff --git a/lustre/ptlrpc/nrs_delay.c b/lustre/ptlrpc/nrs_delay.c index 301b08c..9c1b238 100644 --- a/lustre/ptlrpc/nrs_delay.c +++ b/lustre/ptlrpc/nrs_delay.c @@ -792,7 +792,7 @@ static int nrs_delay_lprocfs_init(struct ptlrpc_service *svc) { NULL } }; - if (IS_ERR_OR_NULL(svc->srv_debugfs_entry)) + if (!svc->srv_debugfs_entry) return 0; return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_delay_lprocfs_vars, diff --git a/lustre/ptlrpc/nrs_orr.c b/lustre/ptlrpc/nrs_orr.c index 25dea5c..38e2d05 100644 --- a/lustre/ptlrpc/nrs_orr.c +++ b/lustre/ptlrpc/nrs_orr.c @@ -1876,7 +1876,7 @@ static int nrs_orr_lprocfs_init(struct ptlrpc_service *svc) { NULL } }; - if (IS_ERR_OR_NULL(svc->srv_debugfs_entry)) + if (!svc->srv_debugfs_entry) return 0; lprocfs_orr_data.svc = svc; @@ -1928,7 +1928,7 @@ static int nrs_trr_lprocfs_init(struct ptlrpc_service *svc) { NULL } }; - if (IS_ERR_OR_NULL(svc->srv_debugfs_entry)) + if (!svc->srv_debugfs_entry) return 0; lprocfs_trr_data.svc = svc; diff --git a/lustre/ptlrpc/nrs_tbf.c b/lustre/ptlrpc/nrs_tbf.c index 371c784..d5fab11 100644 --- a/lustre/ptlrpc/nrs_tbf.c +++ b/lustre/ptlrpc/nrs_tbf.c @@ -3674,7 +3674,7 @@ static int nrs_tbf_lprocfs_init(struct ptlrpc_service *svc) { NULL } }; - if (IS_ERR_OR_NULL(svc->srv_debugfs_entry)) + if (!svc->srv_debugfs_entry) return 0; return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_tbf_lprocfs_vars, diff --git a/lustre/ptlrpc/sec_lproc.c b/lustre/ptlrpc/sec_lproc.c index c320081..e3d99ac 100644 --- a/lustre/ptlrpc/sec_lproc.c +++ b/lustre/ptlrpc/sec_lproc.c @@ -289,8 +289,8 @@ int sptlrpc_lproc_init(void) void sptlrpc_lproc_fini(void) { - if (!IS_ERR_OR_NULL(sptlrpc_debugfs_dir)) - ldebugfs_remove(&sptlrpc_debugfs_dir); + debugfs_remove_recursive(sptlrpc_debugfs_dir); + sptlrpc_debugfs_dir = NULL; if (!IS_ERR_OR_NULL(sptlrpc_lprocfs_dir)) lprocfs_remove(&sptlrpc_lprocfs_dir); -- 1.8.3.1