Btrfs: fix wrong disk space information of the files
commit3642320e07444cc46327b24977d752f99706dac2
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 15 Dec 2011 01:12:02 +0000 (14 20:12 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 15 Dec 2011 15:50:36 +0000 (15 10:50 -0500)
tree1ae0d347b6cd2330ca99041d2234672919ebffac
parentf4a2f4c548296168832ad4ab7e7f7b0cd0bf1214
Btrfs: fix wrong disk space information of the files

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: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/inode.c