diff options
Diffstat (limited to 'fs/nilfs2/segment.c')
-rw-r--r-- | fs/nilfs2/segment.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 8b5e4778cf28..683df89dbae5 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -1859,12 +1859,26 @@ static void nilfs_end_page_io(struct page *page, int err) | |||
1859 | if (!page) | 1859 | if (!page) |
1860 | return; | 1860 | return; |
1861 | 1861 | ||
1862 | if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page)) | 1862 | if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page)) { |
1863 | /* | 1863 | /* |
1864 | * For b-tree node pages, this function may be called twice | 1864 | * For b-tree node pages, this function may be called twice |
1865 | * or more because they might be split in a segment. | 1865 | * or more because they might be split in a segment. |
1866 | */ | 1866 | */ |
1867 | if (PageDirty(page)) { | ||
1868 | /* | ||
1869 | * For pages holding split b-tree node buffers, dirty | ||
1870 | * flag on the buffers may be cleared discretely. | ||
1871 | * In that case, the page is once redirtied for | ||
1872 | * remaining buffers, and it must be cancelled if | ||
1873 | * all the buffers get cleaned later. | ||
1874 | */ | ||
1875 | lock_page(page); | ||
1876 | if (nilfs_page_buffers_clean(page)) | ||
1877 | __nilfs_clear_page_dirty(page); | ||
1878 | unlock_page(page); | ||
1879 | } | ||
1867 | return; | 1880 | return; |
1881 | } | ||
1868 | 1882 | ||
1869 | __nilfs_end_page_io(page, err); | 1883 | __nilfs_end_page_io(page, err); |
1870 | } | 1884 | } |
@@ -2487,7 +2501,8 @@ static int nilfs_segctor_construct(struct nilfs_sc_info *sci, | |||
2487 | if (test_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags) && | 2501 | if (test_bit(NILFS_SC_SUPER_ROOT, &sci->sc_flags) && |
2488 | nilfs_discontinued(nilfs)) { | 2502 | nilfs_discontinued(nilfs)) { |
2489 | down_write(&nilfs->ns_sem); | 2503 | down_write(&nilfs->ns_sem); |
2490 | req->sb_err = nilfs_commit_super(sbi, 0); | 2504 | req->sb_err = nilfs_commit_super(sbi, |
2505 | nilfs_altsb_need_update(nilfs)); | ||
2491 | up_write(&nilfs->ns_sem); | 2506 | up_write(&nilfs->ns_sem); |
2492 | } | 2507 | } |
2493 | } | 2508 | } |
@@ -2675,6 +2690,7 @@ static int nilfs_segctor_thread(void *arg) | |||
2675 | } else { | 2690 | } else { |
2676 | DEFINE_WAIT(wait); | 2691 | DEFINE_WAIT(wait); |
2677 | int should_sleep = 1; | 2692 | int should_sleep = 1; |
2693 | struct the_nilfs *nilfs; | ||
2678 | 2694 | ||
2679 | prepare_to_wait(&sci->sc_wait_daemon, &wait, | 2695 | prepare_to_wait(&sci->sc_wait_daemon, &wait, |
2680 | TASK_INTERRUPTIBLE); | 2696 | TASK_INTERRUPTIBLE); |
@@ -2695,6 +2711,9 @@ static int nilfs_segctor_thread(void *arg) | |||
2695 | finish_wait(&sci->sc_wait_daemon, &wait); | 2711 | finish_wait(&sci->sc_wait_daemon, &wait); |
2696 | timeout = ((sci->sc_state & NILFS_SEGCTOR_COMMIT) && | 2712 | timeout = ((sci->sc_state & NILFS_SEGCTOR_COMMIT) && |
2697 | time_after_eq(jiffies, sci->sc_timer->expires)); | 2713 | time_after_eq(jiffies, sci->sc_timer->expires)); |
2714 | nilfs = sci->sc_sbi->s_nilfs; | ||
2715 | if (sci->sc_super->s_dirt && nilfs_sb_need_update(nilfs)) | ||
2716 | set_nilfs_discontinued(nilfs); | ||
2698 | } | 2717 | } |
2699 | goto loop; | 2718 | goto loop; |
2700 | 2719 | ||