nilfs2: fix potential leak of dirty data on umount
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 31 Jan 2010 03:39:50 +0000 (12:39 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 31 Jan 2010 05:57:31 +0000 (14:57 +0900)
This fixes incorrect usage of nilfs_segctor_confirm() test function in
nilfs_segctor_destroy(); nilfs_segctor_confirm() returns zero if the
filesystem is not clean, so its use in nilfs_segctor_destroy() needs
inversion.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
fs/nilfs2/segment.c

index 17584c524486c1b732c78d181ec7fb8d61ee1989..105b508b47a8530166199edc48f7267b826e52df 100644 (file)
@@ -2829,7 +2829,7 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci)
                || sci->sc_seq_request != sci->sc_seq_done);
        spin_unlock(&sci->sc_state_lock);
 
-       if (flag || nilfs_segctor_confirm(sci))
+       if (flag || !nilfs_segctor_confirm(sci))
                nilfs_segctor_write_out(sci);
 
        WARN_ON(!list_empty(&sci->sc_copied_buffers));