Commit 1cec2cde authored by Linus Torvalds's avatar Linus Torvalds

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
parents a84216e6 05b4358a
...@@ -87,6 +87,7 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr, ...@@ -87,6 +87,7 @@ int nilfs_btnode_submit_block(struct address_space *btnc, __u64 blocknr,
brelse(bh); brelse(bh);
BUG(); BUG();
} }
memset(bh->b_data, 0, 1 << inode->i_blkbits);
bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev; bh->b_bdev = NILFS_I_NILFS(inode)->ns_bdev;
bh->b_blocknr = blocknr; bh->b_blocknr = blocknr;
set_buffer_mapped(bh); set_buffer_mapped(bh);
...@@ -276,8 +277,7 @@ void nilfs_btnode_commit_change_key(struct address_space *btnc, ...@@ -276,8 +277,7 @@ void nilfs_btnode_commit_change_key(struct address_space *btnc,
"invalid oldkey %lld (newkey=%lld)", "invalid oldkey %lld (newkey=%lld)",
(unsigned long long)oldkey, (unsigned long long)oldkey,
(unsigned long long)newkey); (unsigned long long)newkey);
if (!test_set_buffer_dirty(obh) && TestSetPageDirty(opage)) nilfs_btnode_mark_dirty(obh);
BUG();
spin_lock_irq(&btnc->tree_lock); spin_lock_irq(&btnc->tree_lock);
radix_tree_delete(&btnc->page_tree, oldkey); radix_tree_delete(&btnc->page_tree, oldkey);
......
...@@ -2468,17 +2468,22 @@ static void nilfs_segctor_notify(struct nilfs_sc_info *sci, ...@@ -2468,17 +2468,22 @@ static void nilfs_segctor_notify(struct nilfs_sc_info *sci,
/* Clear requests (even when the construction failed) */ /* Clear requests (even when the construction failed) */
spin_lock(&sci->sc_state_lock); spin_lock(&sci->sc_state_lock);
sci->sc_state &= ~NILFS_SEGCTOR_COMMIT;
if (req->mode == SC_LSEG_SR) { if (req->mode == SC_LSEG_SR) {
sci->sc_state &= ~NILFS_SEGCTOR_COMMIT;
sci->sc_seq_done = req->seq_accepted; sci->sc_seq_done = req->seq_accepted;
nilfs_segctor_wakeup(sci, req->sc_err ? : req->sb_err); nilfs_segctor_wakeup(sci, req->sc_err ? : req->sb_err);
sci->sc_flush_request = 0; sci->sc_flush_request = 0;
} else if (req->mode == SC_FLUSH_FILE) } else {
sci->sc_flush_request &= ~FLUSH_FILE_BIT; if (req->mode == SC_FLUSH_FILE)
else if (req->mode == SC_FLUSH_DAT) sci->sc_flush_request &= ~FLUSH_FILE_BIT;
sci->sc_flush_request &= ~FLUSH_DAT_BIT; else if (req->mode == SC_FLUSH_DAT)
sci->sc_flush_request &= ~FLUSH_DAT_BIT;
/* re-enable timer if checkpoint creation was not done */
if (sci->sc_timer && (sci->sc_state & NILFS_SEGCTOR_COMMIT) &&
time_before(jiffies, sci->sc_timer->expires))
add_timer(sci->sc_timer);
}
spin_unlock(&sci->sc_state_lock); spin_unlock(&sci->sc_state_lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment