]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix truncate down when no_holes feature is enabled
authorLiu Bo <bo.li.liu@oracle.com>
Thu, 1 Dec 2016 21:43:31 +0000 (13:43 -0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 19 Jan 2017 17:02:22 +0000 (18:02 +0100)
commit9324e23e442e043b0546a9b792a18aa96364d3ac
tree20aa96d1fbc65c4149890a3db9b7071e20803cba
parent3788613831bfde37f1470ad4cca38a22dbfcd5a2
Btrfs: fix truncate down when no_holes feature is enabled

For such a file mapping,

[0-4k][hole][8k-12k]

In NO_HOLES mode, we don't have the [hole] extent any more.
Commit bf1d4ff806c7 ("Btrfs: fix shrinking truncate when the no_holes feature is enabled")
 fixed disk isize not being updated in NO_HOLES mode when data is not flushed.

However, even if data has been flushed, we can still have trouble
in updating disk isize since we updated disk isize to 'start' of
the last evicted extent.

Reviewed-by: Chris Mason <clm@fb.com>
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c