Re: [PATCH] Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly

2016-12-14 Thread Liu Bo
On Thu, Dec 01, 2016 at 01:46:10PM -0800, Liu Bo wrote: > btrfs_ordered_update_i_size can be called by truncate and endio, but only > endio > takes ordered_extent which contains the completed IO. > > while truncating down a file, if there are some in-flight IOs, > btrfs_ordered_update_i_size in

[PATCH] Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly

2016-12-01 Thread Liu Bo
btrfs_ordered_update_i_size can be called by truncate and endio, but only endio takes ordered_extent which contains the completed IO. while truncating down a file, if there are some in-flight IOs, btrfs_ordered_update_i_size in endio will set disk_i_size to @orig_offset that is zero. If