• Miao Xie's avatar
    Btrfs: fix wrong disk space information of the files · 3642320e
    Miao Xie authored
    Btrfsck report errors after the 83th case of xfstests was run, The error
    number is 400, it means the used disk space of the file is wrong.
    
    The reason of this bug is that:
    The file truncation may fail when the space of the file system is not enough,
    and leave some file extents, whose offset are beyond the end of the files.
    When we want to expand those files, we will drop those file extents, and
    put in dummy file extents, and then we should update the i-node. But btrfs
    forgets to do it.
    
    This patch adds the forgotten i-node update.
    Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
    Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
    3642320e
inode.c 195 KB