diff options
Diffstat (limited to 'fs/gfs2/recovery.c')
-rw-r--r-- | fs/gfs2/recovery.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index f7f89a94a5a4..f2a02edcac8f 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c | |||
@@ -455,11 +455,13 @@ void gfs2_recover_func(struct work_struct *work) | |||
455 | int ro = 0; | 455 | int ro = 0; |
456 | unsigned int pass; | 456 | unsigned int pass; |
457 | int error; | 457 | int error; |
458 | int jlocked = 0; | ||
458 | 459 | ||
459 | if (jd->jd_jid != sdp->sd_lockstruct.ls_jid) { | 460 | if (sdp->sd_args.ar_spectator || |
461 | (jd->jd_jid != sdp->sd_lockstruct.ls_jid)) { | ||
460 | fs_info(sdp, "jid=%u: Trying to acquire journal lock...\n", | 462 | fs_info(sdp, "jid=%u: Trying to acquire journal lock...\n", |
461 | jd->jd_jid); | 463 | jd->jd_jid); |
462 | 464 | jlocked = 1; | |
463 | /* Acquire the journal lock so we can do recovery */ | 465 | /* Acquire the journal lock so we can do recovery */ |
464 | 466 | ||
465 | error = gfs2_glock_nq_num(sdp, jd->jd_jid, &gfs2_journal_glops, | 467 | error = gfs2_glock_nq_num(sdp, jd->jd_jid, &gfs2_journal_glops, |
@@ -554,13 +556,12 @@ void gfs2_recover_func(struct work_struct *work) | |||
554 | jd->jd_jid, t); | 556 | jd->jd_jid, t); |
555 | } | 557 | } |
556 | 558 | ||
557 | if (jd->jd_jid != sdp->sd_lockstruct.ls_jid) | ||
558 | gfs2_glock_dq_uninit(&ji_gh); | ||
559 | |||
560 | gfs2_recovery_done(sdp, jd->jd_jid, LM_RD_SUCCESS); | 559 | gfs2_recovery_done(sdp, jd->jd_jid, LM_RD_SUCCESS); |
561 | 560 | ||
562 | if (jd->jd_jid != sdp->sd_lockstruct.ls_jid) | 561 | if (jlocked) { |
562 | gfs2_glock_dq_uninit(&ji_gh); | ||
563 | gfs2_glock_dq_uninit(&j_gh); | 563 | gfs2_glock_dq_uninit(&j_gh); |
564 | } | ||
564 | 565 | ||
565 | fs_info(sdp, "jid=%u: Done\n", jd->jd_jid); | 566 | fs_info(sdp, "jid=%u: Done\n", jd->jd_jid); |
566 | goto done; | 567 | goto done; |
@@ -568,7 +569,7 @@ void gfs2_recover_func(struct work_struct *work) | |||
568 | fail_gunlock_tr: | 569 | fail_gunlock_tr: |
569 | gfs2_glock_dq_uninit(&t_gh); | 570 | gfs2_glock_dq_uninit(&t_gh); |
570 | fail_gunlock_ji: | 571 | fail_gunlock_ji: |
571 | if (jd->jd_jid != sdp->sd_lockstruct.ls_jid) { | 572 | if (jlocked) { |
572 | gfs2_glock_dq_uninit(&ji_gh); | 573 | gfs2_glock_dq_uninit(&ji_gh); |
573 | fail_gunlock_j: | 574 | fail_gunlock_j: |
574 | gfs2_glock_dq_uninit(&j_gh); | 575 | gfs2_glock_dq_uninit(&j_gh); |