Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b36c3f84 authored by Sunil Mushran's avatar Sunil Mushran Committed by Mark Fasheh
Browse files

ocfs2_dlm: Add missing locks in dlm_empty_lockres



__dlm_lockres_unused() expects the caller to take the lockres spinlock.

Signed-off-by: default avatarSunil Mushran <sunil.mushran@oracle.com>
Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent 3fca0894
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2730,14 +2730,17 @@ int dlm_empty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
	int ret;
	int lock_dropped = 0;

	spin_lock(&res->spinlock);
	if (res->owner != dlm->node_num) {
		if (!__dlm_lockres_unused(res)) {
			mlog(ML_ERROR, "%s:%.*s: this node is not master, "
			     "trying to free this but locks remain\n",
			     dlm->name, res->lockname.len, res->lockname.name);
		}
		spin_unlock(&res->spinlock);
		goto leave;
	}
	spin_unlock(&res->spinlock);

	/* Wheee! Migrate lockres here! Will sleep so drop spinlock. */
	spin_unlock(&dlm->spinlock);