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

Commit b434eda6 authored by Patrick Caulfield's avatar Patrick Caulfield Committed by Steven Whitehouse
Browse files

[DLM] don't overwrite castparam if it's NULL



If the castaddr passed to the userland API is NULL then don't overwrite the
existing castparam. This allows a different thread to cancel a lock request and
the CANCEL AST gets delivered to the original thread.

bz#306391 (for RHEL4) refers.

Signed-Off-By: default avatarPatrick Caulfield <pcaulfie@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 5a60c532
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4429,6 +4429,7 @@ int dlm_user_unlock(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,

	if (lvb_in && ua->lksb.sb_lvbptr)
		memcpy(ua->lksb.sb_lvbptr, lvb_in, DLM_USER_LVB_LEN);
	if (ua_tmp->castparam)
		ua->castparam = ua_tmp->castparam;
	ua->user_lksb = ua_tmp->user_lksb;

@@ -4474,6 +4475,7 @@ int dlm_user_cancel(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
		goto out;

	ua = (struct dlm_user_args *)lkb->lkb_astparam;
	if (ua_tmp->castparam)
		ua->castparam = ua_tmp->castparam;
	ua->user_lksb = ua_tmp->user_lksb;