• Jaegeuk Kim's avatar
    f2fs: do not activate auto_recovery for fallocated i_size · 26787236
    Jaegeuk Kim authored
    If a file needs to keep its i_size by fallocate, we need to turn off auto
    recovery during roll-forward recovery.
    
    This will resolve the below scenario.
    
    1. xfs_io -f /mnt/f2fs/file -c "pwrite 0 4096" -c "fsync"
    2. xfs_io -f /mnt/f2fs/file -c "falloc -k 4096 4096" -c "fsync"
    3. md5sum /mnt/f2fs/file;
    4. godown /mnt/f2fs/
    5. umount /mnt/f2fs/
    6. mount -t f2fs /dev/sdx /mnt/f2fs
    7. md5sum /mnt/f2fs/file
    Reported-by: default avatarChao Yu <chao@kernel.org>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    26787236
recovery.c 14.8 KB