]> www.infradead.org Git - users/jedix/linux-maple.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>
Fri, 16 Dec 2011 19:44:21 +0000 (14:44 -0500)
commitd6885deec60078e9eceea028f1ddabe060c95616
treed98367db20c093dfeb2b13ee02b35d3b5b0fd9b2
parent153fd44bebcabfe66253d61ce3067a576448aa0a
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>
(cherry picked from commit 3642320e07444cc46327b24977d752f99706dac2)
fs/btrfs/inode.c