Commit 32f105a1 authored by David Teigland's avatar David Teigland Committed by Steven Whitehouse

[DLM] down conversion clearing flags

The down-conversion optimization was resulting in the lkb flags being
cleared because the stub message reply had no flags value set.  Copy the
current flags into the stub message so they'll be copied back into the lkb
as part of processing the fake reply.  Also add an assertion to catch this
error more directly if it exists elsewhere.
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent c059f70e
...@@ -38,6 +38,7 @@ void dlm_add_ast(struct dlm_lkb *lkb, int type) ...@@ -38,6 +38,7 @@ void dlm_add_ast(struct dlm_lkb *lkb, int type)
dlm_user_add_ast(lkb, type); dlm_user_add_ast(lkb, type);
return; return;
} }
DLM_ASSERT(lkb->lkb_astaddr != DLM_FAKE_USER_AST, dlm_print_lkb(lkb););
spin_lock(&ast_queue_lock); spin_lock(&ast_queue_lock);
if (!(lkb->lkb_ast_type & (AST_COMP | AST_BAST))) { if (!(lkb->lkb_ast_type & (AST_COMP | AST_BAST))) {
......
...@@ -91,6 +91,8 @@ struct dlm_mhandle; ...@@ -91,6 +91,8 @@ struct dlm_mhandle;
} \ } \
} }
#define DLM_FAKE_USER_AST ERR_PTR(-EINVAL)
struct dlm_direntry { struct dlm_direntry {
struct list_head list; struct list_head list;
......
...@@ -86,8 +86,6 @@ static void __receive_convert_reply(struct dlm_rsb *r, struct dlm_lkb *lkb, ...@@ -86,8 +86,6 @@ static void __receive_convert_reply(struct dlm_rsb *r, struct dlm_lkb *lkb,
struct dlm_message *ms); struct dlm_message *ms);
static int receive_extralen(struct dlm_message *ms); static int receive_extralen(struct dlm_message *ms);
#define FAKE_USER_AST (void*)0xff00ff00
/* /*
* Lock compatibilty matrix - thanks Steve * Lock compatibilty matrix - thanks Steve
* UN = Unlocked state. Not really a state, used as a flag * UN = Unlocked state. Not really a state, used as a flag
...@@ -2195,6 +2193,7 @@ static int send_convert(struct dlm_rsb *r, struct dlm_lkb *lkb) ...@@ -2195,6 +2193,7 @@ static int send_convert(struct dlm_rsb *r, struct dlm_lkb *lkb)
if (!error && down_conversion(lkb)) { if (!error && down_conversion(lkb)) {
remove_from_waiters(lkb); remove_from_waiters(lkb);
r->res_ls->ls_stub_ms.m_result = 0; r->res_ls->ls_stub_ms.m_result = 0;
r->res_ls->ls_stub_ms.m_flags = lkb->lkb_flags;
__receive_convert_reply(r, lkb, &r->res_ls->ls_stub_ms); __receive_convert_reply(r, lkb, &r->res_ls->ls_stub_ms);
} }
...@@ -3615,7 +3614,7 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua, ...@@ -3615,7 +3614,7 @@ int dlm_user_request(struct dlm_ls *ls, struct dlm_user_args *ua,
lock and that lkb_astparam is the dlm_user_args structure. */ lock and that lkb_astparam is the dlm_user_args structure. */
error = set_lock_args(mode, &ua->lksb, flags, namelen, parent_lkid, error = set_lock_args(mode, &ua->lksb, flags, namelen, parent_lkid,
FAKE_USER_AST, ua, FAKE_USER_AST, &args); DLM_FAKE_USER_AST, ua, DLM_FAKE_USER_AST, &args);
lkb->lkb_flags |= DLM_IFL_USER; lkb->lkb_flags |= DLM_IFL_USER;
ua->old_mode = DLM_LOCK_IV; ua->old_mode = DLM_LOCK_IV;
...@@ -3686,8 +3685,8 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp, ...@@ -3686,8 +3685,8 @@ int dlm_user_convert(struct dlm_ls *ls, struct dlm_user_args *ua_tmp,
ua->user_lksb = ua_tmp->user_lksb; ua->user_lksb = ua_tmp->user_lksb;
ua->old_mode = lkb->lkb_grmode; ua->old_mode = lkb->lkb_grmode;
error = set_lock_args(mode, &ua->lksb, flags, 0, 0, FAKE_USER_AST, ua, error = set_lock_args(mode, &ua->lksb, flags, 0, 0, DLM_FAKE_USER_AST,
FAKE_USER_AST, &args); ua, DLM_FAKE_USER_AST, &args);
if (error) if (error)
goto out_put; goto out_put;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment