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

Commit b67de018 authored by Joseph Qi's avatar Joseph Qi Committed by Linus Torvalds
Browse files

ocfs2/dlm: unlock lockres spinlock before dlm_lockres_put



dlm_lockres_put will call dlm_lockres_release if it is the last
reference, and then it may call dlm_print_one_lock_resource and
take lockres spinlock.

So unlock lockres spinlock before dlm_lockres_put to avoid deadlock.

Signed-off-by: default avatarJoseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.de>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bb387002
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1658,12 +1658,13 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data,
		if (ret < 0) {
			mlog(ML_ERROR, "failed to dispatch assert master work\n");
			response = DLM_MASTER_RESP_ERROR;
			spin_unlock(&res->spinlock);
			dlm_lockres_put(res);
		} else {
			dispatched = 1;
			__dlm_lockres_grab_inflight_worker(dlm, res);
		}
			spin_unlock(&res->spinlock);
		}
	} else {
		if (res)
			dlm_lockres_put(res);
+1 −1
Original line number Diff line number Diff line
@@ -1723,8 +1723,8 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data,
			} else {
				dispatched = 1;
				__dlm_lockres_grab_inflight_worker(dlm, res);
			}
				spin_unlock(&res->spinlock);
			}
		} else {
			/* put.. incase we are not the master */
			spin_unlock(&res->spinlock);