• Jan Kara's avatar
    ext4: fix fdatasync(2) after extent manipulation operations · 99da954f
    Jan Kara authored
    commit 67a7d5f5 upstream.
    
    Currently, extent manipulation operations such as hole punch, range
    zeroing, or extent shifting do not record the fact that file data has
    changed and thus fdatasync(2) has a work to do. As a result if we crash
    e.g. after a punch hole and fdatasync, user can still possibly see the
    punched out data after journal replay. Test generic/392 fails due to
    these problems.
    
    Fix the problem by properly marking that file data has changed in these
    operations.
    
    Fixes: a4bb6b64Signed-off-by: default avatarJan Kara <jack@suse.cz>
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    [bwh: Backported to 3.2: Only the punch-hole operation is supported, and
     it's in extents.c.]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    99da954f
extents.c 137 KB