Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke/nilfs2:
nilfs2: add zero-fill for new btree node buffers
nilfs2: fix irregular checkpoint creation due to data flush
nilfs2: fix dirty page accounting leak causing hang at write

+13 -8
+2 -2
fs/nilfs2/btnode.c
··· 87 87 brelse(bh); 88 88 BUG(); 89 89 } 90 + memset(bh->b_data, 0, 1 << inode->i_blkbits); 90 91 bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev; 91 92 bh->b_blocknr = blocknr; 92 93 set_buffer_mapped(bh); ··· 277 276 "invalid oldkey %lld (newkey=%lld)", 278 277 (unsigned long long)oldkey, 279 278 (unsigned long long)newkey); 280 - if (!test_set_buffer_dirty(obh) && TestSetPageDirty(opage)) 281 - BUG(); 279 + nilfs_btnode_mark_dirty(obh); 282 280 283 281 spin_lock_irq(&btnc->tree_lock); 284 282 radix_tree_delete(&btnc->page_tree, oldkey);
+11 -6
fs/nilfs2/segment.c
··· 2468 2468 /* Clear requests (even when the construction failed) */ 2469 2469 spin_lock(&sci->sc_state_lock); 2470 2470 2471 - sci->sc_state &= ~NILFS_SEGCTOR_COMMIT; 2472 - 2473 2471 if (req->mode == SC_LSEG_SR) { 2472 + sci->sc_state &= ~NILFS_SEGCTOR_COMMIT; 2474 2473 sci->sc_seq_done = req->seq_accepted; 2475 2474 nilfs_segctor_wakeup(sci, req->sc_err ? : req->sb_err); 2476 2475 sci->sc_flush_request = 0; 2477 - } else if (req->mode == SC_FLUSH_FILE) 2478 - sci->sc_flush_request &= ~FLUSH_FILE_BIT; 2479 - else if (req->mode == SC_FLUSH_DAT) 2480 - sci->sc_flush_request &= ~FLUSH_DAT_BIT; 2476 + } else { 2477 + if (req->mode == SC_FLUSH_FILE) 2478 + sci->sc_flush_request &= ~FLUSH_FILE_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 2487 spin_unlock(&sci->sc_state_lock); 2483 2488 } 2484 2489