Only shutdown locks that were setup

Lock shutdown was crashing trying to deref a null linf on cleanup from
mont errors that happened before locks were setup.  Make sure lock
shutdown only tries to do work if the locks have been setup.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-04-12 16:56:39 -07:00
parent 45882f5a77
commit 453715a78d

View File

@@ -336,11 +336,14 @@ void scoutfs_lock_shutdown(struct super_block *sb)
DECLARE_LOCK_INFO(sb, linf);
struct held_locks *held = linf->held;
spin_lock(&held->lock);
linf->shutdown = true;
spin_unlock(&held->lock);
if (linf) {
held = linf->held;
spin_lock(&held->lock);
linf->shutdown = true;
spin_unlock(&held->lock);
wake_up(&held->waitq);
wake_up(&held->waitq);
}
}
void scoutfs_lock_destroy(struct super_block *sb)