scoutfs: only release lockspace/workqueues in lock_destroy if they exist

Mount failure means these might be NULL.

Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
Mark Fasheh
2017-06-28 13:28:40 -05:00
parent 19f6f40fee
commit 136cbbed29

View File

@@ -560,12 +560,15 @@ void scoutfs_lock_destroy(struct super_block *sb)
int ret;
if (linfo) {
destroy_workqueue(linfo->downconvert_wq);
if (linfo->downconvert_wq)
destroy_workqueue(linfo->downconvert_wq);
unregister_shrinker(&linfo->shrinker);
ret = dlm_release_lockspace(linfo->ls, 2);
if (ret)
scoutfs_info(sb, "Error %d releasing lockspace %s\n",
ret, linfo->ls_name);
if (linfo->ls) {
ret = dlm_release_lockspace(linfo->ls, 2);
if (ret)
scoutfs_info(sb, "Error %d releasing lockspace %s\n",
ret, linfo->ls_name);
}
free_lock_tree(sb);