diff options
Diffstat (limited to 'fs/nilfs2/segment.c')
-rw-r--r-- | fs/nilfs2/segment.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 51ff3d0a4ee2..6eff66a070d5 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -2468,17 +2468,22 @@ static void nilfs_segctor_notify(struct nilfs_sc_info *sci, | |||
2468 | /* Clear requests (even when the construction failed) */ | 2468 | /* Clear requests (even when the construction failed) */ |
2469 | spin_lock(&sci->sc_state_lock); | 2469 | spin_lock(&sci->sc_state_lock); |
2470 | 2470 | ||
2471 | sci->sc_state &= ~NILFS_SEGCTOR_COMMIT; | ||
2472 | |||
2473 | if (req->mode == SC_LSEG_SR) { | 2471 | if (req->mode == SC_LSEG_SR) { |
2472 | sci->sc_state &= ~NILFS_SEGCTOR_COMMIT; | ||
2474 | sci->sc_seq_done = req->seq_accepted; | 2473 | sci->sc_seq_done = req->seq_accepted; |
2475 | nilfs_segctor_wakeup(sci, req->sc_err ? : req->sb_err); | 2474 | nilfs_segctor_wakeup(sci, req->sc_err ? : req->sb_err); |
2476 | sci->sc_flush_request = 0; | 2475 | sci->sc_flush_request = 0; |
2477 | } else if (req->mode == SC_FLUSH_FILE) | 2476 | } else { |
2478 | sci->sc_flush_request &= ~FLUSH_FILE_BIT; | 2477 | if (req->mode == SC_FLUSH_FILE) |
2479 | else if (req->mode == SC_FLUSH_DAT) | 2478 | sci->sc_flush_request &= ~FLUSH_FILE_BIT; |
2480 | sci->sc_flush_request &= ~FLUSH_DAT_BIT; | 2479 | else if (req->mode == SC_FLUSH_DAT) |
2480 | sci->sc_flush_request &= ~FLUSH_DAT_BIT; | ||
2481 | 2481 | ||
2482 | /* re-enable timer if checkpoint creation was not done */ | ||
2483 | if (sci->sc_timer && (sci->sc_state & NILFS_SEGCTOR_COMMIT) && | ||
2484 | time_before(jiffies, sci->sc_timer->expires)) | ||
2485 | add_timer(sci->sc_timer); | ||
2486 | } | ||
2482 | spin_unlock(&sci->sc_state_lock); | 2487 | spin_unlock(&sci->sc_state_lock); |
2483 | } | 2488 | } |
2484 | 2489 | ||
@@ -2501,7 +2506,8 @@ static int nilfs_segctor_construct(struct nilfs_sc_info *sci, | |||
2501 | if (test_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags) && | 2506 | if (test_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags) && |
2502 | nilfs_discontinued(nilfs)) { | 2507 | nilfs_discontinued(nilfs)) { |
2503 | down_write(&nilfs->ns_sem); | 2508 | down_write(&nilfs->ns_sem); |
2504 | req->sb_err = nilfs_commit_super(sbi, 0); | 2509 | req->sb_err = nilfs_commit_super(sbi, |
2510 | nilfs_altsb_need_update(nilfs)); | ||
2505 | up_write(&nilfs->ns_sem); | 2511 | up_write(&nilfs->ns_sem); |
2506 | } | 2512 | } |
2507 | } | 2513 | } |
@@ -2689,6 +2695,7 @@ static int nilfs_segctor_thread(void *arg) | |||
2689 | } else { | 2695 | } else { |
2690 | DEFINE_WAIT(wait); | 2696 | DEFINE_WAIT(wait); |
2691 | int should_sleep = 1; | 2697 | int should_sleep = 1; |
2698 | struct the_nilfs *nilfs; | ||
2692 | 2699 | ||
2693 | prepare_to_wait(&sci->sc_wait_daemon, &wait, | 2700 | prepare_to_wait(&sci->sc_wait_daemon, &wait, |
2694 | TASK_INTERRUPTIBLE); | 2701 | TASK_INTERRUPTIBLE); |
@@ -2709,6 +2716,9 @@ static int nilfs_segctor_thread(void *arg) | |||
2709 | finish_wait(&sci->sc_wait_daemon, &wait); | 2716 | finish_wait(&sci->sc_wait_daemon, &wait); |
2710 | timeout = ((sci->sc_state & NILFS_SEGCTOR_COMMIT) && | 2717 | timeout = ((sci->sc_state & NILFS_SEGCTOR_COMMIT) && |
2711 | time_after_eq(jiffies, sci->sc_timer->expires)); | 2718 | time_after_eq(jiffies, sci->sc_timer->expires)); |
2719 | nilfs = sci->sc_sbi->s_nilfs; | ||
2720 | if (sci->sc_super->s_dirt && nilfs_sb_need_update(nilfs)) | ||
2721 | set_nilfs_discontinued(nilfs); | ||
2712 | } | 2722 | } |
2713 | goto loop; | 2723 | goto loop; |
2714 | 2724 | ||