diff options
author | Patrick Caulfield <pcaulfie@redhat.com> | 2007-10-01 10:28:42 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2007-10-10 03:56:36 -0400 |
commit | b434eda6fda5bcdcc2dd918e5ffbf7184f2d4e17 (patch) | |
tree | e1931dffbbf294fe1d087e9215ee7143517636e2 /fs/dlm/lock.c | |
parent | 5a60c532c9224babc172fafccc9e2fec6937af6f (diff) |
[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: Patrick Caulfield <pcaulfie@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/dlm/lock.c')
-rw-r--r-- | fs/dlm/lock.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 2082daf083d8..031229f144fa 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c | |||
@@ -4429,7 +4429,8 @@ int dlm_user_unlock(struct dlm_ls *ls, struct dlm_user_args *ua_tmp, | |||
4429 | 4429 | ||
4430 | if (lvb_in && ua->lksb.sb_lvbptr) | 4430 | if (lvb_in && ua->lksb.sb_lvbptr) |
4431 | memcpy(ua->lksb.sb_lvbptr, lvb_in, DLM_USER_LVB_LEN); | 4431 | memcpy(ua->lksb.sb_lvbptr, lvb_in, DLM_USER_LVB_LEN); |
4432 | ua->castparam = ua_tmp->castparam; | 4432 | if (ua_tmp->castparam) |
4433 | ua->castparam = ua_tmp->castparam; | ||
4433 | ua->user_lksb = ua_tmp->user_lksb; | 4434 | ua->user_lksb = ua_tmp->user_lksb; |
4434 | 4435 | ||
4435 | error = set_unlock_args(flags, ua, &args); | 4436 | error = set_unlock_args(flags, ua, &args); |
@@ -4474,7 +4475,8 @@ int dlm_user_cancel(struct dlm_ls *ls, struct dlm_user_args *ua_tmp, | |||
4474 | goto out; | 4475 | goto out; |
4475 | 4476 | ||
4476 | ua = (struct dlm_user_args *)lkb->lkb_astparam; | 4477 | ua = (struct dlm_user_args *)lkb->lkb_astparam; |
4477 | ua->castparam = ua_tmp->castparam; | 4478 | if (ua_tmp->castparam) |
4479 | ua->castparam = ua_tmp->castparam; | ||
4478 | ua->user_lksb = ua_tmp->user_lksb; | 4480 | ua->user_lksb = ua_tmp->user_lksb; |
4479 | 4481 | ||
4480 | error = set_unlock_args(flags, ua, &args); | 4482 | error = set_unlock_args(flags, ua, &args); |