]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/nilfs2/segment.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
[karo-tx-linux.git] / fs / nilfs2 / segment.c
index a1a191634abc1729f94a443ab4eac4cdddaaf54c..7ef18fc656c28568047c30c24adb0bc029bada5c 100644 (file)
@@ -930,7 +930,7 @@ static void nilfs_drop_collected_inodes(struct list_head *head)
                if (!test_and_clear_bit(NILFS_I_COLLECTED, &ii->i_state))
                        continue;
 
-               clear_bit(NILFS_I_INODE_DIRTY, &ii->i_state);
+               clear_bit(NILFS_I_INODE_SYNC, &ii->i_state);
                set_bit(NILFS_I_UPDATED, &ii->i_state);
        }
 }
@@ -1833,6 +1833,7 @@ static void nilfs_segctor_complete_write(struct nilfs_sc_info *sci)
        nilfs_set_next_segment(nilfs, segbuf);
 
        if (update_sr) {
+               nilfs->ns_flushed_device = 0;
                nilfs_set_last_segment(nilfs, segbuf->sb_pseg_start,
                                       segbuf->sb_sum.seg_seq, nilfs->ns_cno++);
 
@@ -2194,7 +2195,7 @@ int nilfs_construct_dsync_segment(struct super_block *sb, struct inode *inode,
        nilfs_transaction_lock(sb, &ti, 0);
 
        ii = NILFS_I(inode);
-       if (test_bit(NILFS_I_INODE_DIRTY, &ii->i_state) ||
+       if (test_bit(NILFS_I_INODE_SYNC, &ii->i_state) ||
            nilfs_test_opt(nilfs, STRICT_ORDER) ||
            test_bit(NILFS_SC_UNCLOSED, &sci->sc_flags) ||
            nilfs_discontinued(nilfs)) {
@@ -2216,6 +2217,8 @@ int nilfs_construct_dsync_segment(struct super_block *sb, struct inode *inode,
        sci->sc_dsync_end = end;
 
        err = nilfs_segctor_do_construct(sci, SC_LSEG_DSYNC);
+       if (!err)
+               nilfs->ns_flushed_device = 0;
 
        nilfs_transaction_unlock(sb);
        return err;