• Jan Kara's avatar
    ext3: Fix data corruption in inodes with journalled data · b22570d9
    Jan Kara authored
    When journalling data for an inode (either because it is a symlink or
    because the filesystem is mounted in data=journal mode), ext3_evict_inode()
    can discard unwritten data by calling truncate_inode_pages(). This is
    because we don't mark the buffer / page dirty when journalling data but only
    add the buffer to the running transaction and thus mm does not know there
    are still unwritten data.
    
    Fix the problem by carefully tracking transaction containing inode's data,
    committing this transaction, and writing uncheckpointed buffers when inode
    should be reaped.
    Signed-off-by: default avatarJan Kara <jack@suse.cz>
    b22570d9
inode.c 105 KB