• Andrew Morton's avatar
    [PATCH] Fix data loss problem due to sys_sync · 5f44f4a9
    Andrew Morton authored
    In 2.5.52 I broke sys_sync() for ext2 in subtle ways.
    
    sys_sync() will set mapping->dirtied_when non-zero against a clean inode.
    Later, in (say) __iget(), that inode gets moved over to inode_unused or
    inode_in_use.  But because it has non-zero ->dirtied_when,
    __mark_inode_dirty() thinks that the inode must still be on sb->s_dirty.
    
    But it isn't.  It's on inode_in_use.  It (and its pages) never get written
    out and the data gets thrown away on unmount.
    
    The patch ceases to use ->dirtied_when as an indicator of inode dirtiness.
    Not sure why I even did that :(
    5f44f4a9
fs-writeback.c 15.8 KB