]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix wrong disk space information of the files
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 15 Dec 2011 01:12:02 +0000 (20:12 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 15 Dec 2011 15:50:36 +0000 (10:50 -0500)
commitf62f7ea4c6b9fbe2c1608ea9925b40f95eaafaa9
tree1ae0d347b6cd2330ca99041d2234672919ebffac
parent0e6af6974ed15a0c985bb857474c4c5125d7feea
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