• David Chinner's avatar
    [XFS] Fix inode size update before data write in xfs_setattr · c32676ee
    David Chinner authored
    When changing the file size by a truncate() call, we log the change in the
    inode size. However, we do not flush any outstanding data that might not
    have been written to disk, thereby violating the data/inode size update
    order. This can leave files full of NULLs on crash.
    
    Hence if we are truncating the file, flush any unwritten data that may lie
    between the curret on disk inode size and the new inode size that is being
    logged to ensure that ordering is preserved.
    
    SGI-PV: 966308
    SGI-Modid: xfs-linux-melb:xfs-kern:29174a
    Signed-off-by: default avatarDavid Chinner <dgc@sgi.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@infradead.org>
    Signed-off-by: default avatarTim Shimmin <tes@sgi.com>
    c32676ee
xfs_vnodeops.c 117 KB