• Theodore Ts'o's avatar
    ext4: fix ZERO_RANGE bug hidden by flag aliasing · 9ad13547
    Theodore Ts'o authored
    commit 713e8dde upstream.
    
    We accidently aliased EXT4_EX_NOCACHE and EXT4_GET_CONVERT_UNWRITTEN
    falgs, which apparently was hiding a bug that was unmasked when this
    flag aliasing issue was addressed (see the subsequent commit).  The
    reproduction case was:
    
       fsx -N 10000 -l 500000 -r 4096 -t 4096 -w 4096 -Z -R -W /vdb/junk
    
    ... which would cause fsx to report corruption in the data file.
    
    The fix we have is a bit of an overkill, but I'd much rather be
    conservative for now, and we can optimize ZERO_RANGE_FL handling
    later.  The fact that we need to zap the extent_status cache for the
    inode is unfortunate, but correctness is far more important than
    performance.
    Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
    Cc: Namjae Jeon <namjae.jeon@samsung.com>
    Cc: Moritz Muehlenhoff <jmm@debian.org>
    Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
    9ad13547
extents.c 150 KB