diff options
Diffstat (limited to 'fs/dlm/lock.c')
-rw-r--r-- | fs/dlm/lock.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 2a28048252ed..75176b58ae04 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c | |||
@@ -4273,12 +4273,12 @@ static int receive_rcom_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb, | |||
4273 | int lvblen; | 4273 | int lvblen; |
4274 | 4274 | ||
4275 | lkb->lkb_nodeid = rc->rc_header.h_nodeid; | 4275 | lkb->lkb_nodeid = rc->rc_header.h_nodeid; |
4276 | lkb->lkb_ownpid = rl->rl_ownpid; | 4276 | lkb->lkb_ownpid = le32_to_cpu(rl->rl_ownpid); |
4277 | lkb->lkb_remid = rl->rl_lkid; | 4277 | lkb->lkb_remid = le32_to_cpu(rl->rl_lkid); |
4278 | lkb->lkb_exflags = rl->rl_exflags; | 4278 | lkb->lkb_exflags = le32_to_cpu(rl->rl_exflags); |
4279 | lkb->lkb_flags = rl->rl_flags & 0x0000FFFF; | 4279 | lkb->lkb_flags = le32_to_cpu(rl->rl_flags) & 0x0000FFFF; |
4280 | lkb->lkb_flags |= DLM_IFL_MSTCPY; | 4280 | lkb->lkb_flags |= DLM_IFL_MSTCPY; |
4281 | lkb->lkb_lvbseq = rl->rl_lvbseq; | 4281 | lkb->lkb_lvbseq = le32_to_cpu(rl->rl_lvbseq); |
4282 | lkb->lkb_rqmode = rl->rl_rqmode; | 4282 | lkb->lkb_rqmode = rl->rl_rqmode; |
4283 | lkb->lkb_grmode = rl->rl_grmode; | 4283 | lkb->lkb_grmode = rl->rl_grmode; |
4284 | /* don't set lkb_status because add_lkb wants to itself */ | 4284 | /* don't set lkb_status because add_lkb wants to itself */ |
@@ -4299,7 +4299,8 @@ static int receive_rcom_lock_args(struct dlm_ls *ls, struct dlm_lkb *lkb, | |||
4299 | The real granted mode of these converting locks cannot be determined | 4299 | The real granted mode of these converting locks cannot be determined |
4300 | until all locks have been rebuilt on the rsb (recover_conversion) */ | 4300 | until all locks have been rebuilt on the rsb (recover_conversion) */ |
4301 | 4301 | ||
4302 | if (rl->rl_wait_type == DLM_MSG_CONVERT && middle_conversion(lkb)) { | 4302 | if (rl->rl_wait_type == cpu_to_le16(DLM_MSG_CONVERT) && |
4303 | middle_conversion(lkb)) { | ||
4303 | rl->rl_status = DLM_LKSTS_CONVERT; | 4304 | rl->rl_status = DLM_LKSTS_CONVERT; |
4304 | lkb->lkb_grmode = DLM_LOCK_IV; | 4305 | lkb->lkb_grmode = DLM_LOCK_IV; |
4305 | rsb_set_flag(r, RSB_RECOVER_CONVERT); | 4306 | rsb_set_flag(r, RSB_RECOVER_CONVERT); |
@@ -4326,13 +4327,14 @@ int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc) | |||
4326 | goto out; | 4327 | goto out; |
4327 | } | 4328 | } |
4328 | 4329 | ||
4329 | error = find_rsb(ls, rl->rl_name, rl->rl_namelen, R_MASTER, &r); | 4330 | error = find_rsb(ls, rl->rl_name, le16_to_cpu(rl->rl_namelen), |
4331 | R_MASTER, &r); | ||
4330 | if (error) | 4332 | if (error) |
4331 | goto out; | 4333 | goto out; |
4332 | 4334 | ||
4333 | lock_rsb(r); | 4335 | lock_rsb(r); |
4334 | 4336 | ||
4335 | lkb = search_remid(r, rc->rc_header.h_nodeid, rl->rl_lkid); | 4337 | lkb = search_remid(r, rc->rc_header.h_nodeid, le32_to_cpu(rl->rl_lkid)); |
4336 | if (lkb) { | 4338 | if (lkb) { |
4337 | error = -EEXIST; | 4339 | error = -EEXIST; |
4338 | goto out_remid; | 4340 | goto out_remid; |
@@ -4355,15 +4357,16 @@ int dlm_recover_master_copy(struct dlm_ls *ls, struct dlm_rcom *rc) | |||
4355 | out_remid: | 4357 | out_remid: |
4356 | /* this is the new value returned to the lock holder for | 4358 | /* this is the new value returned to the lock holder for |
4357 | saving in its process-copy lkb */ | 4359 | saving in its process-copy lkb */ |
4358 | rl->rl_remid = lkb->lkb_id; | 4360 | rl->rl_remid = cpu_to_le32(lkb->lkb_id); |
4359 | 4361 | ||
4360 | out_unlock: | 4362 | out_unlock: |
4361 | unlock_rsb(r); | 4363 | unlock_rsb(r); |
4362 | put_rsb(r); | 4364 | put_rsb(r); |
4363 | out: | 4365 | out: |
4364 | if (error) | 4366 | if (error) |
4365 | log_debug(ls, "recover_master_copy %d %x", error, rl->rl_lkid); | 4367 | log_debug(ls, "recover_master_copy %d %x", error, |
4366 | rl->rl_result = error; | 4368 | le32_to_cpu(rl->rl_lkid)); |
4369 | rl->rl_result = cpu_to_le32(error); | ||
4367 | return error; | 4370 | return error; |
4368 | } | 4371 | } |
4369 | 4372 | ||
@@ -4374,15 +4377,16 @@ int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc) | |||
4374 | struct dlm_lkb *lkb; | 4377 | struct dlm_lkb *lkb; |
4375 | int error; | 4378 | int error; |
4376 | 4379 | ||
4377 | error = find_lkb(ls, rl->rl_lkid, &lkb); | 4380 | error = find_lkb(ls, le32_to_cpu(rl->rl_lkid), &lkb); |
4378 | if (error) { | 4381 | if (error) { |
4379 | log_error(ls, "recover_process_copy no lkid %x", rl->rl_lkid); | 4382 | log_error(ls, "recover_process_copy no lkid %x", |
4383 | le32_to_cpu(rl->rl_lkid)); | ||
4380 | return error; | 4384 | return error; |
4381 | } | 4385 | } |
4382 | 4386 | ||
4383 | DLM_ASSERT(is_process_copy(lkb), dlm_print_lkb(lkb);); | 4387 | DLM_ASSERT(is_process_copy(lkb), dlm_print_lkb(lkb);); |
4384 | 4388 | ||
4385 | error = rl->rl_result; | 4389 | error = le32_to_cpu(rl->rl_result); |
4386 | 4390 | ||
4387 | r = lkb->lkb_resource; | 4391 | r = lkb->lkb_resource; |
4388 | hold_rsb(r); | 4392 | hold_rsb(r); |
@@ -4401,7 +4405,7 @@ int dlm_recover_process_copy(struct dlm_ls *ls, struct dlm_rcom *rc) | |||
4401 | log_debug(ls, "master copy exists %x", lkb->lkb_id); | 4405 | log_debug(ls, "master copy exists %x", lkb->lkb_id); |
4402 | /* fall through */ | 4406 | /* fall through */ |
4403 | case 0: | 4407 | case 0: |
4404 | lkb->lkb_remid = rl->rl_remid; | 4408 | lkb->lkb_remid = le32_to_cpu(rl->rl_remid); |
4405 | break; | 4409 | break; |
4406 | default: | 4410 | default: |
4407 | log_error(ls, "dlm_recover_process_copy unknown error %d %x", | 4411 | log_error(ls, "dlm_recover_process_copy unknown error %d %x", |