Liu Bo
19fd2df5b1
Btrfs: fix btrfs_ordered_update_i_size to update disk_i_size properly
...
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 truncating-down fails somehow, we try to
recover in memory isize with this zero'd disk_i_size.
Fix it by only updating disk_i_size with @orig_offset when
btrfs_ordered_update_i_size is not called from endio while truncating
down and waiting for in-flight IOs completing their work before recover
in-memory size.
Besides fixing the above issue, add an assertion for last_size to double
check we truncate down to the desired size.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com >
Signed-off-by: David Sterba <dsterba@suse.com >
2017-02-14 15:50:57 +01:00
..
2016-12-24 11:46:01 -08:00
2016-10-10 20:16:43 -07:00
2016-12-09 16:45:04 +01:00
2016-12-24 11:46:01 -08:00
2016-12-17 19:16:12 -08:00
2016-12-22 11:25:24 +00:00
2016-12-24 11:46:01 -08:00
2017-02-14 15:50:57 +01:00
2016-10-10 20:16:43 -07:00
2017-01-18 17:58:45 +01:00
2017-01-14 14:58:29 -06:00
2016-12-09 16:45:04 +01:00
2016-12-24 11:46:01 -08:00
2016-12-31 00:47:05 -05:00
2016-10-10 20:16:43 -07:00
2016-10-10 20:16:43 -07:00
2016-12-25 17:21:23 +01:00
2016-12-09 16:45:04 +01:00
2016-10-10 20:16:43 -07:00
2016-12-24 11:46:01 -08:00
2016-12-10 14:25:19 -05:00
2016-10-06 09:07:44 -04:00
2017-01-24 16:26:14 -08:00
2017-01-24 16:26:14 -08:00
2017-01-12 07:58:32 -07:00
2016-10-10 20:16:43 -07:00
2017-01-31 13:23:09 -05:00
2017-01-13 17:20:47 +01:00
2016-12-25 17:21:22 +01:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-09 16:45:04 +01:00
2016-10-10 20:16:43 -07:00
2016-12-24 11:46:01 -08:00
2016-12-13 10:19:16 -08:00
2016-12-24 11:46:01 -08:00
2016-12-09 16:45:04 +01:00
2016-12-24 11:46:01 -08:00
2016-12-17 19:16:12 -08:00
2016-11-18 10:59:15 -05:00
2016-12-09 16:45:04 +01:00
2016-12-24 11:46:01 -08:00
2017-01-26 15:50:41 -05:00
2016-11-18 10:59:15 -05:00
2017-02-09 20:49:20 -05:00
2016-12-17 19:16:12 -08:00
2017-01-05 23:06:06 -08:00
2016-12-24 11:46:01 -08:00
2017-01-10 18:31:54 -08:00
2016-10-10 20:16:43 -07:00
2016-12-24 11:46:01 -08:00
2016-12-17 19:16:12 -08:00
2017-01-18 15:19:54 +01:00
2017-02-07 12:08:32 -08:00
2017-02-09 11:49:49 -08:00
2016-12-19 08:23:53 -08:00
2016-12-24 11:46:01 -08:00
2016-12-17 19:16:12 -08:00
2017-01-24 16:26:14 -08:00
2016-12-17 19:16:12 -08:00
2016-10-14 12:18:50 -07:00
2016-12-09 16:45:04 +01:00
2016-09-27 21:06:21 -04:00
2017-01-17 14:35:58 +01:00
2016-11-01 09:43:26 -06:00
2016-12-24 11:46:01 -08:00
2017-01-27 09:32:30 -08:00
2017-01-14 19:31:40 -05:00
2016-12-24 11:46:01 -08:00
2016-10-10 20:16:43 -07:00
2016-12-09 11:57:43 +01:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2017-01-14 19:32:40 -05:00
2016-08-02 19:35:15 -04:00
2016-07-28 13:29:12 +10:00
2016-09-27 21:06:22 -04:00
2017-01-24 07:55:53 -07:00
2017-01-02 09:35:14 -07:00
2016-08-23 22:58:51 -07:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2017-01-14 19:32:40 -05:00
2017-02-03 14:13:19 -08:00
2017-01-10 13:34:43 +13:00
2016-12-24 11:46:01 -08:00
2017-01-10 13:29:54 -07:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-05 19:01:16 -05:00
2016-09-27 18:47:38 -04:00
2016-12-24 11:46:01 -08:00
2016-12-12 18:55:08 -08:00
2016-10-10 20:16:43 -07:00
2016-12-17 18:44:00 -08:00
2016-12-16 11:02:54 +01:00
2017-02-03 14:13:19 -08:00
2017-01-24 16:26:14 -08:00
2016-10-24 08:12:35 -02:00
2017-01-10 13:34:55 +13:00
2016-12-24 11:46:01 -08:00
2016-12-14 23:48:11 -05:00
2016-12-03 15:55:01 -05:00
2016-12-03 20:51:35 -05:00
2016-11-04 14:34:47 -06:00
2016-12-24 11:46:01 -08:00
2017-01-10 13:34:43 +13:00
2016-10-31 10:56:36 -04:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-16 16:30:49 -05:00
2016-09-30 12:46:48 -05:00
2017-01-10 01:29:48 -05:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00
2016-12-21 10:59:34 -08:00
2016-12-24 11:46:01 -08:00
2016-12-05 19:03:49 -05:00
2016-11-30 08:38:07 +01:00
2016-12-25 17:21:22 +01:00
2017-01-24 16:26:14 -08:00
2016-12-24 11:46:01 -08:00
2016-12-24 11:46:01 -08:00